Skip to contentSkip to conversation

Patch "KVM: x86: handle SMBASE as physical address in RSM" has been added to the 4.2-stable tree

PATCH [email protected] 1 participant 1 message Dec 7, 2015

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

KVM: x86: handle SMBASE as physical address in RSM

to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
kvm-x86-handle-smbase-as-physical-address-in-rsm.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From f40606b147dd5b4678cedc877a71deb520ca507e Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <[email protected]>
Date: Fri, 30 Oct 2015 16:36:25 +0100
Subject: KVM: x86: handle SMBASE as physical address in RSM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <[email protected]>

commit f40606b147dd5b4678cedc877a71deb520ca507e upstream.

GET_SMSTATE depends on real mode to ensure that smbase+offset is treated as a physical address, which has already caused a bug after shuffling the code. Enforce physical addressing.

---
 arch/x86/kvm/emulate.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/x86/kvm/emulate.c +3 -4
@@ -2272,8 +2272,8 @@ static int emulator_has_longmode(struct
 #define GET_SMSTATE(type, smbase, offset)				  \
 	({								  \
 	 type __val;							  \
-	 int r = ctxt->ops->read_std(ctxt, smbase + offset, &__val,       \
-				     sizeof(__val), NULL);		  \
+	 int r = ctxt->ops->read_phys(ctxt, smbase + offset, &__val,      \
+				      sizeof(__val));			  \
 	 if (r != X86EMUL_CONTINUE)					  \
 		 return X86EMUL_UNHANDLEABLE;				  \
 	 __val;								  \
@@ -2484,8 +2484,7 @@ static int em_rsm(struct x86_emulate_ctx
 
 	/*
 	 * Get back to real mode, to prepare a safe state in which to load
-	 * CR0/CR3/CR4/EFER.  Also this will ensure that addresses passed
-	 * to read_std/write_std are not virtual.
+	 * CR0/CR3/CR4/EFER.
 	 *
 	 * CR4.PCIDE must be zero, because it is a 64-bit mode only feature.
 	 */

Patches currently in stable-queue which might be from [email protected] are

queue-4.2/kvm-x86-set-kvm_req_event-when-updating-irr.patch queue-4.2/kvm-x86-handle-smbase-as-physical-address-in-rsm.patch queue-4.2/kvm-x86-allow-rsm-from-64-bit-mode.patch queue-4.2/kvm-x86-add-read_phys-to-x86_emulate_ops.patch