Skip to content

Commit 6f5adb3

Browse files
committed
Merge tag 'kvmarm-fixes-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 5.18, take #3 - Correctly expose GICv3 support even if no irqchip is created so that userspace doesn't observe it changing pointlessly (fixing a regression with QEMU) - Don't issue a hypercall to set the id-mapped vectors when protected mode is enabled (fix for pKVM in combination with CPUs affected by Spectre-v3a)
2 parents b28cb0c + 2e40316 commit 6f5adb3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

arch/arm64/kvm/arm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,8 @@ static int kvm_init_vector_slots(void)
14361436
base = kern_hyp_va(kvm_ksym_ref(__bp_harden_hyp_vecs));
14371437
kvm_init_vector_slot(base, HYP_VECTOR_SPECTRE_DIRECT);
14381438

1439-
if (kvm_system_needs_idmapped_vectors() && !has_vhe()) {
1439+
if (kvm_system_needs_idmapped_vectors() &&
1440+
!is_protected_kvm_enabled()) {
14401441
err = create_hyp_exec_mappings(__pa_symbol(__bp_harden_hyp_vecs),
14411442
__BP_HARDEN_HYP_VECS_SZ, &base);
14421443
if (err)

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,7 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu,
11231123
val |= FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_CSV2), (u64)vcpu->kvm->arch.pfr0_csv2);
11241124
val &= ~ARM64_FEATURE_MASK(ID_AA64PFR0_CSV3);
11251125
val |= FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_CSV3), (u64)vcpu->kvm->arch.pfr0_csv3);
1126-
if (irqchip_in_kernel(vcpu->kvm) &&
1127-
vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
1126+
if (kvm_vgic_global_state.type == VGIC_V3) {
11281127
val &= ~ARM64_FEATURE_MASK(ID_AA64PFR0_GIC);
11291128
val |= FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_GIC), 1);
11301129
}

0 commit comments

Comments
 (0)