]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Merge tag 'kvm-3.11-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jul 2013 01:17:41 +0000 (18:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jul 2013 01:17:41 +0000 (18:17 -0700)
Pull more KVM changes from Gleb Natapov:
 "A fix for a bug that prevents some guests from working on old Intel
  CPUs and a patch that integrates ARM64 KVM, merged via ARM64 tree,
  into Kconfig."

* tag 'kvm-3.11-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: VMX: mark unusable segment as nonpresent
  arm64: KVM: Kconfig integration

arch/arm64/Kconfig
arch/arm64/kernel/asm-offsets.c
arch/arm64/kvm/Kconfig [new file with mode: 0644]
arch/x86/kvm/vmx.c

index 4143d9b0d87af3e511a5324c6528a3150f2046a2..9737e97f9f382740422f5bd431adc35933f917c0 100644 (file)
@@ -270,6 +270,8 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
+source "arch/arm64/kvm/Kconfig"
+
 source "arch/arm64/Kconfig.debug"
 
 source "security/Kconfig"
index 49c162c03b696c9f7f9501c666d093b98a27e8ab..666e231d410b44efad2325179e205dfc07fd3560 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
+#include <linux/kvm_host.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/cputable.h>
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
new file mode 100644 (file)
index 0000000..21e9082
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# KVM configuration
+#
+
+source "virt/kvm/Kconfig"
+
+menuconfig VIRTUALIZATION
+       bool "Virtualization"
+       ---help---
+         Say Y here to get to see options for using your Linux host to run
+         other operating systems inside virtual machines (guests).
+         This option alone does not add any kernel code.
+
+         If you say N, all options in this submenu will be skipped and
+         disabled.
+
+if VIRTUALIZATION
+
+config KVM
+       bool "Kernel-based Virtual Machine (KVM) support"
+       select MMU_NOTIFIER
+       select PREEMPT_NOTIFIERS
+       select ANON_INODES
+       select KVM_MMIO
+       select KVM_ARM_HOST
+       select KVM_ARM_VGIC
+       select KVM_ARM_TIMER
+       ---help---
+         Support hosting virtualized guest machines.
+
+         If unsure, say N.
+
+config KVM_ARM_HOST
+       bool
+       ---help---
+         Provides host support for ARM processors.
+
+config KVM_ARM_VGIC
+       bool
+       depends on KVM_ARM_HOST && OF
+       select HAVE_KVM_IRQCHIP
+       ---help---
+         Adds support for a hardware assisted, in-kernel GIC emulation.
+
+config KVM_ARM_TIMER
+       bool
+       depends on KVM_ARM_VGIC
+       ---help---
+         Adds support for the Architected Timers in virtual machines.
+
+endif # VIRTUALIZATION
index a7e18551c9689b5192d528ccae10ee9dbb20e84a..064d0be67ecc23734aa465541138d9b5be295277 100644 (file)
@@ -3404,15 +3404,22 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
        var->limit = vmx_read_guest_seg_limit(vmx, seg);
        var->selector = vmx_read_guest_seg_selector(vmx, seg);
        ar = vmx_read_guest_seg_ar(vmx, seg);
+       var->unusable = (ar >> 16) & 1;
        var->type = ar & 15;
        var->s = (ar >> 4) & 1;
        var->dpl = (ar >> 5) & 3;
-       var->present = (ar >> 7) & 1;
+       /*
+        * Some userspaces do not preserve unusable property. Since usable
+        * segment has to be present according to VMX spec we can use present
+        * property to amend userspace bug by making unusable segment always
+        * nonpresent. vmx_segment_access_rights() already marks nonpresent
+        * segment as unusable.
+        */
+       var->present = !var->unusable;
        var->avl = (ar >> 12) & 1;
        var->l = (ar >> 13) & 1;
        var->db = (ar >> 14) & 1;
        var->g = (ar >> 15) & 1;
-       var->unusable = (ar >> 16) & 1;
 }
 
 static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg)