From patchwork Mon Jun 23 12:18:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 899224 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:25c5:b0:3a5:8cf5:b212 with SMTP id fs5csp2579731wrb; Mon, 23 Jun 2025 05:26:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVLv03QgjEHVXW7aSxANb65uL0TxHMm2fSjCv6AAPAoE+TBwpC9ULvhqhjJ46nf0+mRCuZCmA==@linaro.org X-Google-Smtp-Source: AGHT+IHMxSv7D9GVhSsMGTOd17vZCNrMwzbZPbNAvPHSxhfahDfAkHACz6o6kJRA4iSiNgy1eLKw X-Received: by 2002:a05:620a:3710:b0:7d2:1199:ac89 with SMTP id af79cd13be357-7d3f9935f9dmr2256745385a.36.1750681580767; Mon, 23 Jun 2025 05:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750681580; cv=none; d=google.com; s=arc-20240605; b=Qy6P/FTdf6DSUy2ccmDUiiZmWjTiOLo5hmd4Nu6NLAVvo3ZFnavzSc1BGgU1bG3SLv 2X+jeknWVJYqvB/0TGSST1eo3PEwjHIfGUahkPvMy8Itwlq/3F723SfpxRkxPCIugQKz wxwfDbf/GoFuzB3qgHElGCwR2jmLKPYK772CJMHI7e50ERF1L0jfcrXvbG7RSdT3QA/q r7bDa8Sj6wFGczpjJtwpOFubAb2OeEEdaHpLBG2T8HjoE3UvdRKI86vXbhifSXrbyX75 /AFcKMi4yuZ+4hNtoTpHd8NExg3OKtImnBQH91mPpNTCZAEKmqRs2VjhDXqpMzL6Z4e3 j/6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=FtS7m+vqlh7Qr+Y7luF/PvAhAhpP9RBj3It7GX3FL/4=; fh=x5VJDl6FrykOwQuDK8d67WYnSid/uzpvpvankGNJv0o=; b=V9HR/ByDE72d0uAArl1Crk1r9ZNWL4dwl8efIBpnUzQmvAuNjEZrtCu7cFH1kXhaUT nfS1QbbsUy2FQsjLjVs0MtaoRf+FWwEejV35dgw01ZHRZEeBB7dIxMLsAmjQyBo4wzms yX/eQiQvucUeoXDKQZC8kOqm6u8DifsoLm1dKdViUDk48omaeHy/SUZgrwN7eYn28fvC 4t9CcYXVmtM4jBxlyFP2jczeGZ67VdGpD1BQE+qlC2SIbxxWbNdv4/xiNYCh+5cjVgR0 WmLnrESTUtV3MHFE4KaaY7mUhggyd1YIP/XHc96uKApzMs6MbN0aJndkAjdLKB6fEkmu 6XnQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CaAcsmHA; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7d3f9a15283si769796085a.483.2025.06.23.05.26.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jun 2025 05:26:20 -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=CaAcsmHA; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uTg98-0001Qm-E5; Mon, 23 Jun 2025 08:19:35 -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 1uTg90-0001M9-2i for qemu-devel@nongnu.org; Mon, 23 Jun 2025 08:19:28 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uTg8w-0000Ub-Kr for qemu-devel@nongnu.org; Mon, 23 Jun 2025 08:19:25 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-451ebd3d149so21441515e9.2 for ; Mon, 23 Jun 2025 05:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750681159; x=1751285959; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FtS7m+vqlh7Qr+Y7luF/PvAhAhpP9RBj3It7GX3FL/4=; b=CaAcsmHArnAVywA+7kTSniaUsUF/qc7GdNCRYPPfVvF0n3u0dNdKYrzRHFrrJuXz5V Zf9wGCUqZywwdQUT3eVGkcFbpT6tgGk435cxzeQ19/ABVFtaAcElVkcX9F1o1cRkfnTq EnFjaPdSq3kcFRtB4vzJaUglAPrdpfyX0ag1qoJfVLAwgyxAQotIPwqLYBUIOVqb1KUH Tcu9sVz1Z2PrpQy4XplldQ+fGBHc74R9m0s+wEaEDswP0BzpwrPJarV0cbbYKGBJkFxf j0+2OTJMRdSEKq3F/2ttCzhbrQrjjTk9UGIzpYb8vsmk4F3H0byIepYyojbNHFCg5NPz 6u1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750681159; x=1751285959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FtS7m+vqlh7Qr+Y7luF/PvAhAhpP9RBj3It7GX3FL/4=; b=g6ZM+e3WDkVYZqwp7J/Rg8Clv6RXP6SsUmb5Re9RNPl6bC8kRGadnWhycfpFf+6UyM 5KBMWCS0T+ckloa70RN+9DkP4HeKEkxjmZ/zRcYzoA4QQAuACS1XtBtkr4RbWN/PJ2rL xgSkaq5x4AOk81Rz+gykxKFcsNv9K5rw/ZuqLmOVZDRJHlcxJQRJ3GfAMcIu4KKlwuPl GsP9UJ4CfgfMh5055D5qpTfmGMVaa4Bk/eDT3751O7vYHEoQIsbZOEBKFR/yG4UnM5wW TUgZIR0srZMSs4I4QJ3shEf5q9ATFlk6NY6ZRk4voHu0crWKrQmiFmthFX7pg45v+rGR KIZw== X-Gm-Message-State: AOJu0YyFii7nGdjW4+PhDGpgEtorzolqCIwxrxedBxQoPMGSM7bPdJiC SwoaWkmJkNHWfuwoGOS3P6tc0RBEVirWfIyrOKE+8PKIVbj17ihb3ZyjKX6xWrqtgIq5azOe051 pYplP X-Gm-Gg: ASbGnct5Wa4tIbX/Pwj8AZ/5KVYlXcDUBERjZK23WklAbGcU8VCLnfUxVTUobonH6zq p3Dug2/vDyO0wgyO6aQ3KNdq9oo4EGeRbewk6rYm2HLny8dPXYF3xtxnzLNgjOaWOOMSqVwIAxL 8XiVcZwtlItsuN/BNViFveDlyPNXQqViBVPh5OUDleuZ++PbZFi/Y6iNbW0w1hHnVOXT3Ruq5c5 ZSudCw1l96PT3xCowmJKKDKRReU1Q3DQ3cqrW/yiJnhC6kGar+8iMGLjbHPN9i3qGeu28LDpBYK izH3Ohfg4NzGEJ5yUy4g8JyauIslSMfYTrsl9Nf/eVzHKeI26cbOzxV33ymd1+VrZKbUILrlZhF cPnEls+L7CoBZ9F8CUQY65eDZN0XjDrR2tpFM X-Received: by 2002:a05:600c:314f:b0:43d:8ea:8d7a with SMTP id 5b1f17b1804b1-453656c313fmr101273355e9.28.1750681158702; Mon, 23 Jun 2025 05:19:18 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4536fefd2b4sm51673585e9.36.2025.06.23.05.19.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Jun 2025 05:19:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Leif Lindholm , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Roman Bolshakov , Paolo Bonzini , Alexander Graf , Bernhard Beschow , John Snow , Thomas Huth , =?utf-8?q?Mar?= =?utf-8?q?c-Andr=C3=A9_Lureau?= , kvm@vger.kernel.org, Eric Auger , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Cameron Esfahani , Cleber Rosa , Radoslaw Biernacki , Phil Dennis-Jordan , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v3 06/26] target/arm/hvf: Trace hv_vcpu_run() failures Date: Mon, 23 Jun 2025 14:18:25 +0200 Message-ID: <20250623121845.7214-7-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250623121845.7214-1-philmd@linaro.org> References: <20250623121845.7214-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Allow distinguishing HV_ILLEGAL_GUEST_STATE in trace events. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/hvf/hvf.c | 10 +++++++++- target/arm/hvf/trace-events | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index ef76dcd28de..cc5bbc155d2 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1916,7 +1916,15 @@ int hvf_vcpu_exec(CPUState *cpu) bql_unlock(); r = hv_vcpu_run(cpu->accel->fd); bql_lock(); - assert_hvf_ok(r); + switch (r) { + case HV_SUCCESS: + break; + case HV_ILLEGAL_GUEST_STATE: + trace_hvf_illegal_guest_state(); + /* fall through */ + default: + g_assert_not_reached(); + } /* handle VMEXIT */ uint64_t exit_reason = hvf_exit->reason; diff --git a/target/arm/hvf/trace-events b/target/arm/hvf/trace-events index 4fbbe4b45ec..a4870e0a5c4 100644 --- a/target/arm/hvf/trace-events +++ b/target/arm/hvf/trace-events @@ -11,3 +11,4 @@ hvf_exit(uint64_t syndrome, uint32_t ec, uint64_t pc) "exit: 0x%"PRIx64" [ec=0x% hvf_psci_call(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3, uint32_t cpuid) "PSCI Call x0=0x%016"PRIx64" x1=0x%016"PRIx64" x2=0x%016"PRIx64" x3=0x%016"PRIx64" cpu=0x%x" hvf_vgic_write(const char *name, uint64_t val) "vgic write to %s [val=0x%016"PRIx64"]" hvf_vgic_read(const char *name, uint64_t val) "vgic read from %s [val=0x%016"PRIx64"]" +hvf_illegal_guest_state(void) "HV_ILLEGAL_GUEST_STATE"