Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/49762 )

Change subject: arch-arm: For semihosting, mask reg value and not index.
......................................................................

arch-arm: For semihosting, mask reg value and not index.

In ArmSemihosting::call64, the *index* of X0 was masked to be 32 bits (a
noop), and then read using the TC, where I'm pretty sure what was
intended was to read the value and then mask what was returned.

Change-Id: I66cb845d4e97b1895072bd98de709256625c8e3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49762
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-by: Giacomo Travaglini <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/arm/semihosting.cc
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/arm/semihosting.cc b/src/arch/arm/semihosting.cc
index fc98d6e..ed6fa29 100644
--- a/src/arch/arm/semihosting.cc
+++ b/src/arch/arm/semihosting.cc
@@ -169,7 +169,7 @@
 bool
 ArmSemihosting::call64(ThreadContext *tc, bool gem5_ops)
 {
-    RegVal op = tc->readIntReg(ArmISA::INTREG_X0 & mask(32));
+    RegVal op = tc->readIntReg(ArmISA::INTREG_X0) & mask(32);
     if (op > MaxStandardOp && !gem5_ops) {
         unrecognizedCall<Abi64>(
                 tc, "Gem5 semihosting op (0x%x) disabled from here.", op);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49762
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: I66cb845d4e97b1895072bd98de709256625c8e3f
Gerrit-Change-Number: 49762
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to