summaryrefslogtreecommitdiff
path: root/util/cpt_upgrader.py
diff options
context:
space:
mode:
authorGeoffrey Blake <Geoffrey.Blake@arm.com>2013-10-31 13:41:13 -0500
committerGeoffrey Blake <Geoffrey.Blake@arm.com>2013-10-31 13:41:13 -0500
commitbe4aa2b6ba0b70b13df2ad84a372320c5a7ea939 (patch)
treeff113f004f0efc3d9aaf708ead4c746ff4a7c8ae /util/cpt_upgrader.py
parentfb0496498d06def8e9b1b2ae2099b3013716b7dc (diff)
downloadgem5-be4aa2b6ba0b70b13df2ad84a372320c5a7ea939.tar.xz
dev: Fix race conditions in IDE device on newer kernels
Newer linux kernels and distros exercise more functionality in the IDE device than previously, exposing 2 races. The first race is the handling of aborted DMA commands would immediately report the device is ready back to the kernel and cause already in flight commands to assert the simulator when they returned and discovered an inconsitent device state. The second race was due to the Status register not being handled correctly, the interrupt status bit would get stuck at 1 and the driver eventually views this as a bad state and logs the condition to the terminal. This patch fixes these two conditions by making the device handle aborted commands gracefully and properly handles clearing the interrupt status bit in the Status register.
Diffstat (limited to 'util/cpt_upgrader.py')
-rwxr-xr-xutil/cpt_upgrader.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/util/cpt_upgrader.py b/util/cpt_upgrader.py
index 623c9b297..b5b54c1f2 100755
--- a/util/cpt_upgrader.py
+++ b/util/cpt_upgrader.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Copyright (c) 2012 ARM Limited
+# Copyright (c) 2012-2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
@@ -209,6 +209,15 @@ def from_5(cpt):
else:
print "ISA is not x86"
+# Version 7 of the checkpoint adds support for the IDE dmaAbort flag
+def from_6(cpt):
+ # Update IDE disk devices with dmaAborted
+ for sec in cpt.sections():
+ # curSector only exists in IDE devices, so key on that attribute
+ if cpt.has_option(sec, "curSector"):
+ cpt.set(sec, "dmaAborted", "false")
+
+
migrations = []
migrations.append(from_0)
migrations.append(from_1)
@@ -216,6 +225,7 @@ migrations.append(from_2)
migrations.append(from_3)
migrations.append(from_4)
migrations.append(from_5)
+migrations.append(from_6)
verbose_print = False
@@ -274,7 +284,6 @@ def process_file(path, **kwargs):
verboseprint("\t...completed")
cpt.write(file(path, 'w'))
-
if __name__ == '__main__':
from optparse import OptionParser
parser = OptionParser("usage: %prog [options] <filename or directory>")