From: Bjorn Helgaas <helgaas@kernel.org>
To: Vivian Wang <wangruikang@iscas.ac.cn>
Cc: "Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Creeley, Brett" <bcreeley@amd.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>, "Han Gao" <gaohan@iscas.ac.cn>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
netdev@vger.kernel.org, linux-pci@vger.kernel.org,
linux-sound@vger.kernel.org, linux-riscv@lists.infradead.org,
sophgo@lists.linux.dev, "Thomas Gleixner" <tglx@kernel.org>
Subject: Re: [PATCH v2 2/4] PCI/MSI: Check msi_addr_mask in msi_verify_entries()
Date: Wed, 21 Jan 2026 17:38:04 -0600 [thread overview]
Message-ID: <20260121233804.GA1221537@bhelgaas> (raw)
In-Reply-To: <20260121-pci-msi-addr-mask-v2-2-f42593168989@iscas.ac.cn>
[+cc Thomas, thread at https://lore.kernel.org/r/20260121-pci-msi-addr-mask-v2-0-f42593168989@iscas.ac.cn]
On Wed, Jan 21, 2026 at 11:49:38AM +0800, Vivian Wang wrote:
> Instead of a 32-bit/64-bit dichotomy, check the MSI address against
> msi_addr_mask.
>
> This allows platforms with MSI doorbell above 32-bit address space to
> work with devices without full 64-bit MSI address support, as long as
> the doorbell is within addressable range of MSI of the device.
>
> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
>
> ---
> v2: No changes
> ---
> drivers/pci/msi/msi.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
> index 48f5f03d1479..2ecbcd6c436a 100644
> --- a/drivers/pci/msi/msi.c
> +++ b/drivers/pci/msi/msi.c
> @@ -321,14 +321,17 @@ static int msi_setup_msi_desc(struct pci_dev *dev, int nvec,
> static int msi_verify_entries(struct pci_dev *dev)
> {
> struct msi_desc *entry;
> + u64 address;
>
> if (dev->msi_addr_mask == DMA_BIT_MASK(64))
> return 0;
>
> msi_for_each_desc(entry, &dev->dev, MSI_DESC_ALL) {
> - if (entry->msg.address_hi) {
> - pci_err(dev, "arch assigned 64-bit MSI address %#x%08x but device only supports 32 bits\n",
> - entry->msg.address_hi, entry->msg.address_lo);
> + address = (u64)entry->msg.address_hi << 32 |
> + entry->msg.address_lo;
> + if (address & ~dev->msi_addr_mask) {
> + pci_err(dev, "arch assigned 64-bit MSI address %llx above device MSI address mask %llx\n",
Use %#llx so it's clear these addresses are hex. The previous message
did that, not sure why you dropped it.
> + address, dev->msi_addr_mask);
> break;
> }
> }
>
> --
> 2.52.0
>
next prev parent reply other threads:[~2026-01-21 23:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 3:49 [PATCH v2 0/4] PCI/MSI: Generalize no_64bit_msi into msi_addr_mask Vivian Wang
2026-01-21 3:49 ` [PATCH v2 1/4] PCI/MSI: Conservatively generalize " Vivian Wang
2026-01-21 8:21 ` Takashi Iwai
2026-01-21 23:40 ` Bjorn Helgaas
2026-01-21 3:49 ` [PATCH v2 2/4] PCI/MSI: Check msi_addr_mask in msi_verify_entries() Vivian Wang
2026-01-21 23:38 ` Bjorn Helgaas [this message]
2026-01-22 10:22 ` Vivian Wang
2026-01-21 3:49 ` [PATCH v2 3/4] drm/radeon: Raise msi_addr_mask to dma_bits Vivian Wang
2026-01-21 3:49 ` [PATCH v2 4/4] ALSA: hda/intel: " Vivian Wang
2026-01-21 8:15 ` Takashi Iwai
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=20260121233804.GA1221537@bhelgaas \
--to=helgaas@kernel.org \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrew+netdev@lunn.ch \
--cc=bcreeley@amd.com \
--cc=bhelgaas@google.com \
--cc=chleroy@kernel.org \
--cc=christian.koenig@amd.com \
--cc=davem@davemloft.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=edumazet@google.com \
--cc=gaohan@iscas.ac.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=npiggin@gmail.com \
--cc=pabeni@redhat.com \
--cc=perex@perex.cz \
--cc=simona@ffwll.ch \
--cc=sophgo@lists.linux.dev \
--cc=tglx@kernel.org \
--cc=tiwai@suse.com \
--cc=wangruikang@iscas.ac.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox