qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* qemu-user self emulation broken with default CPU on x86/x64
@ 2023-07-03 16:03 Pierrick Bouvier
  2023-07-03 18:04 ` Daniel P. Berrangé
  2023-07-03 21:05 ` GLibC AMD CPUID cache reporting regression (was Re: qemu-user self emulation broken with default CPU on x86/x64) Daniel P. Berrangé
  0 siblings, 2 replies; 6+ messages in thread
From: Pierrick Bouvier @ 2023-07-03 16:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Richard Henderson, laurent

Hi everyone,

Recently (in d135f781 [1], between v7.0.0 and v8.0.0), qemu-user default 
cpu was updated to "max" instead of qemu32/qemu64.

This change "broke" qemu self emulation if this new default cpu is used.

$ ./qemu-x86_64 ./qemu-x86_64 --version
qemu-x86_64: ../util/cacheflush.c:212: init_cache_info: Assertion 
`(isize & (isize - 1)) == 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

By setting cpu back to qemu64, it works again.
$ ./qemu-x86_64 -cpu qemu64 ./qemu-x86_64  --version
qemu-x86_64 version 8.0.50 (v8.0.0-2317-ge125b08ed6)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

Commenting assert does not work, as qemu aligned malloc fail shortly after.

I'm willing to fix it, but I'm not sure what is the issue with "max" cpu 
exactly. Is it missing CPU cache line, or something else?
Any guidance would be welcome.

I know it's not the most important problem on earth, but it's still 
surprising to meet this when you try to use qemu to emulate itself.

Regards,
Pierrick

[1] 
https://gitlab.com/qemu-project/qemu/-/commit/d135f781405f7c78153aa65e0327b05a4aa72e50


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-05 13:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-03 16:03 qemu-user self emulation broken with default CPU on x86/x64 Pierrick Bouvier
2023-07-03 18:04 ` Daniel P. Berrangé
2023-07-03 21:05 ` GLibC AMD CPUID cache reporting regression (was Re: qemu-user self emulation broken with default CPU on x86/x64) Daniel P. Berrangé
2023-07-04 17:30   ` Pierrick Bouvier
2023-07-04 17:37   ` Florian Weimer
2023-07-05 13:08     ` Karumanchi, Sajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).