From: Dan Carpenter <dan@pereq.eu>
To: sashiko-reviews@lists.linux.dev
Cc: kvmarm@lists.linux.dev, Oliver Upton <oupton@kernel.org>,
Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH 1/3] KVM: arm64: nv: Fix AT emulation for TCR2_EL1
Date: Sat, 28 Nov 2026 12:28:55 +0300 [thread overview]
Message-ID: <awqe16An2pmXAmfO@stanley.mountain> (raw)
In-Reply-To: <sashiko-outbox-237810@kernel.org>
Btw, sorry for not putting v3 in the subject. I'm just seeing that
I missed that now.
On Fri, Nov 27, 2026 at 04:01:09PM +0000, sashiko-bot@kernel.org wrote:
> > @@ -1437,8 +1463,9 @@ static u64 __kvm_at_s1e01_fast(struct kvm_vcpu *vcpu, u32 op, u64 vaddr)
> > write_sysreg_el1(vcpu_read_sys_reg(vcpu, TTBR1_EL1), SYS_TTBR1);
> > write_sysreg_el1(vcpu_read_sys_reg(vcpu, TCR_EL1), SYS_TCR);
> > write_sysreg_el1(vcpu_read_sys_reg(vcpu, MAIR_EL1), SYS_MAIR);
> > + if (cpus_have_final_cap(ARM64_HAS_TCR2))
> > + write_sysreg_el1(effective_tcr2(vcpu, TR_EL10), SYS_TCR2);
> > if (kvm_has_tcr2(vcpu->kvm)) {
> > - write_sysreg_el1(vcpu_read_sys_reg(vcpu, TCR2_EL1), SYS_TCR2);
> > if (kvm_has_s1pie(vcpu->kvm)) {
> > write_sysreg_el1(vcpu_read_sys_reg(vcpu, PIR_EL1), SYS_PIR);
> > write_sysreg_el1(vcpu_read_sys_reg(vcpu, PIRE0_EL1), SYS_PIRE0);
> > @@ -1452,6 +1479,17 @@ static u64 __kvm_at_s1e01_fast(struct kvm_vcpu *vcpu, u32 op, u64 vaddr)
> > __load_stage2(mmu);
>
> [Severity: High]
> This problem wasn't introduced by this patch, but when __kvm_at_s1e01_fast()
> switches to the shadow stage-2 MMU here [1], does it need to call
> kvm_arm_vmid_update(&mmu->vmid) and check and update mmu->last_vcpu_ran
> the way vcpu_prepare_mmu() does?
Patch 3 does the VMID stuff, but it doesn't handle the mmu->last_vcpu_ran
check. Probably it's simpler to use the slow path when they don't
match.
That fix would go in as a separate patch at the end. I'll resend the
series next week.
regards,
dan carpenter
next prev parent reply other threads:[~2026-11-28 9:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 15:31 [PATCH 0/3] KVM: arm64: nv: Fix AT emulation for nested virtualization Dan Carpenter
2026-11-27 15:31 ` [PATCH 1/3] KVM: arm64: nv: Fix AT emulation for TCR2_EL1 Dan Carpenter
2026-11-27 16:01 ` sashiko-bot
2026-11-28 9:28 ` Dan Carpenter [this message]
2026-11-27 15:31 ` [PATCH 2/3] KVM: arm64: Load no-access permissions when S1PIE or S1POE is hidden Dan Carpenter
2026-11-27 15:31 ` [PATCH 3/3] KVM: arm64: nv: Update the shadow MMU's VMID for AT emulation Dan Carpenter
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=awqe16An2pmXAmfO@stanley.mountain \
--to=dan@pereq.eu \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.