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 #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.

+6 -2
+1 -1
arch/arm64/kvm/arm.c
··· 624 624 kvm_timer_vcpu_load(vcpu); 625 625 kvm_vgic_load(vcpu); 626 626 kvm_vcpu_load_debug(vcpu); 627 + kvm_vcpu_load_fgt(vcpu); 627 628 if (has_vhe()) 628 629 kvm_vcpu_load_vhe(vcpu); 629 630 kvm_arch_vcpu_load_fp(vcpu); ··· 643 642 vcpu->arch.hcr_el2 |= HCR_TWI; 644 643 645 644 vcpu_set_pauth_traps(vcpu); 646 - kvm_vcpu_load_fgt(vcpu); 647 645 648 646 if (is_protected_kvm_enabled()) { 649 647 kvm_call_hyp_nvhe(__pkvm_vcpu_load,
+5 -1
arch/arm64/kvm/sys_regs.c
··· 5609 5609 5610 5610 guard(mutex)(&kvm->arch.config_lock); 5611 5611 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)) { 5613 5617 u64 val; 5614 5618 5615 5619 val = kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1) & ~ID_AA64PFR0_EL1_GIC;