Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kvmarm-fixes-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master

KVM/arm64 fixes for 5.15, take #1

- Add missing FORCE target when building the EL2 object
- Fix a PMU probe regression on some platforms

+17 -8
+1 -1
arch/arm64/kvm/hyp/nvhe/Makefile
··· 54 54 # runtime. Because the hypervisor is part of the kernel binary, relocations 55 55 # produce a kernel VA. We enumerate relocations targeting hyp at build time 56 56 # and convert the kernel VAs at those positions to hyp VAs. 57 - $(obj)/hyp-reloc.S: $(obj)/kvm_nvhe.tmp.o $(obj)/gen-hyprel 57 + $(obj)/hyp-reloc.S: $(obj)/kvm_nvhe.tmp.o $(obj)/gen-hyprel FORCE 58 58 $(call if_changed,hyprel) 59 59 60 60 # 5) Compile hyp-reloc.S and link it into the existing partially linked object.
-3
arch/arm64/kvm/perf.c
··· 50 50 51 51 int kvm_perf_init(void) 52 52 { 53 - if (kvm_pmu_probe_pmuver() != ID_AA64DFR0_PMUVER_IMP_DEF && !is_protected_kvm_enabled()) 54 - static_branch_enable(&kvm_arm_pmu_available); 55 - 56 53 return perf_register_guest_info_callbacks(&kvm_guest_cbs); 57 54 } 58 55
+8 -1
arch/arm64/kvm/pmu-emul.c
··· 740 740 kvm_pmu_create_perf_event(vcpu, select_idx); 741 741 } 742 742 743 - int kvm_pmu_probe_pmuver(void) 743 + void kvm_host_pmu_init(struct arm_pmu *pmu) 744 + { 745 + if (pmu->pmuver != 0 && pmu->pmuver != ID_AA64DFR0_PMUVER_IMP_DEF && 746 + !kvm_arm_support_pmu_v3() && !is_protected_kvm_enabled()) 747 + static_branch_enable(&kvm_arm_pmu_available); 748 + } 749 + 750 + static int kvm_pmu_probe_pmuver(void) 744 751 { 745 752 struct perf_event_attr attr = { }; 746 753 struct perf_event *event;
+2
drivers/perf/arm_pmu.c
··· 952 952 pmu->name, pmu->num_events, 953 953 has_nmi ? ", using NMIs" : ""); 954 954 955 + kvm_host_pmu_init(pmu); 956 + 955 957 return 0; 956 958 957 959 out_destroy:
-3
include/kvm/arm_pmu.h
··· 61 61 int kvm_arm_pmu_v3_has_attr(struct kvm_vcpu *vcpu, 62 62 struct kvm_device_attr *attr); 63 63 int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu); 64 - int kvm_pmu_probe_pmuver(void); 65 64 #else 66 65 struct kvm_pmu { 67 66 }; ··· 116 117 { 117 118 return 0; 118 119 } 119 - 120 - static inline int kvm_pmu_probe_pmuver(void) { return 0xf; } 121 120 122 121 #endif 123 122
+6
include/linux/perf/arm_pmu.h
··· 163 163 static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; } 164 164 #endif 165 165 166 + #ifdef CONFIG_KVM 167 + void kvm_host_pmu_init(struct arm_pmu *pmu); 168 + #else 169 + #define kvm_host_pmu_init(x) do { } while(0) 170 + #endif 171 + 166 172 /* Internal functions only for core arm_pmu code */ 167 173 struct arm_pmu *armpmu_alloc(void); 168 174 struct arm_pmu *armpmu_alloc_atomic(void);