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 <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Matthew Poremba
2022-12-15 13:11:44 -08:00
parent b860e2039b
commit 0bce2e56d9

View File

@@ -233,8 +233,9 @@ MC146818::readData(uint8_t addr)
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: