QEMU With E2K User Support
Go to file
Jason Baron 61f52e06f0 ahci: Fix ahci cdrom read corruptions for reads > 128k
While testing q35, which has its cdrom attached to the ahci controller, I found
that the Fedora 17 install would panic on boot. The panic occurs while
squashfs is trying to read from the cdrom. The errors are:

[    8.622711] SQUASHFS error: xz_dec_run error, data probably corrupt
[    8.625180] SQUASHFS error: squashfs_read_data failed to read block
0x20be48a

I was also able to produce corrupt data reads using an installed piix based
qemu machine, using 'dd'. I found that the corruptions were only occuring when
then read size was greater than 128k. For example, the following command
results in corrupted reads:

dd if=/dev/sr0 of=/tmp/blah bs=256k iflag=direct

The > 128k size reads exercise a different code path than 128k and below. In
ide_atapi_cmd_read_dma_cb() s->io_buffer_size is capped at 128k. Thus,
ide_atapi_cmd_read_dma_cb() is called a second time when the read is > 128k.
However, ahci_dma_rw_buf() restart the read from offset 0, instead of at 128k.
Thus, resulting in a corrupted read.

To fix this, I've introduced 'io_buffer_offset' field in IDEState to keep
track of the offset. I've also modified ahci_populate_sglist() to take a new
3rd offset argument, so that the sglist is property initialized.

