lkml.org 
[lkml]   [2010]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 135/149] KVM: Dont allow lmsw to clear cr0.pe
    2.6.32-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Avi Kivity <avi@redhat.com>

    The current lmsw implementation allows the guest to clear cr0.pe, contrary
    to the manual, which breaks EMM386.EXE.

    Fix by ORing the old cr0.pe with lmsw's operand.

    Signed-off-by: Avi Kivity <avi@redhat.com>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    (cherry picked from commit f78e917688edbf1f14c318d2e50dc8e7dad20445)
    ---
    arch/x86/kvm/x86.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/arch/x86/kvm/x86.c
    +++ b/arch/x86/kvm/x86.c
    @@ -345,7 +345,7 @@ EXPORT_SYMBOL_GPL(kvm_set_cr0);

    void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw)
    {
    - kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0ful) | (msw & 0x0f));
    + kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0eul) | (msw & 0x0f));
    }
    EXPORT_SYMBOL_GPL(kvm_lmsw);




    \
     
     \ /
      Last update: 2010-07-01 20:35    [W:8.238 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site