[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH 1/2] ahci: Fix ahci cdrom read cor
From: |
Andreas Färber |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH 1/2] ahci: Fix ahci cdrom read corruptions for reads > 128k |
Date: |
Fri, 27 Jul 2012 13:28:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120601 Thunderbird/13.0 |
Hi Jason,
Am 26.07.2012 21:40, schrieb Jason Baron:
> 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
> the 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 <address@hidden>
Tested-by: Andreas Färber <address@hidden>
This also fixes my test case of running the "Check Installation Media"
boot menu option on, e.g., openSUSE-12.1-GNOME-LiveCD-x86_64.iso with
ich9-ahci (BNC#725008).
Thanks a lot for finding the root cause!
If you resubmit, please cc address@hidden, I would very much
like to backport this bugfix to stable-0.15 branch.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-stable] [Qemu-devel] [PATCH 1/2] ahci: Fix ahci cdrom read corruptions for reads > 128k,
Andreas Färber <=