[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIMR6xxR3Jdpy8kX@google.com>
Date: Fri, 25 Jul 2025 05:11:07 +0000
From: Pranjal Shrivastava <praan@...gle.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: jgg@...dia.com, will@...nel.org, joro@...tes.org, robin.murphy@....com,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH v3 2/2] iommu/arm-smmu-v3: Replace vsmmu_size/type with
get_viommu_size
On Thu, Jul 24, 2025 at 02:49:28PM -0700, Nicolin Chen wrote:
> On Thu, Jul 24, 2025 at 08:55:50PM +0000, Pranjal Shrivastava wrote:
> > On Wed, Jul 23, 2025 at 06:58:20PM +0000, Pranjal Shrivastava wrote:
> > > On Wed, Jul 23, 2025 at 11:05:26AM -0700, Nicolin Chen wrote:
> > > > On Wed, Jul 23, 2025 at 01:37:53PM +0000, Pranjal Shrivastava wrote:
> > > > > On Mon, Jul 21, 2025 at 01:04:44PM -0700, Nicolin Chen wrote:
> > > > > > @@ -1273,6 +1279,10 @@ tegra241_cmdqv_init_vintf_user(struct arm_vsmmu *vsmmu,
> > > > > > phys_addr_t page0_base;
> > > > > > int ret;
> > > > > >
> > > > > > + /* Unsupported type was rejected in tegra241_cmdqv_get_vintf_size() */
> >
> > Sorry, if this wasn't clear in the previous comment. I meant this
> > comment must be updated, the "unsupported type" wasn't rejected in
> > vintf_size, rather the type got corrupted which brought us here.
>
> Any unsupported type would be indeed rejected by the init op
> callback. There is nothing wrong with that statement.
The comment mentioned tegra241_cmdqv_get_vintf_size() which isn't the
init op. The statement:
"unsupported type would be indeed rejected by the init op"
isn't the same as:
"Unsupported type was rejected in tegra241_cmdqv_get_vintf_size()"
>
> It indicates that we shouldn't see an unsupported type here,
> unless some serious kernel bug like data corruption happens,
> which is implied by the WARN_ON itself.
>
> > Had the
> > vintf_size rejected it, we wouldn't be calling the init op.
>
> A data corruption could happen any time, not related to the
> init op. A concurrent buggy thread can overwrite the vIOMMU
> object when a write access to its adjacent memory overflows.
>
I'm agreeing with all of it, it's just that the comment says something
was rejected in by the size op, which raises confusion as to why we're
in the init op. The init op rejecting something due to data corruption
is a different thing..
I totally get the point about data corruption, i.e.:
size op -> returned something valid
<data corruption>
init op -> rejecting corrupted type
Wheras I was just trying to understand a case where as per the comment:
"Unsupported type was rejected in tegra241_cmdqv_get_vintf_size()",
i.e. ->size op returned 0, yet we ended up calling the init op
I guess I should've been more clear. Sorry for all the confusion.
> Nicolin
Praan
Powered by blists - more mailing lists