[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z1rWnejzN5Zk8TDU@google.com>
Date: Thu, 12 Dec 2024 12:27:09 +0000
From: Quentin Perret <qperret@...gle.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Ard Biesheuvel <ardb+git@...gle.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Ryan Roberts <ryan.roberts@....com>,
Anshuman Khandual <anshuman.khandual@....com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v3 4/6] arm64/kvm: Avoid invalid physical addresses to
signal owner updates
On Thursday 12 Dec 2024 at 12:44:38 (+0100), Ard Biesheuvel wrote:
> On Thu, 12 Dec 2024 at 12:33, Quentin Perret <qperret@...gle.com> wrote:
> >
> > On Thursday 12 Dec 2024 at 09:18:46 (+0100), Ard Biesheuvel wrote:
> > > @@ -908,6 +892,9 @@ static bool stage2_leaf_mapping_allowed(const struct kvm_pgtable_visit_ctx *ctx,
> > > if (data->force_pte && ctx->level < KVM_PGTABLE_LAST_LEVEL)
> > > return false;
> > >
> > > + if (data->annotation && ctx->level == KVM_PGTABLE_LAST_LEVEL)
> > > + return true;
> > > +
> >
> > I don't think it's a problem, but what's the rationale for checking
> > ctx->level here? The data->force_pte logic should already do this for us
> > and be somewhat orthogonal to data->annotation, no?
> >
>
> So you are saying this could be
>
> > > + if (data->annotation)
> > > + return true;
>
> right?
Yep, exactly.
> That hides the fact that we expect data->annotation to imply
> data->force_pte, but other than that, it should work the same, yes.
Eventually we'll want to make the two orthogonal to each other (e.g. to
annotate blocks when donating huge pages to protected guests), but
that'll require more work so again I don't mind that check in the
current code. We can always get rid of it when annotations on blocks
are supported.
Cheers,
Quentin
Powered by blists - more mailing lists