From: "Roger Pau Monné" <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: oleksii.kurochko@gmail.com,
Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Stewart Hildebrand <stewart.hildebrand@amd.com>
Subject: Re: [PATCH for-4.21 v2] vpci/msix: improve handling of bogus MSI-X capabilities
Date: Wed, 8 Oct 2025 16:59:39 +0200 [thread overview]
Message-ID: <aOZ8W_--kyn6Kjol@Mac.lan> (raw)
In-Reply-To: <20251008143923.2557-1-roger.pau@citrix.com>
On Wed, Oct 08, 2025 at 04:39:23PM +0200, 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
> 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@citrix.com>
> Released-Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
> ---
> Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>
> Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> 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
> @@ -675,6 +675,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
> if ( !msix )
> return -ENOMEM;
>
> + msix->tables[VPCI_MSIX_TABLE] =
> + pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
> + msix->tables[VPCI_MSIX_PBA] =
> + pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
> +
> + /* Check that the provided BAR is valid. */
I had the following local change that I forgot to update the patch
with before sending:
/* Check that the referenced BAR(s) regions are valid. */
I think this is a better wording.
Thanks, Roger.
next prev parent reply other threads:[~2025-10-08 15:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 14:39 [PATCH for-4.21 v2] vpci/msix: improve handling of bogus MSI-X capabilities Roger Pau Monne
2025-10-08 13:17 ` Stewart Hildebrand
2025-10-09 7:23 ` Roger Pau Monné
2025-10-09 12:48 ` Stewart Hildebrand
2025-10-08 14:59 ` Roger Pau Monné [this message]
2025-10-09 12:49 ` Stewart Hildebrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOZ8W_--kyn6Kjol@Mac.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=sstabellini@kernel.org \
--cc=stewart.hildebrand@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.