Andrew Jones <ajo...@ventanamicro.com> writes: > On Wed, Jul 31, 2024 at 08:30:46AM GMT, Markus Armbruster wrote: >> I apologize for the delay. >> >> Daniel Henrique Barboza <dbarb...@ventanamicro.com> writes: >> >> > We're not honouring KVM options that are provided by any -accel option >> > aside from the first. In this example: >> > >> > qemu-system-riscv64 -accel kvm,riscv-aia=emul (...) \ >> > -accel kvm,riscv-aia=hwaccel >> > >> > 'riscv-aia' will be set to 'emul', ignoring the last occurrence of the >> > option that set 'riscv-aia' to 'hwaccel'. >> >> The way you phrase this, it sounds like a bug. But as far as I know, >> -accel is meant to have fallback semantics: we use the first one that >> works. > > The fact that some (most?) parameters have override semantics and some > have fallback semantics makes our complicated command line even more > complicated, especially since there's no way to know which is which.
We traditionally tramsmit such knowledge from guru to disciple. We certainly made an unholy mess of our command line. > IMHO, always having override semantics and then providing new parameters, > e.g. -accel-fallback (or a property, -accel fallback=on,...), would go a > long way to bringing some order to the universe. > >> Perhaps: >> >> -accel has fallback semantics, i.e. we try accelerators in order until >> we find one that works. Any remainder is ignored. >> >> Because of that, you can't override properties like this: >> >> qemu-system-riscv64 -accel kvm,riscv-aia=emul (...) \ >> -accel kvm,riscv-aia=hwaccel >> >> When KVM is available, 'riscv-aia' will be set to 'emul', and the >> second -accel is ignored. When KVM is not available, neither option >> works, and the command fails. >> >> Why would you want to override accelerator properties? > > Testing. Many properties are only available to allow the user to force > non defaults. The example above isn't exactly what triggered this. The > real use is, '-accel kvm' is the default used by libvirt and when > riscv-aia=hwaccel is possible, it will default to hwaccel. In order to > test riscv-aia emulation support using libvirt (which doesn't yet allow > selecting anything riscv specific), I attempted to use the qemu > commandline element to override -accel with kvm,riscv-aia=emul. Ah, that explains why -global solves your problem, too! Thanks! I recommend to start the commit message with the use case, then describe the solution. Mention other solutions last, if at all.