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

Re: [PATCH for-4.21 v2] vpci/msix: improve handling of bogus MSI-X capabilities


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Thu, 9 Oct 2025 08:48:13 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o5dS+75ICDFn+HBf0KBDjBiKDWpK1DoCQK2xHFnZ+jE=; b=xPmiSBsEbEHy59YWFGVOt/kDgHt8AkU53BXR9mHY+imddq2+qNWwBqS+SvU8/KGhhIBFWIJgKzEGxy6O2vSgXGzUS4yDyMEMqX8APv7zqRLTUSdgQbfU4VAH7HyPGv7Gvi0t5RH0wqBN1iqdpz8VuedJcjZuLyQAJ0hFZRkocTjeA8UsU8rOiFuk5cC9wwpJrZsawscKpOcP/bjnimN9y1nZKyedyGTIj5/xtZ4qK7TYGjtd8tX9tj0wDqJ+1usuBi0SHm5TJQkVZxkgUoabxuBRUSbNZOqiaQtzMmaoPt+K6VbdktLszmNwlUntOIvpq3AqqV9ZAZkZh4X2qcmrMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bEux8iESMUagMutPC98FQgZT35lqDXLPw5kYe7Vto8kg/HcxqcSATBCzs9KZKGEthSmjO2lowYNY+VzbpFs6FuScLcV9Lvz0PrMPJehaREw9i48WLL3KPVSm1I3zw3o1FcwRwyvKgNsAvmSeH0c4Kdv1glOFqpUdCbjmGSBBSyJFJDmzKNpmWXOLQql7Y6FMj3crjjWWe37/O7hpyCNijigCPUUh9PkM95Hghd9Dk5DTPS9wSKb1kR5L3+j/uHDpjiJGfBHNfJltApXXrZJynscPg+3fxjSTW3EphO4d/1pxjGDC0LAHVETpVr2pH+ms14/HubFkARMssxXZwGdN3g==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <oleksii.kurochko@xxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 09 Oct 2025 12:48:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/9/25 03:23, Roger Pau Monné wrote:
> On Wed, Oct 08, 2025 at 09:17:30AM -0400, Stewart Hildebrand wrote:
>> On 10/8/25 10:39, Roger Pau Monne wrote:
>>> I've had the luck to come across a PCI card that exposes a MSI-X capability
>>> where the BIR of the vector and PBA tables points at a BAR that has 0 size.
>>>
>>> This doesn't play nice with the code in vpci_make_msix_hole(), as it would
>>> still use the address of such empty BAR (0) and attempt to carve a hole in
>>> the p2m.  This leads to errors like the one below being reported by Xen:
>>>
>>> d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers 
>>> MSIX MMIO area
>>>
>>> And the device left unable to enable memory decoding due to the failure
>>> reported by vpci_make_msix_hole().
>>>
>>> Introduce checking in init_msix() to ensure the BARs containing the MSI-X
>>> tables are usable.  This requires checking that the BIR points to a
>>> non-empty BAR, and the offset and size of the MSI-X tables can fit in the
>>> target BAR.
>>>
>>> This fixes booting PVH dom0 on Supermicro AS -2126HS-TN severs with AMD

s/severs/servers/

>>> EPYC 9965 processors.  The broken device is:
>>>
>>> 22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA 
>>> Controller [AHCI mode] (rev 93)
>>>
>>> There are multiple of those integrated controllers in the system, all
>>> broken in the same way.
>>>
>>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>> Released-Acked-By: Oleksii Kurochko<oleksii.kurochko@xxxxxxxxx>
>>> ---
>>> Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>>> Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
>>> ---
>>> Changes since v1:
>>>  - Introduce a DEVICE BUG prefix.
>>>  - Remove extra newline.
>>>  - Fix typo in commit message.
>>> ---
>>>  xen/drivers/vpci/msix.c | 50 ++++++++++++++++++++++++++++++++++++-----
>>>  xen/include/xen/lib.h   |  3 +++
>>>  2 files changed, 48 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
>>> index 54a5070733aa..4ddcefbcb274 100644
>>> --- a/xen/drivers/vpci/msix.c
>>> +++ b/xen/drivers/vpci/msix.c
>>
>> Do we need to #include <xen/lib.h>?
> 
> Can do,

With that adjusted:
Reviewed-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

> it's the same header that has the declarations for the printk
> functions that we already use in msix.c, so if it wasn't indirectly
> included the file won't build already.
> 
> Thanks, Roger.




 


Rackspace

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