[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.3 55/59] target/riscv/kvm: improve 'init_multiext_cfg' error
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.3 55/59] target/riscv/kvm: improve 'init_multiext_cfg' error msg |
Date: |
Sun, 19 Nov 2023 21:19:51 +0300 |
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Our error message is returning the value of 'ret', which will be always
-1 in case of error, and will not be that useful:
qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error -1
Improve the error message by outputting 'errno' instead of 'ret'. Use
strerrorname_np() to output the error name instead of the error code.
This will give us what we need to know right away:
qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error code:
ENOENT
Given that we're going to exit(1) in this condition instead of
attempting to recover, remove the 'kvm_riscv_destroy_scratch_vcpu()'
call.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231003132148.797921-2-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 082e9e4a58ba80ec056220a2f762a1c6b9a3a96c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index dbcf26f27d..c8e1bb9087 100644
--- a/target/riscv/kvm.c
+++ b/target/riscv/kvm.c
@@ -727,8 +727,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu,
KVMScratchCPU *kvmcpu)
val = false;
} else {
error_report("Unable to read ISA_EXT KVM register %s, "
- "error %d", multi_ext_cfg->name, ret);
- kvm_riscv_destroy_scratch_vcpu(kvmcpu);
+ "error code: %s", multi_ext_cfg->name,
+ strerrorname_np(errno));
exit(EXIT_FAILURE);
}
} else {
--
2.39.2
- [Stable-8.1.3 v2 00/59] Patch Round-up for stable 8.1.3, frozen on 2023-11-19, Michael Tokarev, 2023/11/19
- [Stable-8.1.3 54/59] tracetool: avoid invalid escape in Python string, Michael Tokarev, 2023/11/19
- [Stable-8.1.3 55/59] target/riscv/kvm: improve 'init_multiext_cfg' error msg,
Michael Tokarev <=
- [Stable-8.1.3 56/59] target/riscv/kvm: support KVM_GET_REG_LIST, Michael Tokarev, 2023/11/19
- [Stable-8.1.3 58/59] target/arm: HVC at EL3 should go to EL3, not EL2, Michael Tokarev, 2023/11/19
- [Stable-8.1.3 57/59] s390x/pci: only limit DMA aperture if vfio DMA limit reported, Michael Tokarev, 2023/11/19
- [Stable-8.1.3 59/59] hw/mips: LOONGSON3V depends on UNIMP device, Michael Tokarev, 2023/11/19
- Re: [Stable-8.1.3 v2 00/59] Patch Round-up for stable 8.1.3, frozen on 2023-11-19, Thomas Huth, 2023/11/20