On 9/19/2022 1:46 PM, Chenyi Qiang wrote:
Not sure some warning would be also useful here, but I really don't know
the whole context so I can't tell whether there can easily be false
positives to pollute qemu log.


The false positive case is not easy to happen unless some potential issues in silicon. But in case of it, to avoid polluting qemu log, how about:

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index ae7fb2c495..8f97133cbf 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -5213,6 +5213,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
          break;
      case KVM_EXIT_NOTIFY:
          ret = 0;
+        warn_report_once("KVM: notify window was exceeded in guest");
          if (run->notify.flags & KVM_NOTIFY_CONTEXT_INVALID) {
              warn_report("KVM: invalid context due to notify vmexit");
              if (has_triple_fault_event) {

how about this

    case KVM_EXIT_NOTIFY:
        bool ctx_invalid = run->notify.flags & KVM_NOTIFY_CONTEXT_INVALID;
        ret = 0;
        warn_report_once("KVM: Encounter notify exit with %svalid context",
                         ctx_invalid ? "in" : "");

        if (ctx_invalid) {
            ...
        }

Reply via email to