lkml.org 
[lkml]   [2007]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 23/41] KVM: Workaround vmx inability to virtualize the reset state
    Date
    The reset state has cs.selector == 0xf000 and cs.base == 0xffff0000,
    which aren't compatible with vm86 mode, which is used for real mode
    virtualization.

    When we create a vcpu, we set cs.base to 0xf0000, but if we get there by
    way of a reset, the values are inconsistent and vmx refuses to enter
    guest mode.

    Workaround by detecting the state and munging it appropriately.

    Signed-off-by: Avi Kivity <avi@qumranet.com>
    ---
    drivers/kvm/vmx.c | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
    index 0d9bf0b..aa7e2ba 100644
    --- a/drivers/kvm/vmx.c
    +++ b/drivers/kvm/vmx.c
    @@ -712,6 +712,8 @@ static void enter_rmode(struct kvm_vcpu *vcpu)

    vmcs_write32(GUEST_CS_AR_BYTES, 0xf3);
    vmcs_write32(GUEST_CS_LIMIT, 0xffff);
    + if (vmcs_readl(GUEST_CS_BASE) == 0xffff0000)
    + vmcs_writel(GUEST_CS_BASE, 0xf0000);
    vmcs_write16(GUEST_CS_SELECTOR, vmcs_readl(GUEST_CS_BASE) >> 4);

    fix_rmode_seg(VCPU_SREG_ES, &vcpu->rmode.es);
    --
    1.5.0.5
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-04-01 16:47    [W:5.065 / U:0.536 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site