aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/Kconfig2
-rw-r--r--arch/arm64/kernel/asm-offsets.c1
-rw-r--r--arch/arm64/kvm/Kconfig51
-rw-r--r--arch/x86/kvm/vmx.c11
4 files changed, 63 insertions, 2 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 4143d9b0d87a..9737e97f9f38 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -270,6 +270,8 @@ source "drivers/Kconfig"
270 270
271source "fs/Kconfig" 271source "fs/Kconfig"
272 272
273source "arch/arm64/kvm/Kconfig"
274
273source "arch/arm64/Kconfig.debug" 275source "arch/arm64/Kconfig.debug"
274 276
275source "security/Kconfig" 277source "security/Kconfig"
diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c
index 49c162c03b69..666e231d410b 100644
--- a/arch/arm64/kernel/asm-offsets.c
+++ b/arch/arm64/kernel/asm-offsets.c
@@ -21,6 +21,7 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
24#include <linux/kvm_host.h>
24#include <asm/thread_info.h> 25#include <asm/thread_info.h>
25#include <asm/memory.h> 26#include <asm/memory.h>
26#include <asm/cputable.h> 27#include <asm/cputable.h>
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
new file mode 100644
index 000000000000..21e90820bd23
--- /dev/null
+++ b/arch/arm64/kvm/Kconfig
@@ -0,0 +1,51 @@
1#
2# KVM configuration
3#
4
5source "virt/kvm/Kconfig"
6
7menuconfig VIRTUALIZATION
8 bool "Virtualization"
9 ---help---
10 Say Y here to get to see options for using your Linux host to run
11 other operating systems inside virtual machines (guests).
12 This option alone does not add any kernel code.
13
14 If you say N, all options in this submenu will be skipped and
15 disabled.
16
17if VIRTUALIZATION
18
19config KVM
20 bool "Kernel-based Virtual Machine (KVM) support"
21 select MMU_NOTIFIER
22 select PREEMPT_NOTIFIERS
23 select ANON_INODES
24 select KVM_MMIO
25 select KVM_ARM_HOST
26 select KVM_ARM_VGIC
27 select KVM_ARM_TIMER
28 ---help---
29 Support hosting virtualized guest machines.
30
31 If unsure, say N.
32
33config KVM_ARM_HOST
34 bool
35 ---help---
36 Provides host support for ARM processors.
37
38config KVM_ARM_VGIC
39 bool
40 depends on KVM_ARM_HOST && OF
41 select HAVE_KVM_IRQCHIP
42 ---help---
43 Adds support for a hardware assisted, in-kernel GIC emulation.
44
45config KVM_ARM_TIMER
46 bool
47 depends on KVM_ARM_VGIC
48 ---help---
49 Adds support for the Architected Timers in virtual machines.
50
51endif # VIRTUALIZATION
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a7e18551c968..064d0be67ecc 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3404,15 +3404,22 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
3404 var->limit = vmx_read_guest_seg_limit(vmx, seg); 3404 var->limit = vmx_read_guest_seg_limit(vmx, seg);
3405 var->selector = vmx_read_guest_seg_selector(vmx, seg); 3405 var->selector = vmx_read_guest_seg_selector(vmx, seg);
3406 ar = vmx_read_guest_seg_ar(vmx, seg); 3406 ar = vmx_read_guest_seg_ar(vmx, seg);
3407 var->unusable = (ar >> 16) & 1;
3407 var->type = ar & 15; 3408 var->type = ar & 15;
3408 var->s = (ar >> 4) & 1; 3409 var->s = (ar >> 4) & 1;
3409 var->dpl = (ar >> 5) & 3; 3410 var->dpl = (ar >> 5) & 3;
3410 var->present = (ar >> 7) & 1; 3411 /*
3412 * Some userspaces do not preserve unusable property. Since usable
3413 * segment has to be present according to VMX spec we can use present
3414 * property to amend userspace bug by making unusable segment always
3415 * nonpresent. vmx_segment_access_rights() already marks nonpresent
3416 * segment as unusable.
3417 */
3418 var->present = !var->unusable;
3411 var->avl = (ar >> 12) & 1; 3419 var->avl = (ar >> 12) & 1;
3412 var->l = (ar >> 13) & 1; 3420 var->l = (ar >> 13) & 1;
3413 var->db = (ar >> 14) & 1; 3421 var->db = (ar >> 14) & 1;
3414 var->g = (ar >> 15) & 1; 3422 var->g = (ar >> 15) & 1;
3415 var->unusable = (ar >> 16) & 1;
3416} 3423}
3417 3424
3418static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg) 3425static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg)