Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/66731?usp=email )

Change subject: dev: Ignore MC146818 UIP bit / Fix x86 Linux 5.11+ boot
......................................................................

dev: Ignore MC146818 UIP bit / Fix x86 Linux 5.11+ boot

As of Linux 5.11, the MC146818 code was changed to avoid reading garbage
data that may occur if the is a read while the registers are being
updated:

github.com/torvalds/linux/commit/05a0302c35481e9b47fb90ba40922b0a4cae40d8

Previously toggling this bit was fine as Linux would check twice. It now
checks before and after reading time information, causing it to retry
infinitely until eventually Linux bootup fails due to watchdog timeout.

This changeset always sets update in progress to false. Since this is a
simulation, the updates probably will not be occurring at the same time
a read is occurring.

Change-Id: If0f440de9f9a6bc5a773fc935d1d5af5b98a9a4b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66731
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
Maintainer: Bobby Bruce <bbr...@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
---
M src/dev/mc146818.cc
1 file changed, 31 insertions(+), 2 deletions(-)

Approvals:
  Matt Sinclair: Looks good to me, but someone else must approve
  Bobby Bruce: Looks good to me, approved
  Jason Lowe-Power: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/dev/mc146818.cc b/src/dev/mc146818.cc
index 919efb0..2bfe877 100644
--- a/src/dev/mc146818.cc
+++ b/src/dev/mc146818.cc
@@ -233,8 +233,9 @@
     else {
         switch (addr) {
           case RTC_STAT_REGA:
-            // toggle UIP bit for linux
-            stat_regA.uip = !stat_regA.uip;
+            // Linux after v5.10 checks this multiple times so toggling
+            // leads to a deadlock on bootup.
+            stat_regA.uip = 0;
             return stat_regA;
             break;
           case RTC_STAT_REGB:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/66731?usp=email 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: If0f440de9f9a6bc5a773fc935d1d5af5b98a9a4b
Gerrit-Change-Number: 66731
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@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

Reply via email to