I've tested this patch using 'dd' testing, and Fedora 17 now correctly boots
and installs on q35 with the cdrom ahci controller.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10 10:25:12 +02:00
audio
block
bsd-user
default-configs
docs
fpu
fsdev
gdb-xml
hw ahci: Fix ahci cdrom read corruptions for reads > 128k 2012-08-10 10:25:12 +02:00
include/qemu
libcacard
linux-headers
linux-user
net
pc-bios
qapi
qga
QMP
qom
roms
scripts
slirp
sysconfigs/target
target-alpha
target-arm
target-cris
target-i386
target-lm32
target-m68k
target-microblaze
target-mips
target-openrisc
target-ppc
target-s390x
target-sh4
target-sparc
target-unicore32
target-xtensa
tcg
tests
trace
ui
.gitignore
.gitmodules
.mailmap
a.out.h
acl.c
acl.h
aes.c
aes.h
aio.c
alpha-dis.c
alpha.ld
arch_init.c
arch_init.h
arm-dis.c
arm.ld Fix linker scripts 2011-08-27 15:42:35 +00:00
async.c
balloon.c
balloon.h
bitmap.c
bitmap.h
bitops.c
bitops.h
block_int.h
block-migration.c
block-migration.h
block.c
block.h
blockdev.c
blockdev.h
bswap.h
bt-host.c
bt-host.h
bt-vhci.c
buffered_file.c
buffered_file.h
cache-utils.c
cache-utils.h
Changelog
cmd.c
cmd.h
CODING_STYLE
compatfd.c
compatfd.h
compiler.h
config.h
configure
console.c
console.h
COPYING
COPYING.LIB
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
cpu-all.h
cpu-common.h
cpu-defs.h
cpu-exec.c
cpus.c
cpus.h
cputlb.c
cputlb.h
cris-dis.c
cursor_hidden.xpm
cursor_left_ptr.xpm
cursor.c
cutils.c
def-helper.h
device_tree.c
device_tree.h
dis-asm.h
disas.c
disas.h
dma-helpers.c
dma.h
dump-stub.c
dump.c
dump.h
dyngen-exec.h
elf.h
envlist.c
envlist.h
error_int.h
error.c
error.h
event_notifier.c
event_notifier.h
exec-all.h
exec-memory.h
exec-obsolete.h
exec.c exec.c: Remove out of date comment 2012-08-03 14:25:22 +01:00
gdbstub.c
gdbstub.h
gen-icount.h
HACKING
hmp-commands.hx
hmp.c
hmp.h
host-utils.c
host-utils.h
hppa-dis.c
hppa.ld
i386-dis.c
i386.ld
ia64-dis.c
ia64.ld
input.c
int128.h
iohandler.c
ioport.c
ioport.h
iorange.h
iov.c
iov.h
json-lexer.c
json-lexer.h
json-parser.c
json-parser.h
json-streamer.c
json-streamer.h
kvm-all.c
kvm-stub.c
kvm.h
libfdt_env.h
LICENSE
linux-aio.c
lm32-dis.c
m68k-dis.c
m68k.ld
main-loop.c
main-loop.h
MAINTAINERS
Makefile
Makefile.dis
Makefile.hw
Makefile.objs
Makefile.target
Makefile.user
memory_mapping-stub.c
memory_mapping.c
memory_mapping.h
memory.c
memory.h
microblaze-dis.c
migration-exec.c
migration-fd.c
migration-tcp.c
migration-unix.c
migration.c
migration.h
mips-dis.c
mips.ld
module.c
module.h
monitor.c
monitor.h
nbd.c
nbd.h
net.c
net.h
notify.c
notify.h
os-posix.c
os-win32.c
osdep.c
osdep.h vnc: disable VNC password authentication (security type 2) when in FIPS mode 2012-08-03 14:28:40 -05:00
oslib-posix.c
oslib-win32.c
path.c
pci-ids.txt
pflib.c
pflib.h
poison.h
posix-aio-compat.c
ppc64.ld
ppc-dis.c
ppc.ld
qapi-schema-guest.json
qapi-schema-test.json
qapi-schema.json
qbool.c
qbool.h
qdict-test-data.txt
qdict.c
qdict.h
qemu_socket.h
qemu-aio.h
qemu-barrier.h
qemu-bridge-helper.c
qemu-char.c
qemu-char.h
qemu-common.h
qemu-config.c
qemu-config.h
qemu-coroutine-int.h
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-coroutine.h
qemu-doc.texi
qemu-error.c
qemu-error.h
qemu-file.h
qemu-ga.c
qemu-img-cmds.hx
qemu-img.c
qemu-img.texi
qemu-io.c
qemu-lock.h
qemu-log.c
qemu-log.h
qemu-nbd.c
qemu-nbd.texi
qemu-objects.h
qemu-option-internal.h
qemu-option.c
qemu-option.h
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx
qemu-os-posix.h
qemu-os-win32.h
qemu-progress.c
qemu-queue.h
qemu-sockets.c
qemu-tech.texi
qemu-thread-posix.c
qemu-thread-posix.h
qemu-thread-win32.c
qemu-thread-win32.h
qemu-thread.h
qemu-timer-common.c
qemu-timer.c
qemu-timer.h
qemu-tls.h
qemu-tool.c
qemu-user.c
qemu-x509.h
qemu-xattr.h
qemu.sasl
qerror.c
qerror.h
qfloat.c
qfloat.h
qint.c
qint.h
qjson.c
qjson.h
qlist.c
qlist.h
qmp-commands.hx
qmp.c
qobject.h
qstring.c
qstring.h
qtest.c
qtest.h
range.h Introduce range.h 2010-09-18 05:53:14 +00:00
readline.c
readline.h
README
rules.mak
s390-dis.c
s390.ld
savevm.c
sh4-dis.c
softmmu_defs.h
softmmu_exec.h
softmmu_header.h
softmmu_template.h
softmmu-semi.h
sparc64.ld
sparc-dis.c
sparc.ld
spice-qemu-char.c
sysemu.h
targphys.h
tcg-runtime.c
tci-dis.c
tci.c
thunk.c
thunk.h
TODO
trace-events
translate-all.c
uboot_image.h
user-exec.c
VERSION
version.rc
vgafont.h
vl.c handle device help before accelerator set up 2012-08-09 19:53:01 +00:00
vmstate.h
x86_64.ld
xen-all.c
xen-mapcache.c
xen-mapcache.h
xen-stub.c

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team