Activity log for bug #2025591

Date Who What changed Old value New value Message
2023-07-03 05:34:30 Chengen Du bug added bug
2023-07-03 05:34:51 Chengen Du nominated for series Ubuntu Jammy
2023-07-03 05:34:51 Chengen Du bug task added qemu (Ubuntu Jammy)
2023-07-03 05:37:00 Chengen Du qemu (Ubuntu): assignee ChengEn, Du (chengendu)
2023-07-03 05:37:03 Chengen Du qemu (Ubuntu Jammy): assignee ChengEn, Du (chengendu)
2023-07-03 05:43:29 Chengen Du attachment added jammy_use_the_request_length_for_iov_alignment.debdiff https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2025591/+attachment/5683484/+files/jammy_use_the_request_length_for_iov_alignment.debdiff
2023-07-03 05:43:53 Chengen Du qemu (Ubuntu Jammy): status New In Progress
2023-07-03 05:43:57 Chengen Du qemu (Ubuntu): status New In Progress
2023-07-03 06:50:03 Chengen Du tags sts-sponsor sts-sru-needed
2023-07-03 08:16:39 Ubuntu Foundations Team Bug Bot tags sts-sponsor sts-sru-needed patch sts-sponsor sts-sru-needed
2023-07-03 08:16:42 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Sponsors
2023-07-03 19:16:11 Mauricio Faria de Oliveira removed subscriber Ubuntu Sponsors
2023-07-03 19:18:32 Mauricio Faria de Oliveira tags patch sts-sponsor sts-sru-needed patch se-sponsor-mfo
2023-07-03 19:19:49 Mauricio Faria de Oliveira bug added subscriber Support Engineering Sponsors
2023-07-03 22:11:45 Mauricio Faria de Oliveira description [Impact] When the logical block size of the virtual block device is smaller than the block device it is backed by on the host, qemu encounters a situation where it needs to bounce unaligned buffers during the use of direct IO. In the past, the logical block size happened to align with the memory page offset, leading qemu to mistakenly use the memory offset as the block size. However, a kernel commit b1a000d3b8ec resolved this issue by separating memory alignment from the logical block size. As a result, qemu now has an incorrect understanding of the minimum vector size. [Fix] Upstream commit 25474d90aa50 fixed this issue. ========== Author: Keith Busch <kbusch@kernel.org> CommitDate: Fri Sep 30 18:43:44 2022 +0200 block: use the request length for iov alignment An iov length needs to be aligned to the logical block size, which may be larger than the memory alignment. Tested-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Keith Busch <kbusch@kernel.org> Message-Id: <20220929200523.3218710-3-kbusch@meta.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> ========== [Test Plan] 1. Get a ubuntu image and convert it to RAW format wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img qemu-img convert jammy-server-cloudimg-amd64-disk-kvm.img jammy-server-cloudimg-amd64-disk-kvm.raw 2. Set up a loop device with RAW image losetup -b 4096 -f jammy-server-cloudimg-amd64-disk-kvm.raw 3. Get loop device number by `losetup -a` command 4. Start the virtual machine qemu-system-x86_64 -enable-kvm -drive file=/dev/loopX,format=raw,cache=none --nographic [Where problems could occur] The patch addressed the issue of misusing the memory offset as the block size. This problem only occurred when the cache option was set to "none" and the Linux kernel being used had the commit b1a000d3b8ec. However, it is worth noting that the patch also worked effectively with older kernels. [Other Info] [Impact] * Failure to boot VMs on Jammy with the HWE 6.2 kernel (from Lunar) when using direct IO (e.g., cache=none) if the virtual block device's block size is smaller than the host device/file's block size. * The issue might become increasingly more common with storage with 4k sector size, and as Jammy/22.04 ages and users go to newer/HWE kernels for newer hardware. [Fix] * When the logical block size of the virtual block device is smaller than the block device's it is backed by on the host, qemu encounters a situation where it needs to bounce unaligned buffers during the use of direct IO. In the past, the logical block size happened to align with the memory page offset, leading qemu to mistakenly use the memory offset as the block size. However, a kernel commit b1a000d3b8ec (in Linux v6.0) resolved this issue by separating memory alignment from the logical block size. As a result, qemu now has an incorrect understanding of the minimum vector size. The qemu commit 25474d90aa50 ("block: use the request length for iov alignment") fixes this (in QEMU v7.2). [Test Plan] * Run qemu with a block device (default block size: 512) backed by a loop device with block size of 4096 bytes, without cache (ie, direct IO) on Jammy with HWE kernel: LOOPDEV=$(losetup --find --show --sector-size 4096 jammy.raw) qemu-system-x86_64 -drive file=$LOOPDEV,format=raw,cache=none \ -boot order=c -nodefaults -no-user-config \ -nographic -serial stdio -enable-kvm Expected: # qemu-system-x86_64 ... SeaBIOS (version 1.15.0-1) Booting from Hard Disk... GRUB_FORCE_PARTUUID set, initrdless boot failed. Attempting with initrd. Linux version <...> ... Actual: # qemu-system-x86_64 ... SeaBIOS (version 1.15.0-1) Booting from Hard Disk... Boot failed: could not read the boot disk Booting from Floppy... Boot failed: could not read the boot disk No bootable device. <ctrl-c> qemu-system-x86_64: terminating on signal 2 [Where problems could occur] * Potential regressions would likely manifest in QEMU file I/O path, possibly with errors or performance differences due to the change in alignment detection. These should be easy to test on early testing with a relatively small test matrix: - (host) kernel: GA (5.15) and HWE (6.2) - (host) block size 512 and 4096 bytes An incremental patch for tracing the old/new value used by QEMU (changed by the fix) will be used for verification/debugging purposes. [Other Info] * Kinetic is affected (QEMU 7.0 < 7.2) but will not be fixed due to EOL in ~2 weeks and Lunar (upgrade) is fixed.
2023-07-03 22:12:19 Mauricio Faria de Oliveira nominated for series Ubuntu Kinetic
2023-07-03 22:12:19 Mauricio Faria de Oliveira bug task added qemu (Ubuntu Kinetic)
2023-07-03 22:12:19 Mauricio Faria de Oliveira nominated for series Ubuntu Lunar
2023-07-03 22:12:19 Mauricio Faria de Oliveira bug task added qemu (Ubuntu Lunar)
2023-07-03 22:12:36 Mauricio Faria de Oliveira qemu (Ubuntu Jammy): importance Undecided High
2023-07-03 22:12:40 Mauricio Faria de Oliveira qemu (Ubuntu Kinetic): status New Won't Fix
2023-07-03 22:12:45 Mauricio Faria de Oliveira qemu (Ubuntu Lunar): status New Invalid
2023-07-03 22:12:52 Mauricio Faria de Oliveira qemu (Ubuntu): status In Progress Invalid
2023-07-03 22:12:55 Mauricio Faria de Oliveira qemu (Ubuntu): assignee ChengEn, Du (chengendu)
2023-07-03 22:15:09 Mauricio Faria de Oliveira summary Align the iov length to the logical block size Boot error on Jammy on the 6.2 HWE kernel (Lunar) with direct IO if virtual block size < host block size
2023-07-03 22:15:38 Mauricio Faria de Oliveira description [Impact] * Failure to boot VMs on Jammy with the HWE 6.2 kernel (from Lunar) when using direct IO (e.g., cache=none) if the virtual block device's block size is smaller than the host device/file's block size. * The issue might become increasingly more common with storage with 4k sector size, and as Jammy/22.04 ages and users go to newer/HWE kernels for newer hardware. [Fix] * When the logical block size of the virtual block device is smaller than the block device's it is backed by on the host, qemu encounters a situation where it needs to bounce unaligned buffers during the use of direct IO. In the past, the logical block size happened to align with the memory page offset, leading qemu to mistakenly use the memory offset as the block size. However, a kernel commit b1a000d3b8ec (in Linux v6.0) resolved this issue by separating memory alignment from the logical block size. As a result, qemu now has an incorrect understanding of the minimum vector size. The qemu commit 25474d90aa50 ("block: use the request length for iov alignment") fixes this (in QEMU v7.2). [Test Plan] * Run qemu with a block device (default block size: 512) backed by a loop device with block size of 4096 bytes, without cache (ie, direct IO) on Jammy with HWE kernel: LOOPDEV=$(losetup --find --show --sector-size 4096 jammy.raw) qemu-system-x86_64 -drive file=$LOOPDEV,format=raw,cache=none \ -boot order=c -nodefaults -no-user-config \ -nographic -serial stdio -enable-kvm Expected: # qemu-system-x86_64 ... SeaBIOS (version 1.15.0-1) Booting from Hard Disk... GRUB_FORCE_PARTUUID set, initrdless boot failed. Attempting with initrd. Linux version <...> ... Actual: # qemu-system-x86_64 ... SeaBIOS (version 1.15.0-1) Booting from Hard Disk... Boot failed: could not read the boot disk Booting from Floppy... Boot failed: could not read the boot disk No bootable device. <ctrl-c> qemu-system-x86_64: terminating on signal 2 [Where problems could occur] * Potential regressions would likely manifest in QEMU file I/O path, possibly with errors or performance differences due to the change in alignment detection. These should be easy to test on early testing with a relatively small test matrix: - (host) kernel: GA (5.15) and HWE (6.2) - (host) block size 512 and 4096 bytes An incremental patch for tracing the old/new value used by QEMU (changed by the fix) will be used for verification/debugging purposes. [Other Info] * Kinetic is affected (QEMU 7.0 < 7.2) but will not be fixed due to EOL in ~2 weeks and Lunar (upgrade) is fixed. [Impact]  * Failure to boot VMs on Jammy with the HWE 6.2 kernel    (from Lunar) when using direct IO (e.g., cache=none)    if the virtual block device's block size is smaller    than the host device/file's block size.  * The issue might become increasingly more common with    storage with 4k sector size, and as Jammy/22.04 ages    and users go to newer/HWE kernels for newer hardware. [Fix]  * When the logical block size of the virtual block device    is smaller than the block device's it is backed by on    the host, qemu encounters a situation where it needs to    bounce unaligned buffers during the use of direct IO.    In the past, the logical block size happened to align    with the memory page offset, leading qemu to mistakenly    use the memory offset as the block size.    However, a kernel commit b1a000d3b8ec (in Linux v6.0)    resolved this issue by separating memory alignment    from the logical block size.    As a result, qemu now has an incorrect understanding    of the minimum vector size.    The qemu commit 25474d90aa50 ("block: use the request    length for iov alignment") fixes this (in QEMU v7.2). [Test Plan]  * Run qemu with a block device (default block size: 512)    backed by a loop device with block size of 4096 bytes,    without cache (ie, direct IO) on Jammy with HWE kernel:    LOOPDEV=$(losetup --find --show --sector-size 4096 jammy.raw)    qemu-system-x86_64 -drive file=$LOOPDEV,format=raw,cache=none \      -boot order=c -nodefaults -no-user-config \      -nographic -serial stdio -enable-kvm    Expected:  # qemu-system-x86_64 ...  SeaBIOS (version 1.15.0-1)  Booting from Hard Disk...  GRUB_FORCE_PARTUUID set, initrdless boot failed. Attempting with initrd.  Linux version <...>  ...    Actual:  # qemu-system-x86_64 ...  SeaBIOS (version 1.15.0-1)  Booting from Hard Disk...  Boot failed: could not read the boot disk  Booting from Floppy...  Boot failed: could not read the boot disk  No bootable device. [Where problems could occur]  * Potential regressions would likely manifest in QEMU    file I/O path, possibly with errors or performance    differences due to the change in alignment detection.    These should be easy to test on early testing with    a relatively small test matrix:    - (host) kernel: GA (5.15) and HWE (6.2)    - (host) block size 512 and 4096 bytes    An incremental patch for tracing the old/new value    used by QEMU (changed by the fix) will be used for    verification/debugging purposes. [Other Info]  * Kinetic is affected (QEMU 7.0 < 7.2) but will not    be fixed due to EOL in ~2 weeks and Lunar (upgrade)    is fixed.
2023-07-04 03:44:17 Ubuntu Archive Robot bug added subscriber Mauricio Faria de Oliveira
2023-07-04 13:42:28 Mauricio Faria de Oliveira attachment added lp2025591-qemu-jammy-v2.debdiff https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2025591/+attachment/5683853/+files/lp2025591-qemu-jammy-v2.debdiff
2023-07-04 15:25:34 Tyler Stachecki bug added subscriber Tyler Stachecki
2023-07-05 13:49:30 Robie Basak qemu (Ubuntu Jammy): status In Progress Fix Committed
2023-07-05 13:49:31 Robie Basak bug added subscriber Ubuntu Stable Release Updates Team
2023-07-05 13:49:33 Robie Basak bug added subscriber SRU Verification
2023-07-05 13:49:43 Robie Basak tags patch se-sponsor-mfo patch se-sponsor-mfo verification-needed verification-needed-jammy
2023-07-05 17:31:27 Mauricio Faria de Oliveira tags patch se-sponsor-mfo verification-needed verification-needed-jammy patch verification-done verification-done-jammy
2023-07-13 14:52:59 Launchpad Janitor qemu (Ubuntu Jammy): status Fix Committed Fix Released
2023-07-13 14:53:05 Andreas Hasenack removed subscriber Ubuntu Stable Release Updates Team