Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/57199 )
Change subject: arch-x86: Implement not present exceptions.
......................................................................
arch-x86: Implement not present exceptions.
Also, now that the selector is being used for error codes for faults, we
need to trim it down to 16 bits. Before it didn't matter that there were
spill over bits since they were never used.
Change-Id: If22b2e98818437ba23583bb3de012cdd03461a15
---
M src/arch/x86/ucasmlib/arch/x86/microops/regop.py
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/arch/x86/ucasmlib/arch/x86/microops/regop.py
b/src/arch/x86/ucasmlib/arch/x86/microops/regop.py
index 7b6225e..aab033d 100644
--- a/src/arch/x86/ucasmlib/arch/x86/microops/regop.py
+++ b/src/arch/x86/ucasmlib/arch/x86/microops/regop.py
@@ -1404,16 +1404,18 @@
operand_types = (SegDestOp, FoldedSrc1Op, Op2)
code = '''
SegDescriptor desc = SrcReg1;
- SegSelector selector = SrcReg2;
+ SegSelector selector = SrcReg2 & mask(16);
// This while loop is so we can use break statements in the code
// below to skip the rest of this section without a bunch of
// nesting.
while (true) {
if (selector.si || selector.ti) {
if (!desc.p) {
- fault = std::make_shared<GenericISA::M5PanicFault>(
- "Segment not present.\\n");
- break;
+ if (dest == SEGMENT_REG_SS || dest == SEGMENT_REG_HS) {
+ return std::make_shared<StackFault>(selector);
+ } else {
+ return
std::make_shared<SegmentNotPresent>(selector);
+ }
}
SegAttr attr = 0;
attr.dpl = desc.dpl;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/57199
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If22b2e98818437ba23583bb3de012cdd03461a15
Gerrit-Change-Number: 57199
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s