linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Gyujeong Jin <wlsrbwjd7232@gmail.com>
Cc: oliver.upton@linux.dev, joey.gouly@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com,
	catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, gyutrange <wlsrbwjd643@naver.com>
Subject: Re: [PATCH] KVM: arm64: nested: Fix VA sign extension in VNCR/TLBI paths
Date: Mon, 01 Sep 2025 14:28:16 +0100	[thread overview]
Message-ID: <86zfbecnf3.wl-maz@kernel.org> (raw)
In-Reply-To: <20250901124520.54259-1-wlsrbwjd7232@gmail.com>

On Mon, 01 Sep 2025 13:45:20 +0100,
Gyujeong Jin <wlsrbwjd7232@gmail.com> wrote:
> 
> From: gyutrange <wlsrbwjd643@naver.com>
> 
> Signed-off-by: gyutrange <wlsrbwjd643@naver.com>

Where is the commit message?

> ---
>  arch/arm64/kvm/nested.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> index 77db81bae86f..eaa6dd9da086 100644
> --- a/arch/arm64/kvm/nested.c
> +++ b/arch/arm64/kvm/nested.c
> @@ -1169,7 +1169,7 @@ int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu)
>  
>  static u64 read_vncr_el2(struct kvm_vcpu *vcpu)
>  {
> -	return (u64)sign_extend64(__vcpu_sys_reg(vcpu, VNCR_EL2), 48);
> +	return (u64)sign_extend64(__vcpu_sys_reg(vcpu, VNCR_EL2), 47);
>  }
>  

This code is not there for sign extension of the VA. It is there for
the propagation of bit 48 (yes, bit 48, not a typo) in RESS and the
top bits of BADDR. D24.2.206 has all the details for this.

Furthermore, we already check that the VA is canonical at the point of
establishing the translation (see the references to R_YYVYV and
I_THCZK in the S1 PTW code), and don't install a TLB in that case.

But maybe you have spotted something I didn't, so some explanations
would be very welcome.

Thanks,

	M.

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

  reply	other threads:[~2025-09-01 13:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 12:45 [PATCH] KVM: arm64: nested: Fix VA sign extension in VNCR/TLBI paths Gyujeong Jin
2025-09-01 13:28 ` Marc Zyngier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-09-01 14:15 Gyujeong Jin
2025-09-01 14:26 ` Marc Zyngier
2025-09-01 20:03 ` Greg KH
2025-09-01 20:04 ` Greg KH

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=86zfbecnf3.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=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=wlsrbwjd643@naver.com \
    --cc=wlsrbwjd7232@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).