[Lucid][SRU][PATCH] UBUNTU: SAUCE: (no-up) Fix up KVM: VMX: Fix host userspace gsbase corruption

Jiang, Yunhong yunhong.jiang at intel.com
Wed May 25 08:42:36 UTC 2011


With this patch, the 32bit android emulator works quite well. I already update the bugzilla.
Leann, really appreciate your quick response!

Thanks
--jyh

>-----Original Message-----
>From: Leann Ogasawara [mailto:leann.ogasawara at canonical.com]
>Sent: Wednesday, May 25, 2011 3:25 AM
>To: kernel-team
>Cc: Jiang, Yunhong
>Subject: [Lucid][SRU][PATCH] UBUNTU: SAUCE: (no-up) Fix up KVM: VMX: Fix host
>userspace gsbase corruption
>
>SRU Justification:
>
>http://bugs.launchpad.net/bugs/787675
>
>I've clearly buggered up a backported patch on Lucid that came in as an
>aside for the 2.6.32.26+drm33.11 stable patch set (See bug 681132). The
>patch in question is:
>
>    KVM: VMX: Fix host userspace gsbase corruption
>
>    We now use load_gs_index() to load gs safely; unfortunately this also
>    changes MSR_KERNEL_GS_BASE, which we managed separately. This resulted
>    in confusion and breakage running 32-bit host userspace on a 64-bit kernel.
>
>The original thread regarding this patch can be read at:
>
>https://lists.ubuntu.com/archives/kernel-team/2010-November/013655.html
>
>The attached patch correctly fixes up the accidental deletion of a line
>of code, and correctly removes the intended line. Please apply to Lucid.
>I've also built a test kernel and referenced it in the bug.  I'm hoping
>for testing feedback from Jiang who originally brought the mistake to my
>attention.
>
>Thanks,
>Leann
>
>The following changes since commit 800e98aaa03cf2134fb3b1a7c11f59e93fa97c23:
>  Thomas Schlichter (1):
>        UBUNTU: SAUCE: vesafb: enable mtrr WC by default
>
>are available in the git repository at:
>
>  git://kernel.ubuntu.com/ogasawara/ubuntu-lucid.git lp787675
>
>Leann Ogasawara (1):
>      UBUNTU: SAUCE: (no-up) Fix up KVM: VMX: Fix host userspace gsbase
>corruption
>
> arch/x86/kvm/vmx.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>From 7766255c19171ecd6961ea9b6455d0de11245d19 Mon Sep 17 00:00:00 2001
>From: Leann Ogasawara <leann.ogasawara at canonical.com>
>Date: Tue, 24 May 2011 09:40:12 -0700
>Subject: [PATCH] UBUNTU: SAUCE: (no-up) Fix up KVM: VMX: Fix host userspace
>gsbase corruption
>
>BugLink: http://bugs.launchpad.net/bugs/787675
>
>The backport for the following commit was incorrect, eg. it removed a
>line which it shouldn't have.
>
>  commit 6cbdc7ba48dff850c233a1ea1abe87a6d0cde2dd
>  Author: Avi Kivity <avi at redhat.com>
>  Date:   Thu Nov 11 12:37:26 2010 +0200
>
>    KVM: VMX: Fix host userspace gsbase corruption
>
>Fix up the backport to be correct.
>
>Signed-off-by: Leann Ogasawara <leann.ogasawara at canonical.com>
>---
> arch/x86/kvm/vmx.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>index 77c3287..e3222ab 100644
>--- a/arch/x86/kvm/vmx.c
>+++ b/arch/x86/kvm/vmx.c
>@@ -699,7 +699,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
> 	if (vmx->host_state.gs_ldt_reload_needed) {
> 		kvm_load_ldt(vmx->host_state.ldt_sel);
> #ifdef CONFIG_X86_64
>-		wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
>+		load_gs_index(vmx->host_state.gs_sel);
> #else
> 		loadsegment(gs, vmx->host_state.gs_sel);
> #endif
>--
>1.7.0.4
>
>



More information about the kernel-team mailing list