public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Yang Shi <yang@os.amperecomputing.com>
Cc: Nicolin Chen <nicolinc@nvidia.com>,
	james.morse@arm.com, will@kernel.org, robin.murphy@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [v2 PATCH] iommu/arm-smmu-v3: Fix L1 stream table index calculation for 32-bit sid size
Date: Fri, 4 Oct 2024 13:14:08 -0300	[thread overview]
Message-ID: <20241004161408.GJ2456194@ziepe.ca> (raw)
In-Reply-To: <26ee77f2-720d-4e16-9f6c-fa15fd13d305@os.amperecomputing.com>

On Fri, Oct 04, 2024 at 09:05:46AM -0700, Yang Shi wrote:
> 
> 
> On 10/4/24 5:43 AM, Jason Gunthorpe wrote:
> > On Thu, Oct 03, 2024 at 08:31:23AM -0700, Yang Shi wrote:
> > > If I understand correctly, the check is mainly used to avoid the u64 -> u32
> > > overflow. This check guarantee no overflow. If some crazy hardware really
> > > requests that large memory, the allocation will fail.
> > Sure, the kalloc will print a warn on anyhow if it is too big
> 
> Thank you. Will spin a new revision.

Oh wait a sec, it is not so simple, the 31 is too big because the
multiply will overflow or truncate to size_t too. This is why I picked
something lower.

Jason


  reply	other threads:[~2024-10-04 17:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 17:55 [v2 PATCH] iommu/arm-smmu-v3: Fix L1 stream table index calculation for 32-bit sid size Yang Shi
2024-10-02 18:14 ` Jason Gunthorpe
2024-10-02 18:17 ` Nicolin Chen
2024-10-02 19:04   ` Yang Shi
2024-10-02 19:22     ` Nicolin Chen
2024-10-02 19:40       ` Jason Gunthorpe
2024-10-02 20:00         ` Yang Shi
2024-10-02 20:05         ` Yang Shi
2024-10-03 11:16           ` Jason Gunthorpe
2024-10-03 15:31             ` Yang Shi
2024-10-04 12:43               ` Jason Gunthorpe
2024-10-04 16:05                 ` Yang Shi
2024-10-04 16:14                   ` Jason Gunthorpe [this message]
2024-10-04 16:29                     ` Yang Shi
2024-10-04 16:37                       ` Yang Shi
2024-10-04 16:41                         ` Jason Gunthorpe
2024-10-04 16:46                           ` Yang Shi
2024-10-02 19:50       ` Yang Shi
2024-10-02 18:21 ` Robin Murphy
2024-10-02 18:36   ` Yang Shi

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=20241004161408.GJ2456194@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    --cc=yang@os.amperecomputing.com \
    /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