Pull KVM fixes from Radim Krčmář: "ARM: - avoid livelock when walking guest page tables - fix HYP mode static keys without CC_HAVE_ASM_GOTO MIPS: - fix a build error without TRACEPOINTS_ENABLED s390: - reject a malformed userspace configuration x86: - suppress a warning without CONFIG_CPU_FREQ - initialize whole irq_eoi array" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: arm/arm64: KVM: Map the BSS at HYP arm64: KVM: Take S1 walks into account when determining S2 write faults KVM: s390: reject invalid modes for runtime instrumentation kvm: x86: memset whole irq_eoi kvm/x86: Fix unused variable warning in kvm_timer_init() KVM: MIPS: Add missing uaccess.h include
Unified · Split
| @@ -1312,6 +1312,13 @@ static int init_hyp_mode(void) · 1311 unmodified lines | |||
| 1312 | goto out_err; | 1312 | goto out_err; |
| 1313 | } | 1313 | } |
| 1314 | 1314 | ||
| 1315 | err = create_hyp_mappings(kvm_ksym_ref(__bss_start), | ||
| 1316 | kvm_ksym_ref(__bss_stop), PAGE_HYP_RO); | ||
| 1317 | if (err) { | ||
| 1318 | kvm_err("Cannot map bss section\n"); | ||
| 1319 | goto out_err; | ||
| 1320 | } | ||
| 1321 | |||
| 1315 | /* | 1322 | /* |
| 1316 | * Map the Hyp stack pages | 1323 | * Map the Hyp stack pages |
| 1317 | */ | 1324 | */ |
| @@ -178,11 +178,6 @@ static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu) · 177 unmodified lines | |||
| 178 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV); | 178 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu) | ||
| 182 | { | ||
| 183 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR); | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu) | 181 | static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu) |
| 187 | { | 182 | { |
| 188 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SSE); | 183 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SSE); |
| @@ -203,6 +198,12 @@ static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu) · 14 unmodified lines | |||
| 203 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW); | 198 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW); |
| 204 | } | 199 | } |
| 205 | 200 | ||
| 201 | static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu) | ||
| 202 | { | ||
| 203 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) || | ||
| 204 | kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */ | ||
| 205 | } | ||
| 206 | |||
| 206 | static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu) | 207 | static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu) |
| 207 | { | 208 | { |
| 208 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM); | 209 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM); |
| @@ -14,6 +14,7 @@ · 13 unmodified lines | |||
| 14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
| 15 | #include <linux/kdebug.h> | 15 | #include <linux/kdebug.h> |
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | #include <linux/uaccess.h> | ||
| 17 | #include <linux/vmalloc.h> | 18 | #include <linux/vmalloc.h> |
| 18 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
| 19 | #include <linux/bootmem.h> | 20 | #include <linux/bootmem.h> |
| @@ -119,8 +119,13 @@ static int handle_validity(struct kvm_vcpu *vcpu) · 118 unmodified lines | |||
| 119 | 119 | ||
| 120 | vcpu->stat.exit_validity++; | 120 | vcpu->stat.exit_validity++; |
| 121 | trace_kvm_s390_intercept_validity(vcpu, viwhy); | 121 | trace_kvm_s390_intercept_validity(vcpu, viwhy); |
| 122 | WARN_ONCE(true, "kvm: unhandled validity intercept 0x%x\n", viwhy); | 122 | KVM_EVENT(3, "validity intercept 0x%x for pid %u (kvm 0x%pK)", viwhy, |
| 123 | return -EOPNOTSUPP; | 123 | current->pid, vcpu->kvm); |
| 124 | |||
| 125 | /* do not warn on invalid runtime instrumentation mode */ | ||
| 126 | WARN_ONCE(viwhy != 0x44, "kvm: unhandled validity intercept 0x%x\n", | ||
| 127 | viwhy); | ||
| 128 | return -EINVAL; | ||
| 124 | } | 129 | } |
| 125 | 130 | ||
| 126 | static int handle_instruction(struct kvm_vcpu *vcpu) | 131 | static int handle_instruction(struct kvm_vcpu *vcpu) |
| @@ -594,7 +594,7 @@ static void kvm_ioapic_reset(struct kvm_ioapic *ioapic) · 593 unmodified lines | |||
| 594 | ioapic->irr = 0; | 594 | ioapic->irr = 0; |
| 595 | ioapic->irr_delivered = 0; | 595 | ioapic->irr_delivered = 0; |
| 596 | ioapic->id = 0; | 596 | ioapic->id = 0; |
| 597 | memset(ioapic->irq_eoi, 0x00, IOAPIC_NUM_PINS); | 597 | memset(ioapic->irq_eoi, 0x00, sizeof(ioapic->irq_eoi)); |
| 598 | rtc_irq_eoi_tracking_reset(ioapic); | 598 | rtc_irq_eoi_tracking_reset(ioapic); |
| 599 | } | 599 | } |
| 600 | 600 | ||
| @@ -5733,13 +5733,13 @@ static int kvmclock_cpu_online(unsigned int cpu) · 5732 unmodified lines | |||
| 5733 | 5733 | ||
| 5734 | static void kvm_timer_init(void) | 5734 | static void kvm_timer_init(void) |
| 5735 | { | 5735 | { |
| 5736 | int cpu; | ||
| 5737 | |||
| 5738 | max_tsc_khz = tsc_khz; | 5736 | max_tsc_khz = tsc_khz; |
| 5739 | 5737 | ||
| 5740 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { | 5738 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { |
| 5741 | #ifdef CONFIG_CPU_FREQ | 5739 | #ifdef CONFIG_CPU_FREQ |
| 5742 | struct cpufreq_policy policy; | 5740 | struct cpufreq_policy policy; |
| 5741 | int cpu; | ||
| 5742 | |||
| 5743 | memset(&policy, 0, sizeof(policy)); | 5743 | memset(&policy, 0, sizeof(policy)); |
| 5744 | cpu = get_cpu(); | 5744 | cpu = get_cpu(); |
| 5745 | cpufreq_get_policy(&policy, cpu); | 5745 | cpufreq_get_policy(&policy, cpu); |