changeset fbfb38d33a0a in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=fbfb38d33a0a
description:
        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.

diffstat:

 src/cpu/kvm/x86_cpu.cc |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (20 lines):

diff -r 484f50943e13 -r fbfb38d33a0a src/cpu/kvm/x86_cpu.cc
--- a/src/cpu/kvm/x86_cpu.cc    Mon Mar 03 14:31:39 2014 +0100
+++ b/src/cpu/kvm/x86_cpu.cc    Mon Mar 03 14:34:33 2014 +0100
@@ -721,11 +721,11 @@
     kvm_seg.g = attr.granularity;
     kvm_seg.avl = attr.avl;
 
-    // A segment is unusable when the selector is zero. There is a
-    // attr.unusable flag in gem5, but it seems unused.
-    //
-    // TODO: Are there corner cases where this doesn't work?
-    kvm_seg.unusable = (kvm_seg.selector == 0);
+    // A segment is normally unusable when the selector is zero. There
+    // 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
+    // hope for the best.
+    kvm_seg.unusable = 0;
 }
 
 static inline void
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to