Marcelo Tosatti wrote:
On Sun, Jul 20, 2008 at 12:22:07PM +0300, Avi Kivity wrote:
Marcelo Tosatti wrote:
If 'g' is one then limit is 4kb granular.
Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>
Index: kvm-vmx-checks/arch/x86/kvm/x86.c
===================================================================
--- kvm-vmx-checks.orig/arch/x86/kvm/x86.c
+++ kvm-vmx-checks/arch/x86/kvm/x86.c
@@ -3195,6 +3195,10 @@ static void seg_desct_to_kvm_desct(struc
kvm_desct->base |= seg_desc->base2 << 24;
kvm_desct->limit = seg_desc->limit0;
kvm_desct->limit |= seg_desc->limit << 16;
+ if (seg_desc->g) {
+ kvm_desct->limit <<= 12;
+ kvm_desct->limit |= 0xfff;
+ }
kvm_desct->selector = selector;
kvm_desct->type = seg_desc->type;
kvm_desct->present = seg_desc->p;
This looks good,
@@ -3222,8 +3226,12 @@ static void get_segment_descritptor_dtab
if (kvm_seg.unusable)
dtable->limit = 0;
- else
- dtable->limit = kvm_seg.limit;
+ else {
+ if (kvm_seg.g)
+ dtable->limit = kvm_seg.limit >> 12;
+ else
+ dtable->limit = kvm_seg.limit;
+ }
dtable->base = kvm_seg.base;
But this doesn't. As far as I can tell, users of
get_segment_descritptor_dtable() expect a normalized limit (always in
bytes).
Ouch, yes. Here's it:
KVM: task switch: translate guest segment limit to virt-extension byte granular
field
If 'g' is one then limit is 4kb granular.
I already merged this bit (I guess I forgot to ack); aren't you reading
[EMAIL PROTECTED]
--
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 [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html