[linux] 01/01: KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sat Sep 24 13:20:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

carnil pushed a commit to branch jessie
in repository linux.

commit e5632e04e25fd25b21293cfe01b2fd08f6c3ceef
Author: Salvatore Bonaccorso <carnil at debian.org>
Date:   Sat Sep 24 15:03:51 2016 +0200

    KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX
    
    Closes: #838660
---
 debian/changelog                                   |  4 +++
 ...-host-initiated-access-to-guest-MSR_TSC_A.patch | 42 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 47 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 782fc99..a38c90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,10 @@ linux (3.16.36-2) UNRELEASED; urgency=medium
   [ Aurelien Jarno ]
   * [mips*] Fix ptrace handling of any syscalls returning ENOSYS.
 
+  [ Salvatore Bonaccorso ]
+  * [x86] KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX
+    (Closes: #838660)
+
  -- Aurelien Jarno <aurel32 at debian.org>  Tue, 09 Aug 2016 22:05:53 +0200
 
 linux (3.16.36-1) jessie; urgency=medium
diff --git a/debian/patches/bugfix/x86/KVM-VMX-Fix-host-initiated-access-to-guest-MSR_TSC_A.patch b/debian/patches/bugfix/x86/KVM-VMX-Fix-host-initiated-access-to-guest-MSR_TSC_A.patch
new file mode 100644
index 0000000..eb6f87a
--- /dev/null
+++ b/debian/patches/bugfix/x86/KVM-VMX-Fix-host-initiated-access-to-guest-MSR_TSC_A.patch
@@ -0,0 +1,42 @@
+From: Haozhong Zhang <haozhong.zhang at intel.com>
+Date: Mon, 14 Dec 2015 23:13:38 +0800
+Subject: KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX
+Origin: http://kernel.ubuntu.com/git/ubuntu/linux.git/patch/?id=f9720de51aeacd81dbb6d4ff9893d35d6d889fd5
+
+commit 81b1b9ca6d5ca5f3ce91c0095402def657cf5db3 upstream.
+
+The current handling of accesses to guest MSR_TSC_AUX returns error if
+vcpu does not support rdtscp, though those accesses are initiated by
+host. This can result in the reboot failure of some versions of
+QEMU. This patch fixes this issue by passing those host initiated
+accesses for further handling instead.
+
+Signed-off-by: Haozhong Zhang <haozhong.zhang at intel.com>
+Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
+Backported-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
+Signed-off-by: Kamal Mostafa <kamal at canonical.com>
+[carnil: backport to 3.16, adjust context]
+---
+ arch/x86/kvm/vmx.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/kvm/vmx.c
++++ b/arch/x86/kvm/vmx.c
+@@ -2527,7 +2527,7 @@ static int vmx_get_msr(struct kvm_vcpu *
+ 			return 1;
+ 		return vmx_get_vmx_msr(vcpu, msr_index, pdata);
+ 	case MSR_TSC_AUX:
+-		if (!to_vmx(vcpu)->rdtscp_enabled)
++		if (!to_vmx(vcpu)->rdtscp_enabled && !msr_info->host_initiated)
+ 			return 1;
+ 		/* Otherwise falls through */
+ 	default:
+@@ -2616,7 +2616,7 @@ static int vmx_set_msr(struct kvm_vcpu *
+ 	case MSR_IA32_VMX_BASIC ... MSR_IA32_VMX_VMFUNC:
+ 		return 1; /* they are read-only */
+ 	case MSR_TSC_AUX:
+-		if (!vmx->rdtscp_enabled)
++		if (!vmx->rdtscp_enabled && !msr_info->host_initiated)
+ 			return 1;
+ 		/* Check reserved bit, higher 32 bits should be zero */
+ 		if ((data >> 32) != 0)
diff --git a/debian/patches/series b/debian/patches/series
index ac7caf0..ecf0dc6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -94,6 +94,7 @@ bugfix/mips/MIPS-scall-Always-run-the-seccomp-syscall-filters.patch
 bugfix/x86/i2c-i801-Use-wait_event_timeout-to-wait-for-interrup.patch
 bugfix/x86/kvm-x86-rename-update_db_bp_intercept-to-update_bp_i.patch
 bugfix/x86/kvm-x86-bit-ops-emulation-ignores-offset-on-64-bit.patch
+bugfix/x86/KVM-VMX-Fix-host-initiated-access-to-guest-MSR_TSC_A.patch
 
 features/all/readq-writeq-Add-explicit-lo_hi_-read-write-_q-and-h.patch
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list