[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250806141707.3479194-3-volodymyr_babchuk@epam.com>
Date: Wed, 6 Aug 2025 14:17:55 +0000
From: Volodymyr Babchuk <Volodymyr_Babchuk@...m.com>
To: "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "kvmarm@...ts.linux.dev"
<kvmarm@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@...m.com>, Marc Zyngier
<maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>, Joey Gouly
<joey.gouly@....com>, Suzuki K Poulose <suzuki.poulose@....com>, Zenghui Yu
<yuzenghui@...wei.com>, Catalin Marinas <catalin.marinas@....com>, Will
Deacon <will@...nel.org>
Subject: [PATCH v1 2/2] KVM: arm64: nv: update CPU register PAR_EL1 after 'at
s*'
Previously this code update only vCPU's in-memory value, which is good,
but not enough, as there will be no context switch after exiting
exception handler, so in-memory value will not get into actual
register.
It worked good enough for VHE guests because KVM code tried fast path,
which of course updated real PAR_EL1.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@...m.com>
---
arch/arm64/kvm/sys_regs.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 7b8a0a6f26468..ab2b5e261d312 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -3463,6 +3463,9 @@ static bool handle_at_s1e2(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
__kvm_at_s1e2(vcpu, op, p->regval);
+ /* No context switch happened, so we need to update PAR_EL1 manually */
+ write_sysreg(vcpu_read_sys_reg(vcpu, PAR_EL1), par_el1);
+
return true;
}
@@ -3473,6 +3476,9 @@ static bool handle_at_s12(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
__kvm_at_s12(vcpu, op, p->regval);
+ /* No context switch happened, so we need to update PAR_EL1 manually */
+ write_sysreg(vcpu_read_sys_reg(vcpu, PAR_EL1), par_el1);
+
return true;
}
--
2.50.1
Powered by blists - more mailing lists