[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 27/27] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 27/27] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings |
|
Date: |
Fri, 12 Apr 2024 00:33:46 -0700 |
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 "
+ "context in guest. "
+ "The guest could be misbehaving. "
+ "Please have a look.");
ret = 0;
}
break;
--
2.34.1
- [PATCH v3 26/27] target/arm: Replace sprintf() by snprintf(), (continued)
- [PATCH v3 26/27] target/arm: Replace sprintf() by snprintf(), Richard Henderson, 2024/04/12
- [PATCH v3 22/27] linux-user/flatload: Replace sprintf() by snprintf(), Richard Henderson, 2024/04/12
- [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 <=