public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Sebastian Ene <sebastianene@google.com>
Cc: catalin.marinas@arm.com, joey.gouly@arm.com,
	kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, oliver.upton@linux.dev,
	suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com
Subject: Re: [PATCH] KVM: arm64: Fix the upper limit of the walker range
Date: Tue, 14 Jan 2025 15:08:36 +0000	[thread overview]
Message-ID: <86ed15whzf.wl-maz@kernel.org> (raw)
In-Reply-To: <Z4Z8yRPGwvqHpzRs@google.com>

On Tue, 14 Jan 2025 15:03:37 +0000,
Sebastian Ene <sebastianene@google.com> wrote:
> 
> On Tue, Jan 14, 2025 at 02:55:17PM +0000, Marc Zyngier wrote:
> > On Tue, 14 Jan 2025 14:50:51 +0000,
> > Sebastian Ene <sebastianene@google.com> wrote:
> > > 
> > > Prevent the walker from running into weeds when walking an
> > > entire address range.
> > > 
> > > Signed-off-by: Sebastian Ene <sebastianene@google.com>
> > > ---
> > >  arch/arm64/kvm/hyp/pgtable.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
> > > index 40bd55966..2ffb5571e 100644
> > > --- a/arch/arm64/kvm/hyp/pgtable.c
> > > +++ b/arch/arm64/kvm/hyp/pgtable.c
> > > @@ -260,7 +260,7 @@ static int _kvm_pgtable_walk(struct kvm_pgtable *pgt, struct kvm_pgtable_walk_da
> > >  {
> > >  	u32 idx;
> > >  	int ret = 0;
> > > -	u64 limit = BIT(pgt->ia_bits);
> > > +	u64 limit = BIT(pgt->ia_bits) - 1;
> > >  
> > >  	if (data->addr > limit || data->end > limit)
> > >  		return -ERANGE;
> > 
> > Huh, nice catch. I guess this deserves a
> > 
> > Fixes: b1e57de62cfb4 ("KVM: arm64: Add stand-alone page-table walker infrastructure")
> > Cc: stable@vger.kernel.org
> > 
> > right?
> > 
> > 	M.
> 
> Hi Marc,
> 
> Thanks for the prompt review. Adding the missing bits now and re-spinnig
> v2.

Too late! ;-)

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2025-01-14 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 14:50 [PATCH] KVM: arm64: Fix the upper limit of the walker range Sebastian Ene
2025-01-14 14:55 ` Marc Zyngier
2025-01-14 15:03   ` Sebastian Ene
2025-01-14 15:08     ` Marc Zyngier [this message]
2025-01-14 15:07 ` Marc Zyngier
2025-01-16  1:16 ` Mark Brown
2025-01-16  2:07   ` Mark Brown
2025-01-16 10:55   ` Marc Zyngier
2025-01-16 13:49     ` Suzuki K Poulose
2025-01-16 14:50       ` Sebastian Ene

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=86ed15whzf.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=sebastianene@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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