Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a23b27a

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
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
2 parents 02593ac + 658f7c4 commit a23b27a

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

arch/arm/kvm/arm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,13 @@ static int init_hyp_mode(void)
13121312
goto out_err;
13131313
}
13141314

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+
13151322
/*
13161323
* Map the Hyp stack pages
13171324
*/

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
178178
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
179179
}
180180

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-
186181
static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu)
187182
{
188183
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)
203198
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
204199
}
205200

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+
206207
static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)
207208
{
208209
return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);

arch/mips/kvm/mips.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/err.h>
1515
#include <linux/kdebug.h>
1616
#include <linux/module.h>
17+
#include <linux/uaccess.h>
1718
#include <linux/vmalloc.h>
1819
#include <linux/fs.h>
1920
#include <linux/bootmem.h>

arch/s390/kvm/intercept.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,13 @@ static int handle_validity(struct kvm_vcpu *vcpu)
119119

120120
vcpu->stat.exit_validity++;
121121
trace_kvm_s390_intercept_validity(vcpu, viwhy);
122-
WARN_ONCE(true, "kvm: unhandled validity intercept 0x%x\n", viwhy);
123-
return -EOPNOTSUPP;
122+
KVM_EVENT(3, "validity intercept 0x%x for pid %u (kvm 0x%pK)", viwhy,
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;
124129
}
125130

126131
static int handle_instruction(struct kvm_vcpu *vcpu)

arch/x86/kvm/ioapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static void kvm_ioapic_reset(struct kvm_ioapic *ioapic)
594594
ioapic->irr = 0;
595595
ioapic->irr_delivered = 0;
596596
ioapic->id = 0;
597-
memset(ioapic->irq_eoi, 0x00, IOAPIC_NUM_PINS);
597+
memset(ioapic->irq_eoi, 0x00, sizeof(ioapic->irq_eoi));
598598
rtc_irq_eoi_tracking_reset(ioapic);
599599
}
600600

arch/x86/kvm/x86.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5733,13 +5733,13 @@ static int kvmclock_cpu_online(unsigned int cpu)
57335733

57345734
static void kvm_timer_init(void)
57355735
{
5736-
int cpu;
5737-
57385736
max_tsc_khz = tsc_khz;
57395737

57405738
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
57415739
#ifdef CONFIG_CPU_FREQ
57425740
struct cpufreq_policy policy;
5741+
int cpu;
5742+
57435743
memset(&policy, 0, sizeof(policy));
57445744
cpu = get_cpu();
57455745
cpufreq_get_policy(&policy, cpu);

0 commit comments

Comments
 (0)