All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Long Li <longli@microsoft.com>
Cc: Konstantin Taranov <kotaranov@microsoft.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	shradhagupta@linux.microsoft.com, ernis@linux.microsoft.com,
	stephen@networkplumber.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: mana: Cap MSI-X vectors to the device MSI-X table size
Date: Mon, 24 Aug 2026 17:16:58 +0100	[thread overview]
Message-ID: <20260824161658.GY265046@horms.kernel.org> (raw)
In-Reply-To: <20260821183736.733296-1-longli@microsoft.com>

On Fri, Aug 21, 2026 at 11:37:36AM -0700, Long Li wrote:
> mana_gd_query_max_resources() sizes gc->num_msix_usable from resp.max_msix
> and the CPU count, but never from the device MSI-X table. On a 1792 vCPU
> M-series VM that yields 1793 while the table has 1024 entries, and
> mana_gd_setup_remaining_irqs() then walks indices 1..1792, running off the
> end of the region mapped by msix_map_region():
> 
>   BUG: unable to handle page fault for address: ff8e347f8b99800c
>   RIP: 0010:msix_prepare_msi_desc+0x7a/0x90
>   RAX: 0000000000004000 RBX: ff4330cb164ea780 RCX: ff8e347f8b998000
>   Call Trace:
>    <TASK>
>    __msi_domain_alloc_irqs+0x13a/0x440
>    msi_domain_alloc_irq_at+0x149/0x1b0
>    mana_gd_setup+0x351/0x890
>    mana_gd_probe+0x274/0x390
>    </TASK>
> 
> RAX is index 1024 * PCI_MSIX_ENTRY_SIZE, one entry past the table.
> 
> msi_insert_desc() does range check the index, but only against the MSI
> domain hwsize, which matches the table only for devices on an MSI parent
> domain. With a global PCI/MSI domain hwsize is MSI_XA_DOMAIN_SIZE, so
> nothing bounds the request.
> 
> Cap num_msix_usable with pci_msix_vec_count().
> 
> Fixes: 755391121038 ("net: mana: Allocate MSI-X vectors dynamically")
> Signed-off-by: Long Li <longli@microsoft.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2026-08-24 16:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 18:37 [PATCH net] net: mana: Cap MSI-X vectors to the device MSI-X table size Long Li
2026-08-24 16:16 ` Simon Horman [this message]
2026-08-24 19:10 ` patchwork-bot+netdevbpf

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=20260824161658.GY265046@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=ernis@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=jgg@ziepe.ca \
    --cc=kotaranov@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=stephen@networkplumber.org \
    --cc=wei.liu@kernel.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.