x86_cpu.cc (9890:2bad3d5120e5) | x86_cpu.cc (10099:fbfb38d33a0a) |
---|---|
1/* 2 * Copyright (c) 2013 Andreas Sandberg 3 * All rights reserved 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 707 unchanged lines hidden (view full) --- 716 kvm_seg.present = attr.present; 717 kvm_seg.dpl = attr.dpl; 718 kvm_seg.db = attr.defaultSize; 719 kvm_seg.s = attr.system; 720 kvm_seg.l = attr.longMode; 721 kvm_seg.g = attr.granularity; 722 kvm_seg.avl = attr.avl; 723 | 1/* 2 * Copyright (c) 2013 Andreas Sandberg 3 * All rights reserved 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 707 unchanged lines hidden (view full) --- 716 kvm_seg.present = attr.present; 717 kvm_seg.dpl = attr.dpl; 718 kvm_seg.db = attr.defaultSize; 719 kvm_seg.s = attr.system; 720 kvm_seg.l = attr.longMode; 721 kvm_seg.g = attr.granularity; 722 kvm_seg.avl = attr.avl; 723 |
724 // A segment is unusable when the selector is zero. There is a 725 // attr.unusable flag in gem5, but it seems unused. 726 // 727 // TODO: Are there corner cases where this doesn't work? 728 kvm_seg.unusable = (kvm_seg.selector == 0); | 724 // A segment is normally unusable when the selector is zero. There 725 // is a attr.unusable flag in gem5, but it seems unused. qemu 726 // seems to set this to 0 all the time, so we just do the same and 727 // hope for the best. 728 kvm_seg.unusable = 0; |
729} 730 731static inline void 732setKvmDTableReg(ThreadContext *tc, struct kvm_dtable &kvm_dtable, 733 const int index) 734{ 735 kvm_dtable.base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(index)); 736 kvm_dtable.limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(index)); --- 849 unchanged lines hidden --- | 729} 730 731static inline void 732setKvmDTableReg(ThreadContext *tc, struct kvm_dtable &kvm_dtable, 733 const int index) 734{ 735 kvm_dtable.base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(index)); 736 kvm_dtable.limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(index)); --- 849 unchanged lines hidden --- |