Re: [PATCH v3 2/4] PCI/MSI: Check msi_addr_mask in msi_verify_entries()

Thomas Gleixner <[email protected]>
Newsgroups dev.linux.lists.sophgo,org.freedesktop.lists.amd-gfx,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.linux-sound,org.kernel.vger.netdev,org.ozlabs.lists.linuxppc-dev
Message-ID <87jyx3be1t.ffs@tglx>
On Fri, Jan 23 2026 at 14:07, 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

with a MSI doorbell address above the 32-bit limit 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.

within the addressable

>  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;

No line break required. Let it stick out.

> +		if (address & ~dev->msi_addr_mask) {
> +			pci_err(dev, "arch assigned 64-bit MSI address %#llx above device MSI address mask %#llx\n",
> +				address, dev->msi_addr_mask);
>  			break;
>  		}
>  	}

Other than those nits:

Reviewed-by: Thomas Gleixner <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.