From: Dave Jiang <dave.jiang@intel.com>
To: Fedor Pchelkin <pchelkin@ispras.ru>, Jon Mason <jdmason@kudzu.us>
Cc: Allen Hubbe <allenbh@gmail.com>,
Logan Gunthorpe <logang@deltatee.com>,
ntb@lists.linux.dev, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org, stable@vger.kernel.org
Subject: Re: [PATCH] ntb: use 64-bit arithmetic for the MSI doorbell mask
Date: Thu, 16 Jan 2025 08:44:36 -0700 [thread overview]
Message-ID: <a8b2695d-7bdc-4da0-883d-5a73a7c553ff@intel.com> (raw)
In-Reply-To: <20250115182817.24445-1-pchelkin@ispras.ru>
On 1/15/25 11:28 AM, Fedor Pchelkin wrote:
> msi_db_mask is of type 'u64', still the standard 'int' arithmetic is
> performed to compute its value.
>
> While most of the ntb_hw drivers actually don't utilize the higher 32
> bits of the doorbell mask now, this may be the case for Switchtec - see
> switchtec_ntb_init_db().
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE static
> analysis tool.
>
> Fixes: 2b0569b3b7e6 ("NTB: Add MSI interrupt support to ntb_transport")
> Cc: stable@vger.kernel.org
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
LGTM. Should be using the BIT() macro to begin with.
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/ntb/ntb_transport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index a22ea4a4b202..4f775c3e218f 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -1353,7 +1353,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
> qp_count = ilog2(qp_bitmap);
> if (nt->use_msi) {
> qp_count -= 1;
> - nt->msi_db_mask = 1 << qp_count;
> + nt->msi_db_mask = BIT_ULL(qp_count);
> ntb_db_clear_mask(ndev, nt->msi_db_mask);
> }
>
prev parent reply other threads:[~2025-01-16 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 18:28 [PATCH] ntb: use 64-bit arithmetic for the MSI doorbell mask Fedor Pchelkin
2025-01-16 15:44 ` Dave Jiang [this message]
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=a8b2695d-7bdc-4da0-883d-5a73a7c553ff@intel.com \
--to=dave.jiang@intel.com \
--cc=allenbh@gmail.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=lvc-project@linuxtesting.org \
--cc=ntb@lists.linux.dev \
--cc=pchelkin@ispras.ru \
--cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox