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.
This commit is contained in:
Geoffrey Blake
2013-10-31 13:41:13 -05:00
parent fb0496498d
commit be4aa2b6ba
5 changed files with 120 additions and 16 deletions

View File

@@ -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>")