kvm: x86: Always assume segments to be usable
When transferring segment registers into kvm, we need to find the value of the unusable bit. We used to assume that this could be inferred from the selector since segments are generally unusable if their selector is 0. This assumption breaks in some weird corner cases. Instead, we just assume that segments are always usable. This is what qemu does so it should work.
This commit is contained in:
parent
739cc0128b
commit
e7d230ede0
1 changed files with 5 additions and 5 deletions
|
@ -721,11 +721,11 @@ setKvmSegmentReg(ThreadContext *tc, struct kvm_segment &kvm_seg,
|
||||||
kvm_seg.g = attr.granularity;
|
kvm_seg.g = attr.granularity;
|
||||||
kvm_seg.avl = attr.avl;
|
kvm_seg.avl = attr.avl;
|
||||||
|
|
||||||
// A segment is unusable when the selector is zero. There is a
|
// A segment is normally unusable when the selector is zero. There
|
||||||
// attr.unusable flag in gem5, but it seems unused.
|
// is a attr.unusable flag in gem5, but it seems unused. qemu
|
||||||
//
|
// seems to set this to 0 all the time, so we just do the same and
|
||||||
// TODO: Are there corner cases where this doesn't work?
|
// hope for the best.
|
||||||
kvm_seg.unusable = (kvm_seg.selector == 0);
|
kvm_seg.unusable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
Loading…
Reference in a new issue