]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv/kvm: set 'aia_mode' to default in error path
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Mon, 28 Oct 2024 18:20:36 +0000 (15:20 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 5 Nov 2024 07:38:31 +0000 (10:38 +0300)
commit7f9dc099c7fdad24fca85b4171df0713855164f5
treec926a1394469f1acc54bf93664959aa157692987
parent2a5c4a91ca5fbd46f5a58eb9bf274af56dc7252c
target/riscv/kvm: set 'aia_mode' to default in error path

When failing to set the selected AIA mode, 'aia_mode' is left untouched.
This means that 'aia_mode' will not reflect the actual AIA mode,
retrieved in 'default_aia_mode',

This is benign for now, but it will impact QMP query commands that will
expose the 'aia_mode' value, retrieving the wrong value.

Set 'aia_mode' to 'default_aia_mode' if we fail to change the AIA mode
in KVM.

While we're at it, rework the log/warning messages to be a bit less
verbose. Instead of:

KVM AIA: default mode is emul
qemu-system-riscv64: warning: KVM AIA: failed to set KVM AIA mode

We can use a single warning message:

qemu-system-riscv64: warning: KVM AIA: failed to set KVM AIA mode 'auto', using default host mode 'emul'

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20241028182037.290171-2-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit d201a127e164b1683df5e7c93c6d42a74122db99)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/riscv/kvm/kvm-cpu.c