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

 (

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
 )Change subject: arch-x86: Add some DPRINTFs to the TLB.
......................................................................

arch-x86: Add some DPRINTFs to the TLB.

These DPRINTFs are related to segmentation handling when in 32 bit
protected mode.

Change-Id: I47eb2bc834fc748b5d01d85e02ea8b3f6e03091b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55246
Reviewed-by: Matthew Poremba <matthew.pore...@amd.com>
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/x86/tlb.cc
1 file changed, 31 insertions(+), 4 deletions(-)

Approvals:
  Matthew Poremba: Looks good to me, approved
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index b2856ed..7d20e00 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -334,16 +334,23 @@
         // If we're not in 64-bit mode, do protection/limit checks
         if (m5Reg.mode != LongMode) {
DPRINTF(TLB, "Not in long mode. Checking segment protection.\n");
+
             SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
             // Check for an unusable segment.
-            if (attr.unusable)
+            if (attr.unusable) {
+                DPRINTF(TLB, "Unusable segment.\n");
                 return std::make_shared<GeneralProtection>(0);
+            }
             bool expandDown = false;
             if (seg >= SEGMENT_REG_ES && seg <= SEGMENT_REG_HS) {
- if (!attr.writable && (mode == BaseMMU::Write || storeCheck)) + if (!attr.writable && (mode == BaseMMU::Write || storeCheck)) { + DPRINTF(TLB, "Tried to write to unwritable segment.\n");
                     return std::make_shared<GeneralProtection>(0);
-                if (!attr.readable && mode == BaseMMU::Read)
+                }
+                if (!attr.readable && mode == BaseMMU::Read) {
+ DPRINTF(TLB, "Tried to read from unreadble segment.\n");
                     return std::make_shared<GeneralProtection>(0);
+                }
                 expandDown = attr.expandDown;

             }
@@ -361,8 +368,11 @@
                 if (offset <= limit || endOffset <= limit)
                     return std::make_shared<GeneralProtection>(0);
             } else {
-                if (offset > limit || endOffset > limit)
+                if (offset > limit || endOffset > limit) {
+                    DPRINTF(TLB, "Segment limit check failed, "
+                            "offset = %#x limit = %#x.\n", offset, limit);
                     return std::make_shared<GeneralProtection>(0);
+                }
             }
         }
         if (m5Reg.submode != SixtyFourBitMode ||

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55246
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: I47eb2bc834fc748b5d01d85e02ea8b3f6e03091b
Gerrit-Change-Number: 55246
Gerrit-PatchSet: 16
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
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

Reply via email to