[linux] 01/01: [amd64] KVM: bit-ops emulation ignores offset on 64-bit (Closes: #818502)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sat Apr 30 20:52:36 UTC 2016


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

benh pushed a commit to branch jessie
in repository linux.

commit 5323dcb9c5393731e2b13c97e3b6340141eedddc
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sat Apr 30 22:08:16 2016 +0200

    [amd64] KVM: bit-ops emulation ignores offset on 64-bit (Closes: #818502)
---
 debian/changelog                                   |  6 ++++
 ...it-ops-emulation-ignores-offset-on-64-bit.patch | 33 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 40 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6701dce..5e8b732 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+linux (3.16.7-ckt25-3) UNRELEASED; urgency=medium
+
+  * [amd64] KVM: bit-ops emulation ignores offset on 64-bit (Closes: #818502)
+
+ -- Ben Hutchings <ben at decadent.org.uk>  Sat, 30 Apr 2016 22:07:22 +0200
+
 linux (3.16.7-ckt25-2) jessie; urgency=medium
 
   * Revert "drm/radeon: hold reference to fences in radeon_sa_bo_new"
diff --git a/debian/patches/bugfix/x86/kvm-x86-bit-ops-emulation-ignores-offset-on-64-bit.patch b/debian/patches/bugfix/x86/kvm-x86-bit-ops-emulation-ignores-offset-on-64-bit.patch
new file mode 100644
index 0000000..02fe943
--- /dev/null
+++ b/debian/patches/bugfix/x86/kvm-x86-bit-ops-emulation-ignores-offset-on-64-bit.patch
@@ -0,0 +1,33 @@
+From: Nadav Amit <namit at cs.technion.ac.il>
+Date: Sun, 15 Jun 2014 16:12:57 +0300
+Subject: KVM: x86: bit-ops emulation ignores offset on 64-bit
+Origin: https://git.kernel.org/linus/7dec5603b6b8dc4c3e1c65d318bd2a5a8c62a424
+Bug-Debian: https://bugs.debian.org/818502
+
+The current emulation of bit operations ignores the offset from the destination
+on 64-bit target memory operands. This patch fixes this behavior.
+
+Signed-off-by: Nadav Amit <namit at cs.technion.ac.il>
+Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
+---
+ arch/x86/kvm/emulate.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/emulate.c
++++ b/arch/x86/kvm/emulate.c
+@@ -1249,12 +1249,14 @@ static void fetch_bit_operand(struct x86
+ 	long sv = 0, mask;
+ 
+ 	if (ctxt->dst.type == OP_MEM && ctxt->src.type == OP_REG) {
+-		mask = ~(ctxt->dst.bytes * 8 - 1);
++		mask = ~((long)ctxt->dst.bytes * 8 - 1);
+ 
+ 		if (ctxt->src.bytes == 2)
+ 			sv = (s16)ctxt->src.val & (s16)mask;
+ 		else if (ctxt->src.bytes == 4)
+ 			sv = (s32)ctxt->src.val & (s32)mask;
++		else
++			sv = (s64)ctxt->src.val & (s64)mask;
+ 
+ 		ctxt->dst.addr.mem.ea += (sv >> 3);
+ 	}
diff --git a/debian/patches/series b/debian/patches/series
index ff31076..04af377 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -659,3 +659,4 @@ bugfix/all/ip_vti-ip6_vti-preserve-skb-mark-after-rcv_cb-call.patch
 bugfix/all/revert-drm-radeon-hold-reference-to-fences-in-radeon.patch
 bugfix/all/revert-drm-radeon-call-hpd_irq_event-on-resume.patch
 bugfix/all/revert-usb-hub-do-not-clear-bos-field-during-reset-d.patch
+bugfix/x86/kvm-x86-bit-ops-emulation-ignores-offset-on-64-bit.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