Re: [PATCH RESEND] KVM: when entering real mode align segment base to 16 bytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/27/2010 03:01 PM, Gleb Natapov wrote:
VMX checks that base is equal segment shifted 4 bites left. Otherwise
guest entry fails.

Signed-off-by: Gleb Natapov<gleb@xxxxxxxxxx>
--
Same as previous one but with correct (I hope) To: header.

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 2260783..45014ba 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1736,7 +1736,7 @@ static void fix_rmode_seg(int seg, struct kvm_save_segment *save)
  	save->limit = vmcs_read32(sf->limit);
  	save->ar = vmcs_read32(sf->ar_bytes);
  	vmcs_write16(sf->selector, save->base>>  4);
-	vmcs_write32(sf->base, save->base&  0xfffff);
+	vmcs_write32(sf->base, save->base&  0xffff0);
  	vmcs_write32(sf->limit, 0xffff);
  	vmcs_write32(sf->ar_bytes, 0xf3);
  }

This looks okay, but I'm curious what happened here. If the guest will use the segment it will fail on an incorrect address.

What's the scenario here? And what segment is involved? if it's fs or gs, or maybe ss, I can see it working out, but hardly otherwise.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux