From: Yang Shi <yang@os.amperecomputing.com>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: jgg@ziepe.ca, 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 12:48:01 -0700 [thread overview]
Message-ID: <742bd6d6-9d25-4f8c-9574-3d39a91c89cb@os.amperecomputing.com> (raw)
In-Reply-To: <ZvxNo8ZWeyBOBU8b@Asurada-Nvidia>
On 10/1/24 12:29 PM, Nicolin Chen wrote:
> On Tue, Oct 01, 2024 at 12:09:03PM -0700, Yang Shi wrote:
>> On 10/1/24 11:27 AM, Nicolin Chen wrote:
>>> On Tue, Oct 01, 2024 at 11:03:46AM -0700, Yang Shi wrote:
>>>> Using 64 bit immediate when doing shift can solve the problem. The
>>>> disssembly after the fix looks like:
>>> [...]
>>>
>>>> unsigned int last_sid_idx =
>>>> - arm_smmu_strtab_l1_idx((1 << smmu->sid_bits) - 1);
>>>> + arm_smmu_strtab_l1_idx((1UL << smmu->sid_bits) - 1);
>>> Could a 32-bit build be a corner case where UL is no longer a
>>> "64 bit" stated in the commit message?
>> It shouldn't. Because smmu v3 depends on ARM64.
>>
>> config ARM_SMMU_V3
>> tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
>> depends on ARM64
> ARM64 can have aarch32 support. I am not sure if ARM64 running a
> 32-bit OS can be a case though, (and not confined to AmpereOne).
I don't think ARM64 runs 32-bit kernel, at least for newer kernel.
>
>>> Then, can ssid_bits/s1cdmax be a concern similarly?
>> IIUC, ssid_bits is determined by IDR1_SSIDSIZE. It is GENMASK(10, 6). So
>> it shouldn't be 32. IDR1_SIDSIZE is GENMASK(5, 0).
> Rechecked the RM. Yea, max sid can be 32 but max ssid is 20 at
> this moment, so we should be safe.
>
> Thanks
> Nicolin
next prev parent reply other threads:[~2024-10-01 19:48 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
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 [this message]
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=742bd6d6-9d25-4f8c-9574-3d39a91c89cb@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®