Skip to content

Commit b82ebaf

Browse files
committed
Merge tag 'kvmarm-fixes-6.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 6.18, take kernel-patches#3 - Only adjust the ID registers when no irqchip has been created once per VM run, instead of doing it once per vcpu, as this otherwise triggers a pretty bad conbsistency check failure in the sysreg code. - Make sure the per-vcpu Fine Grain Traps are computed before we load the system registers on the HW, as we otherwise start running without anything set until the first preemption of the vcpu.
2 parents 6a23ae0 + 8559211 commit b82ebaf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

arch/arm64/kvm/arm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
624624
kvm_timer_vcpu_load(vcpu);
625625
kvm_vgic_load(vcpu);
626626
kvm_vcpu_load_debug(vcpu);
627+
kvm_vcpu_load_fgt(vcpu);
627628
if (has_vhe())
628629
kvm_vcpu_load_vhe(vcpu);
629630
kvm_arch_vcpu_load_fp(vcpu);
@@ -642,7 +643,6 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
642643
vcpu->arch.hcr_el2 |= HCR_TWI;
643644

644645
vcpu_set_pauth_traps(vcpu);
645-
kvm_vcpu_load_fgt(vcpu);
646646

647647
if (is_protected_kvm_enabled()) {
648648
kvm_call_hyp_nvhe(__pkvm_vcpu_load,

arch/arm64/kvm/sys_regs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5609,7 +5609,11 @@ int kvm_finalize_sys_regs(struct kvm_vcpu *vcpu)
56095609

56105610
guard(mutex)(&kvm->arch.config_lock);
56115611

5612-
if (!irqchip_in_kernel(kvm)) {
5612+
/*
5613+
* This hacks into the ID registers, so only perform it when the
5614+
* first vcpu runs, or the kvm_set_vm_id_reg() helper will scream.
5615+
*/
5616+
if (!irqchip_in_kernel(kvm) && !kvm_vm_has_ran_once(kvm)) {
56135617
u64 val;
56145618

56155619
val = kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1) & ~ID_AA64PFR0_EL1_GIC;

0 commit comments

Comments
 (0)