Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/55690 )
Change subject: arch-x86: Subtract the base from the PC when entering
faults.
......................................................................
arch-x86: Subtract the base from the PC when entering faults.
The PC value is put in t7, but for that to be consistent with the way
microcode usually sees and interacts with the PC, it needs to have the
CS base value subtracted from it first. Otherwise the base could be
added into new PC values twice.
Change-Id: I8a8c5bc1befd9a89e6735981fd2fc69a702fdc68
---
M src/arch/x86/faults.cc
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/faults.cc b/src/arch/x86/faults.cc
index 0b1dc23..6c696c7 100644
--- a/src/arch/x86/faults.cc
+++ b/src/arch/x86/faults.cc
@@ -75,7 +75,8 @@
entry = extern_label_legacyModeInterrupt;
}
tc->setIntReg(INTREG_MICRO(1), vector);
- tc->setIntReg(INTREG_MICRO(7), pc.pc());
+ Addr cs_base = tc->readMiscRegNoEffect(MISCREG_CS_EFF_BASE);
+ tc->setIntReg(INTREG_MICRO(7), pc.pc() - cs_base);
if (errorCode != (uint64_t)(-1)) {
if (m5reg.mode == LongMode) {
entry = extern_label_longModeInterruptWithError;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55690
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: I8a8c5bc1befd9a89e6735981fd2fc69a702fdc68
Gerrit-Change-Number: 55690
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s