Commit 7827feb4 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Greg Kroah-Hartman

KVM: task switch: translate guest segment limit to virt-extension byte granular field

(cherry picked from commit c93cd3a5)

If 'g' is one then limit is 4kb granular.
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cd0a0d23
...@@ -3168,6 +3168,10 @@ static void seg_desct_to_kvm_desct(struct desc_struct *seg_desc, u16 selector, ...@@ -3168,6 +3168,10 @@ static void seg_desct_to_kvm_desct(struct desc_struct *seg_desc, u16 selector,
kvm_desct->base |= seg_desc->base2 << 24; kvm_desct->base |= seg_desc->base2 << 24;
kvm_desct->limit = seg_desc->limit0; kvm_desct->limit = seg_desc->limit0;
kvm_desct->limit |= seg_desc->limit << 16; 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->selector = selector;
kvm_desct->type = seg_desc->type; kvm_desct->type = seg_desc->type;
kvm_desct->present = seg_desc->p; kvm_desct->present = seg_desc->p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment