You are not logged in.

#1 2022-10-15 17:36:44

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

[SOLVED] qemu doesn't boot drives with cache=none

After upgrading to the latest qemu version 7.1.0-9 all my vm's that use the option "-drive ...,cache=none,.." don't boot anymore (error message: Boot failed: could not read the boot disk),
Setting cache to writeback, writethrough etc. solves the problem.

I can't find any related info in the qemu changelog. So it seems to be a bug?
Anyone else with this problem?

System: Linux 6.0.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 13 Oct 2022 18:58:49 +0000 x86_64 GNU/Linux
package: qemu-desktop 7.1.0-9

edit:
The issue is only present with specific setups: See my bug report for more details:
https://bugs.archlinux.org/task/76220

Last edited by metzengerstein (2022-10-20 17:09:25)

Offline

#2 2022-10-15 18:36:50

xerxes_
Member
Registered: 2018-04-29
Posts: 675

Re: [SOLVED] qemu doesn't boot drives with cache=none

I also have qemu version 7.1.0-9 and I can start iso image by commands:

qemu-system-i386 -cdrom some.iso
qemu-system-i386 -drive file=some.iso,index=0,media=cdrom

I'm using lts kernel.
What image format do you have?

Offline

#3 2022-10-15 20:19:04

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

I mean raw disk devices, like this "-drive file=file.img,format=raw,cache=none,if=virtio"
Omitting the cache works fine, since qemu defaults to writeback. Only none leads to this problem.

Offline

#4 2022-10-15 20:23:52

frostschutz
Member
Registered: 2013-11-15
Posts: 1,418

Re: [SOLVED] qemu doesn't boot drives with cache=none

I am using `-drive if=virtio,media=disk,cache=none,format=raw,readonly=on,file=...` [and variations thereof] and it works fine for me…

Offline

#5 2022-10-15 21:14:00

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

frostschutz wrote:

I am using `-drive if=virtio,media=disk,cache=none,format=raw,readonly=on,file=...` [and variations thereof] and it works fine for me…

Strange. Are you on another architecture?

I've ruled out all other qemu options, it's definitly the cache option.

Btw. the guests all use normal bios with gpt partitioning (no uefi), if that makes a difference.

Offline

#6 2022-10-15 21:17:58

frostschutz
Member
Registered: 2013-11-15
Posts: 1,418

Re: [SOLVED] qemu doesn't boot drives with cache=none

I'm still on 5.19 kernel, haven't updated to 6.0.x yet (I tend to skip the first few versions), you could boot linux-lts to check if that's it? It would certainly be weird though. I don't use uefi either.

Offline

#7 2022-10-16 22:56:37

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

Linux-lts doesn't have this problem.
Btw: link to bug report: https://bugs.archlinux.org/task/76220

Offline

#8 2022-10-17 14:50:17

xerxes_
Member
Registered: 2018-04-29
Posts: 675

Re: [SOLVED] qemu doesn't boot drives with cache=none

I updated kernel to 6.0.2 version and can not recreate this bug with this options:

qemu-system-i386 -drive file=cd.iso,index=0,media=cdrom,cache=none
qemu-system-i386 -drive file=cd.iso,media=cdrom,cache=none

Maybe try with more simple syntax, less options, without kvm or any hardware virtualization, to see if it will work.

Offline

#9 2022-10-17 17:35:33

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

It's getting weirder: The bug happens only if the file (disk image, iso) resides on a file system inside a crypto luks container (which is my setup since ages).
More info in https://bugs.archlinux.org/task/76220, if someone wants to reproduce the finding.

Last edited by metzengerstein (2022-10-17 17:36:14)

Offline

#10 2022-10-17 20:30:04

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

The kernel linked below is the midpoint between 5.19 and 6.0 does it have the issue?
https://drive.google.com/file/d/1RWd7nF … sp=sharing linux-5.19.r8199.g78acd4ca4334-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1Qdt_aQ … sp=sharing linux-headers-5.19.r8199.g78acd4ca4334-1-x86_64.pkg.tar.zst

Offline

#11 2022-10-17 20:47:26

xerxes_
Member
Registered: 2018-04-29
Posts: 675

Re: [SOLVED] qemu doesn't boot drives with cache=none

I tried to reproduce that bug with cryptsetup on spare drive according to your link from post 9, but I still could boot it, sorry (I have bios not uefi on this machine).

Offline

#12 2022-10-17 22:57:48

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

xerxes_ wrote:

I tried to reproduce that bug with cryptsetup on spare drive according to your link from post 9, but I still could boot it, sorry (I have bios not uefi on this machine).

Thanks for trying, but as you can see in my last post in the bug report, the bug somehow depends on the encryption sector size of the luks container.
And maybe it also makes a diffrerence that you use qemu-system-i386?

Last edited by metzengerstein (2022-10-17 22:59:30)

Offline

#13 2022-10-18 17:23:48

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

Were you able to test linux 6.0.arch1-1 to confirm the issue was introduced by 6.0 rather than the first stable release 6.0.1?  You could also test linux-mainline 6.1-rc1.
If you do not want to bisect the kernel have you opened an upstream bug report?

Offline

#14 2022-10-19 00:42:41

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

loqs wrote:

