[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stable-4.18: reliably crash network driver domain by squeezing free_memory


  • To: James Dingwall <james@xxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 3 Dec 2024 09:20:27 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • Delivery-date: Tue, 03 Dec 2024 08:20:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.12.2024 16:54, James Dingwall wrote:
> On Thu, Nov 28, 2024 at 03:39:07PM +0000, Andrew Cooper wrote:
>> On 28/11/2024 3:31 pm, James Dingwall wrote:
>>> Hi,
>>>
>>> We have reproducible issue with the current HEAD of the stable-4.18 branch
>>> which crashes a network driver domain and on some hardware subsequently
>>> results in a dom0 crash.
>>>
>>> `xl info` reports: free_memory : 39961, configuring a guest with
>>> memory = 39800 and starting it gives the log as below.  This is intel
>>> hardware so if I've followed the code correctly I think this leads through
>>> to intel_iommu_map_page() from drivers/passthrough/vtd/iommu.c.
>>>
>>> The expectation is that we can safely allocate up to free_memory for a
>>> guest without any issue.  Is there any extra logging we could enable to
>>> gain more information?
>>
>> For this, you really should CC the x86 maintainers, or it stands a
>> chance of getting missed.
>>
>> Do you have the complete serial log including boot and eventual crash ?
>>
>> -12 is -ENOMEM so something is wonky, and while dom2 is definitely dead
>> at this point, Xen ought to be able to unwind cleanly and not take down
>> dom0 too.
>>
>> ~Andrew
> 
> <snipped the original crash report since it is also in the attached logs>
> 
> I've attached complete serial console logs from an Intel and an AMD dom0
> which show similar behaviour.  The dom0 crash originally mentioned was
> resolved by updating a patch for OpenZFS issue #15140 and no longer
> occurs.
> 
> During the capture of the serial console logs I noted that:
> 
> 1. If the order that the domains start is different then there is no crash.
>    Restarting the domain later will lead to the driver domain crash even
>    without a configuration change.
> 2. If the domU memory is closer to free_memory but still less than the
>    domain fails to start with libxl reporting not enough memory.
> 
> So there is some undefined range for (free_memory - m) to (free_memory - n)
> where it is possible to crash the driver domain depending on the guest
> startup ordering.  My (perhaps naive) reasoning would be that
> free_memory is the resource available to safely assign without having to
> allow for some unknown overhead and if I do ask for too much then I
> get a 'safe' failure.

As per the earlier reply I sent, this isn't the case. "free_memory" isn't
adjusted to account for extra overhead. As per Marek's reply, you need to
leave some spare, at least as of how things are right now.

Jan

PS: I've dropped security@. We're now firmly into discussing this in public,
irrespective of possible security angles. I don't think that's what should
have happened, but it also makes no sense to further pretend to attempt to
first assess the full scope in private.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.