Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4858aaf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull KVM fixes from Paolo Bonzini:
 "s390:
   - optimization for the exitless interrupt support that was merged in 4.16-rc1
   - improve the branch prediction blocking for nested KVM
   - replace some jump tables with switch statements to improve expoline performance
   - fixes for multiple epoch facility

  ARM:
   - fix the interaction of userspace irqchip VMs with in-kernel irqchip VMs
   - make sure we can build 32-bit KVM/ARM with gcc-8.

  x86:
   - fixes for AMD SEV
   - fixes for Intel nested VMX, emulated UMIP and a dump_stack() on VM startup
   - fixes for async page fault migration
   - small optimization to PV TLB flush (new in 4.16-rc1)
   - syzkaller fixes

  Generic:
   - compiler warning fixes
   - syzkaller fixes
   - more improvements to the kvm_stat tool

  Two more small Spectre fixes are going to reach you via Ingo"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (40 commits)
  KVM: SVM: Fix SEV LAUNCH_SECRET command
  KVM: SVM: install RSM intercept
  KVM: SVM: no need to call access_ok() in LAUNCH_MEASURE command
  include: psp-sev: Capitalize invalid length enum
  crypto: ccp: Fix sparse, use plain integer as NULL pointer
  KVM: X86: Avoid traversing all the cpus for pv tlb flush when steal time is disabled
  x86/kvm: Make parse_no_xxx __init for kvm
  KVM: x86: fix backward migration with async_PF
  kvm: fix warning for non-x86 builds
  kvm: fix warning for CONFIG_HAVE_KVM_EVENTFD builds
  tools/kvm_stat: print 'Total' line for multiple events only
  tools/kvm_stat: group child events indented after parent
  tools/kvm_stat: separate drilldown and fields filtering
  tools/kvm_stat: eliminate extra guest/pid selection dialog
  tools/kvm_stat: mark private methods as such
  tools/kvm_stat: fix debugfs handling
  tools/kvm_stat: print error on invalid regex
  tools/kvm_stat: fix crash when filtering out all non-child trace events
  tools/kvm_stat: avoid 'is' for equality checks
  tools/kvm_stat: use a more pythonic way to iterate over dictionaries
  ...
parents 4a3928c6 9c5e0afa
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -58,6 +58,10 @@ KVM_FEATURE_PV_TLB_FLUSH || 9 || guest checks this feature bit
                                   ||       || before enabling paravirtualized
                                   ||       || before enabling paravirtualized
                                   ||       || tlb flush.
                                   ||       || tlb flush.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
KVM_FEATURE_ASYNC_PF_VMEXIT        ||    10 || paravirtualized async PF VM exit
                                   ||       || can be enabled by setting bit 2
                                   ||       || when writing to msr 0x4b564d02
------------------------------------------------------------------------------
KVM_FEATURE_CLOCKSOURCE_STABLE_BIT ||    24 || host will warn if no guest-side
KVM_FEATURE_CLOCKSOURCE_STABLE_BIT ||    24 || host will warn if no guest-side
                                   ||       || per-cpu warps are expected in
                                   ||       || per-cpu warps are expected in
                                   ||       || kvmclock.
                                   ||       || kvmclock.
+2 −1
Original line number Original line Diff line number Diff line
@@ -170,7 +170,8 @@ MSR_KVM_ASYNC_PF_EN: 0x4b564d02
	when asynchronous page faults are enabled on the vcpu 0 when
	when asynchronous page faults are enabled on the vcpu 0 when
	disabled. Bit 1 is 1 if asynchronous page faults can be injected
	disabled. Bit 1 is 1 if asynchronous page faults can be injected
	when vcpu is in cpl == 0. Bit 2 is 1 if asynchronous page faults
	when vcpu is in cpl == 0. Bit 2 is 1 if asynchronous page faults
	are delivered to L1 as #PF vmexits.
	are delivered to L1 as #PF vmexits.  Bit 2 can be set only if
	KVM_FEATURE_ASYNC_PF_VMEXIT is present in CPUID.


	First 4 byte of 64 byte memory location will be written to by
	First 4 byte of 64 byte memory location will be written to by
	the hypervisor at the time of asynchronous page fault (APF)
	the hypervisor at the time of asynchronous page fault (APF)
+5 −0
Original line number Original line Diff line number Diff line
@@ -7,6 +7,8 @@ ccflags-y += -fno-stack-protector -DDISABLE_BRANCH_PROFILING


KVM=../../../../virt/kvm
KVM=../../../../virt/kvm


CFLAGS_ARMV7VE		   :=$(call cc-option, -march=armv7ve)

obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v2-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v2-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v3-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v3-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/timer-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/timer-sr.o
@@ -15,7 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o
obj-$(CONFIG_KVM_ARM_HOST) += cp15-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += cp15-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += vfp.o
obj-$(CONFIG_KVM_ARM_HOST) += vfp.o
obj-$(CONFIG_KVM_ARM_HOST) += banked-sr.o
obj-$(CONFIG_KVM_ARM_HOST) += banked-sr.o
CFLAGS_banked-sr.o	   += $(CFLAGS_ARMV7VE)

obj-$(CONFIG_KVM_ARM_HOST) += entry.o
obj-$(CONFIG_KVM_ARM_HOST) += entry.o
obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o
obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o
obj-$(CONFIG_KVM_ARM_HOST) += switch.o
obj-$(CONFIG_KVM_ARM_HOST) += switch.o
CFLAGS_switch.o		   += $(CFLAGS_ARMV7VE)
obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o
obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o
+4 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,10 @@


#include <asm/kvm_hyp.h>
#include <asm/kvm_hyp.h>


/*
 * gcc before 4.9 doesn't understand -march=armv7ve, so we have to
 * trick the assembler.
 */
__asm__(".arch_extension     virt");
__asm__(".arch_extension     virt");


void __hyp_text __banked_save_state(struct kvm_cpu_context *ctxt)
void __hyp_text __banked_save_state(struct kvm_cpu_context *ctxt)
+29 −22
Original line number Original line Diff line number Diff line
@@ -22,22 +22,6 @@
#include "trace.h"
#include "trace.h"
#include "trace-s390.h"
#include "trace-s390.h"



static const intercept_handler_t instruction_handlers[256] = {
	[0x01] = kvm_s390_handle_01,
	[0x82] = kvm_s390_handle_lpsw,
	[0x83] = kvm_s390_handle_diag,
	[0xaa] = kvm_s390_handle_aa,
	[0xae] = kvm_s390_handle_sigp,
	[0xb2] = kvm_s390_handle_b2,
	[0xb6] = kvm_s390_handle_stctl,
	[0xb7] = kvm_s390_handle_lctl,
	[0xb9] = kvm_s390_handle_b9,
	[0xe3] = kvm_s390_handle_e3,
	[0xe5] = kvm_s390_handle_e5,
	[0xeb] = kvm_s390_handle_eb,
};

u8 kvm_s390_get_ilen(struct kvm_vcpu *vcpu)
u8 kvm_s390_get_ilen(struct kvm_vcpu *vcpu)
{
{
	struct kvm_s390_sie_block *sie_block = vcpu->arch.sie_block;
	struct kvm_s390_sie_block *sie_block = vcpu->arch.sie_block;
@@ -129,17 +113,40 @@ static int handle_validity(struct kvm_vcpu *vcpu)


static int handle_instruction(struct kvm_vcpu *vcpu)
static int handle_instruction(struct kvm_vcpu *vcpu)
{
{
	intercept_handler_t handler;

	vcpu->stat.exit_instruction++;
	vcpu->stat.exit_instruction++;
	trace_kvm_s390_intercept_instruction(vcpu,
	trace_kvm_s390_intercept_instruction(vcpu,
					     vcpu->arch.sie_block->ipa,
					     vcpu->arch.sie_block->ipa,
					     vcpu->arch.sie_block->ipb);
					     vcpu->arch.sie_block->ipb);
	handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8];

	if (handler)
	switch (vcpu->arch.sie_block->ipa >> 8) {
		return handler(vcpu);
	case 0x01:
		return kvm_s390_handle_01(vcpu);
	case 0x82:
		return kvm_s390_handle_lpsw(vcpu);
	case 0x83:
		return kvm_s390_handle_diag(vcpu);
	case 0xaa:
		return kvm_s390_handle_aa(vcpu);
	case 0xae:
		return kvm_s390_handle_sigp(vcpu);
	case 0xb2:
		return kvm_s390_handle_b2(vcpu);
	case 0xb6:
		return kvm_s390_handle_stctl(vcpu);
	case 0xb7:
		return kvm_s390_handle_lctl(vcpu);
	case 0xb9:
		return kvm_s390_handle_b9(vcpu);
	case 0xe3:
		return kvm_s390_handle_e3(vcpu);
	case 0xe5:
		return kvm_s390_handle_e5(vcpu);
	case 0xeb:
		return kvm_s390_handle_eb(vcpu);
	default:
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;
	}
	}
}


static int inject_prog_on_prog_intercept(struct kvm_vcpu *vcpu)
static int inject_prog_on_prog_intercept(struct kvm_vcpu *vcpu)
{
{
Loading