From patchwork Fri Apr 12 07:33:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 788266 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp591258wrm; Fri, 12 Apr 2024 00:37:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX6wxiIwPKW7gH+ACE6FyX6t8DLO5AZJJ2/7FA8oElQWbBcc30YBj+eCT46LPDD1sFhVO9/Tm42HeWc9Fhco5wR X-Google-Smtp-Source: AGHT+IEdolfvSE9ZeSDSaIhIYUnP9d9JU6abeY7z916Ap1RK+RO9NJXUoH2UC2e2/XE8PHwoyPP4 X-Received: by 2002:ac8:57d2:0:b0:434:c13b:7b4a with SMTP id w18-20020ac857d2000000b00434c13b7b4amr2204639qta.32.1712907430922; Fri, 12 Apr 2024 00:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712907430; cv=none; d=google.com; s=arc-20160816; b=Y1Fddm9U0sSvucSzD90wLe3KSTlmpgdToLS7tiv1PLDER581rrEuVGG/JqA0dP0e36 VeY/uF1ER6KaVv7De+et5tQ6TkulpEtdoYtU0xvwiIlbvRQ8jQZQqRWf9QCfx/WMCRzm Q8mVL1Jyu07v8lyRONrJt44mLxwZSgM08GtQD5VxeKmC2A9pzuLvdahNIlIz81iSloE9 cVqJ8LAOeZjkdiqLMyxcJqCLQyGebOzCGsgBc+bhwYEkS+f3TkVlgCFTMJnV56hzC56F V/4fDcwwIZ2vc7n1+nf5s+kLiuaKQTXiJJWAdg5SSNJSfBlFWPHZ0JxVROGP1uzUEBrH rI7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3QxLZpCYn/H6Te2A9HVNEOscia45z8pGQiv2WcFZT0s=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=SYwlNys6Td5KU3GsT3TCPz9s910bAVLCfV798Bu0GNKmJsF34Zhud02+ouPXLQtZsZ BGW2+X+GEltTlhkzMJvSq+Z2qn0j+0ey40zs7BrZltWGygSDa6MMzbn9Dgeysa1cFFSX WOWklbYvY7Dl0Au5BJmpCY1ZiA5FTRK0C9xi3DWBk85qlv5HISIXNqIUFqF5dTxLoESm twv5fJfIhUZ4gL4a9Glrqx+W/aDWIHCatRTs49rl7TS+Zdof+Ka5xBJEutpEeuPPFvHr iBNxsOYssLwO66j76ZtdnDCpVEBSINpkttaCX22rfY4ejzaZ/wQSjykY9S2D6pK2MC0T DvRw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sqmwV4bc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e13-20020ac8598d000000b004366ce5c326si2539939qte.351.2024.04.12.00.37.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Apr 2024 00:37:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sqmwV4bc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvBQU-00079P-DF; Fri, 12 Apr 2024 03:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvBQT-00078Z-7c for qemu-devel@nongnu.org; Fri, 12 Apr 2024 03:34:21 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rvBQJ-0007Dr-5S for qemu-devel@nongnu.org; Fri, 12 Apr 2024 03:34:20 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1e3f17c64daso5128175ad.3 for ; Fri, 12 Apr 2024 00:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712907249; x=1713512049; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3QxLZpCYn/H6Te2A9HVNEOscia45z8pGQiv2WcFZT0s=; b=sqmwV4bcV2mM3oMSICPtAvruRkJsxnk65pSTxClQmxUHHaRai22N9eQ9LJUT5vwie1 52MGSDVhIRL33nrl52nR5BpV224k+2zShb8eLuNQPdakNotfBRGFz0nz1kuZkRmdwnUI XyKAF3M+r9AbB7TLdVyf16TiQzpvw2RfX1XP0geMZuacpXbTunV6uJIs46cZHkLgEpv2 x30OuoVf1N6AvW4H1B+swjmU+bTTTRAAJygk/agqloXCnOURIZo7shVk43171+un6d1T rdDTzjKygy00fQgwUThsBAhNTGzCk9lnxXPDb4iwn5+owii4NiYVPaCXGQcAOQfWqJAn GxnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712907249; x=1713512049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3QxLZpCYn/H6Te2A9HVNEOscia45z8pGQiv2WcFZT0s=; b=gO6UitRlUFFPy2Y5kl8KEnYLboqXOCc7slKnVGutn9APgNz0SKuwGtwNozIhGQQN0P JQ6/h7JVkWzwpWD8kZyM0TRlsm7B/TXGREtI4T2unMmhZCCiXllJ5rgkQ+xFDGXKilgc Jj2HFXdFqvsSbLqwwgcHzgoY2g8Za89pM7Yga+Ud6+f1QWBP00VXrfewGExNs0788DkD GgemT+gbhLHpQs8rDhS5W0ufjcaW+deRB5e4VzxuJNU9UyYA+a0i+QhWcAfcMFqQlYYN SmcmR2vm5usMcklGfmKmadoc9h0G0vN8Yi2VVLG1tz1nyaP0S3pA1qL6ouzwCbJrurhz KAnA== X-Gm-Message-State: AOJu0YzJzlDjCJNPEZ5gEd1JqM6exMNEq7gamlQndKOST/e/qsxuoYzg 2Fg5qghuX3jPEjd6/tXstPwPU21/dj2ZJpCWrKpiNI/JIfneapJvXm8e7ORwG/LxLE0ZOSoZYdh 9 X-Received: by 2002:a17:902:7008:b0:1e2:a5b3:e7 with SMTP id y8-20020a170902700800b001e2a5b300e7mr1477387plk.58.1712907249051; Fri, 12 Apr 2024 00:34:09 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id e5-20020a17090301c500b001e556734814sm2206099plh.134.2024.04.12.00.34.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 00:34:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 27/27] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings Date: Fri, 12 Apr 2024 00:33:46 -0700 Message-Id: <20240412073346.458116-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412073346.458116-1-richard.henderson@linaro.org> References: <20240412073346.458116-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- 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;