[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 27/27] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings
|
From: |
Peter Maydell |
|
Subject: |
Re: [PATCH v3 27/27] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings |
|
Date: |
Tue, 16 Apr 2024 16:32:01 +0100 |
On Fri, 12 Apr 2024 at 08:37, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/i386/kvm/kvm.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index e68cbe9293..1fc809b2f9 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -5275,7 +5275,6 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run
> *run)
> uint64_t code;
> int ret;
> bool ctx_invalid;
> - char str[256];
> KVMState *state;
>
> switch (run->exit_reason) {
> @@ -5335,15 +5334,16 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run
> *run)
> case KVM_EXIT_NOTIFY:
> ctx_invalid = !!(run->notify.flags & KVM_NOTIFY_CONTEXT_INVALID);
> state = KVM_STATE(current_accel());
> - sprintf(str, "Encounter a notify exit with %svalid context in"
> - " guest. There can be possible misbehaves in guest."
> - " Please have a look.", ctx_invalid ? "in" : "");
> if (ctx_invalid ||
> state->notify_vmexit == NOTIFY_VMEXIT_OPTION_INTERNAL_ERROR) {
> - warn_report("KVM internal error: %s", str);
> + warn_report("KVM internal error: Encountered a notify exit "
> + "with invalid context in guest.");
> ret = -1;
> } else {
> - warn_report_once("KVM: %s", str);
> + warn_report_once("KVM: Encounterd a notify exit with valid "
"Encountered"
> + "context in guest. "
> + "The guest could be misbehaving. "
> + "Please have a look.");
"Please have a look" is a bit more chatty than we usually are
in warning messages...
thanks
-- PMM
- [PATCH v3 21/27] disas/riscv: Use GString in format_inst, (continued)
- [PATCH v3 21/27] disas/riscv: Use GString in format_inst, Richard Henderson, 2024/04/12
- [PATCH v3 25/27] hw/riscv/virt: Replace sprintf by g_strdup_printf, Richard Henderson, 2024/04/12
- [PATCH v3 19/27] disas/microblaze: Print registers directly with PRIrfsl, Richard Henderson, 2024/04/12
- [PATCH v3 20/27] disas/microblaze: Split get_field_special, Richard Henderson, 2024/04/12
- [PATCH v3 24/27] hw/net/rocker: Replace sprintf() by snprintf(), Richard Henderson, 2024/04/12
- [PATCH v3 27/27] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings, Richard Henderson, 2024/04/12