changeset c30088a243ad in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c30088a243ad
description:
X86: Add segmentation checks for ldt related descriptors and selectors.
diffstat:
2 files changed, 14 insertions(+), 2 deletions(-)
src/arch/x86/isa/microasm.isa | 2 +-
src/arch/x86/isa/microops/regop.isa | 14 +++++++++++++-
diffs (43 lines):
diff -r df55109af564 -r c30088a243ad src/arch/x86/isa/microasm.isa
--- a/src/arch/x86/isa/microasm.isa Wed Feb 25 10:21:14 2009 -0800
+++ b/src/arch/x86/isa/microasm.isa Wed Feb 25 10:21:21 2009 -0800
@@ -87,7 +87,7 @@
# Add in symbols for the various checks of segment selectors.
for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck",
"SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck",
- "TRCheck", "TSSCheck"):
+ "TRCheck", "TSSCheck", "InGDTCheck", "LDTCheck"):
assembler.symbols[check] = "Seg%s" % check
for reg in ("TR", "IDTR"):
diff -r df55109af564 -r c30088a243ad src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa Wed Feb 25 10:21:14 2009 -0800
+++ b/src/arch/x86/isa/microops/regop.isa Wed Feb 25 10:21:21 2009 -0800
@@ -235,7 +235,7 @@
enum SegmentSelectorCheck {
SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck,
- SegTRCheck, SegTSSCheck
+ SegTRCheck, SegTSSCheck, SegInGDTCheck, SegLDTCheck
};
enum LongModeDescriptorType {
@@ -1174,6 +1174,18 @@
fault = new GeneralProtection(selector);
}
break;
+ case SegInGDTCheck:
+ if (selector.ti) {
+ fault = new GeneralProtection(selector);
+ }
+ break;
+ case SegLDTCheck:
+ if (!desc.p) {
+ fault = new SegmentNotPresent(selector);
+ } else if (desc.type != 0x2) {
+ fault = new GeneralProtection(selector);
+ }
+ break;
default:
panic("Undefined segment check type.\\n");
}
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev