mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Shi <yang@os.amperecomputing.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Nicolin Chen <nicolinc@nvidia.com>,
	will@kernel.org, robin.murphy@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/arm-smmu-v3: Fix L1 stream table index calculation for AmpereOne
Date: Tue, 1 Oct 2024 13:31:37 -0700	[thread overview]
Message-ID: <25b82e36-c142-4d50-8ae0-ccd2e0687744@os.amperecomputing.com> (raw)
In-Reply-To: <20241001194620.GB1369530@ziepe.ca>



On 10/1/24 12:46 PM, Jason Gunthorpe wrote:
> On Tue, Oct 01, 2024 at 12:38:56PM -0700, Yang Shi wrote:
>>
>> On 10/1/24 12:18 PM, Jason Gunthorpe wrote:
>>> On Tue, Oct 01, 2024 at 12:09:03PM -0700, Yang Shi wrote:
>>>>> Also, there are other places doing "1 << smmu->sid_bits", e.g.
>>>>> arm_smmu_init_strtab_linear().
>>>> The disassembly shows it uses "sbfiz x21, x20, 6, 32" instead of lsl. 1UL
>>>> should be used if we want to take extra caution and don't prefer rely on
>>>> compiler.
>>> Still, we should be fixing them all if sid_bits == 32, all those
>>> shifts should be throwing a UBSAN error. It would be crazy to have a
>> OK, will cover this is v2.
> Maybe just make a little inline function to do this math and remove
> the repated open coding? Then the types can be right, etc.

Fine to me.

>
> Jason


  reply	other threads:[~2024-10-01 20:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 18:03 Yang Shi
2024-10-01 18:27 ` Nicolin Chen
2024-10-01 19:09   ` Yang Shi
2024-10-01 19:18     ` Jason Gunthorpe
2024-10-01 19:38       ` Yang Shi
2024-10-01 19:46         ` Jason Gunthorpe
2024-10-01 20:31           ` Yang Shi [this message]
2024-10-01 20:47           ` Yang Shi
2024-10-01 21:02             ` Jason Gunthorpe
2024-10-01 21:32               ` Yang Shi
2024-10-02 16:58             ` James Morse
2024-10-01 19:29     ` Nicolin Chen
2024-10-01 19:48       ` Yang Shi
2024-10-02  9:59         ` Robin Murphy
2024-10-02 15:38           ` Yang Shi
2024-10-02 16:58 ` James Morse
2024-10-02 17:39   ` 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=25b82e36-c142-4d50-8ae0-ccd2e0687744@os.amperecomputing.com \
    --to=yang@os.amperecomputing.com \
    --cc=jgg@ziepe.ca \
    --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 \
    /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

all inboxes | Powered by JetHome®