Were you able to test linux 6.0.arch1-1 to confirm the issue was introduced by 6.0 rather than the first stable release 6.0.1?  You could also test linux-mainline 6.1-rc1.
If you do not want to bisect the kernel have you opened an upstream bug report?

Thank you. After testing the kernels you've posted, the situation is as follows:

bug is not present:
- linux-lts 5.15.74-1
- linux 5.19.13.arch1-1

bug is present: 
- linux 5.19.r8199.g78acd4ca4334-1
- linux 6.0.1-arch1-1
- linux 6.0.2.arch1-1
- linux-mainline 6.1-rc1

Last edited by metzengerstein (2022-10-19 00:44:35)

Offline

#15 2022-10-19 01:52:41

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

This one took a while as the build failed with pahole 1.24,  so I had to re start it with pahole 1.23 as I could not find the commit that fixed the issue with pahole

git bisect bad
Bisecting: 4990 revisions left to test after this (roughly 12 steps)
[526942b8134cc34d25d27f95dfff98b8ce2f6fcd] Merge tag 'ata-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata

https://drive.google.com/file/d/1F6ygo1 … sp=sharing linux-5.19.r3208.g526942b8134c-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1nnKC5O … sp=sharing linux-headers-5.19.r3208.g526942b8134c-1-x86_64.pkg.tar.zst
Edit:
If the kernel above is bad

git bisect bad
Bisecting: 1601 revisions left to test after this (roughly 11 steps)
[2e7a95156d64667a8ded606829d57c6fc92e41df] Merge tag 'regmap-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

https://drive.google.com/file/d/1LyR7xv … sp=sharing linux-5.19.r1606.g2e7a95156d64-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1M5WeSW … sp=sharing linux-headers-5.19.r1606.g2e7a95156d64-1-x86_64.pkg.tar.zst

Last edited by loqs (2022-10-19 02:41:09)

Offline

#16 2022-10-19 17:52:57

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

Thanks for your effort. Result:

bug is not present: linux-5.19.r1606.g2e7a95156d64-1
bug is present: linux-5.19.r3208.g526942b8134c-1

Offline

#17 2022-10-19 18:26:14

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

git bisect good
Bisecting: 792 revisions left to test after this (roughly 10 steps)
[c013d0af81f60cc7dbe357c4e2a925fb6738dbfe] Merge tag 'for-5.20/block-2022-07-29' of git://git.kernel.dk/linux-block

https://drive.google.com/file/d/1Mhe1LD … sp=sharing linux-5.19.r2415.gc013d0af81f6-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1zCw03n … sp=sharing linux-headers-5.19.r2415.gc013d0af81f6-1-x86_64.pkg.tar.zst

Offline

#18 2022-10-19 18:54:36

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

bug is present: linux-5.19.r2415.gc013d0af81f6-1

Offline

#19 2022-10-19 19:34:49

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

git bisect bad
Bisecting: 405 revisions left to test after this (roughly 9 steps)
[efb2883060afc79638bb1eb19e2c30e7f6c5a178] Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

https://drive.google.com/file/d/1IqjYbI … sp=sharing linux-5.19.r2009.gefb2883060af-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1ct3TMC … sp=sharing linux-headers-5.19.r2009.gefb2883060af-1-x86_64.pkg.tar.zst

Offline

#20 2022-10-19 19:43:06

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

bug is not present: linux-5.19.r2009.gefb2883060af-1

Offline

#21 2022-10-19 20:07:51

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

git bisect good
Bisecting: 202 revisions left to test after this (roughly 8 steps)
[cb309ae49da7a7c28f0051deea13970291134fac] io_uring/net: improve io_get_notif_slot types

https://drive.google.com/file/d/1SOuiH0 … sp=sharing linux-5.19rc8.r203.gcb309ae49da7-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/17OYgoW … sp=sharing linux-headers-5.19rc8.r203.gcb309ae49da7-1-x86_64.pkg.tar.zst

Offline

#22 2022-10-19 20:24:00

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

bug is not present: linux-5.19rc8.r203.gcb309ae49da7-1

Offline

#23 2022-10-19 20:45:43

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

git bisect good
Bisecting: 101 revisions left to test after this (roughly 7 steps)
[22c80aac882f712897b88b7ea8f5a74ea19019df] blktrace: Trace remapped requests correctly

https://drive.google.com/file/d/1x9tmWa … sp=sharing linux-5.19rc4.r101.g22c80aac882f-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/14oW12V … sp=sharing linux-headers-5.19rc4.r101.g22c80aac882f-1-x86_64.pkg.tar.zst

Offline

#24 2022-10-19 20:53:24

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: [SOLVED] qemu doesn't boot drives with cache=none

bug is present: linux-5.19rc4.r101.g22c80aac882f-1

Offline

#25 2022-10-19 21:29:22

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] qemu doesn't boot drives with cache=none

git bisect bad
Bisecting: 50 revisions left to test after this (roughly 6 steps)
[22d0c4080fe49299640d9d6c43154c49794c2825] block: simplify disk_set_independent_access_ranges

https://drive.google.com/file/d/1dY6WEz … sp=sharing linux-5.19rc4.r50.g22d0c4080fe4-1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1eauXXD … sp=sharing linux-headers-5.19rc4.r50.g22d0c4080fe4-1-x86_64.pkg.tar.zst

Offline

Board footer

Powered by FluxBB