From patchwork Thu Jun 19 13:13:05 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: 897976 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp814816wrb; Thu, 19 Jun 2025 06:14:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUi1s3LeafpQGWNAuM0M0OEKZ2aUnNhFM6BZXFqytn+PB6x3g3o7OUjInPxiU+QkfYh5keuFQ==@linaro.org X-Google-Smtp-Source: AGHT+IFlsHpS2P1WmCx3pAYjVM+1wKBLkIFYzcUqpEn4LwcrUA27bUmu87LwihSaRwuxbet6wrJd X-Received: by 2002:a05:620a:472c:b0:7d3:ed55:c53b with SMTP id af79cd13be357-7d3ed55c5b6mr627474485a.11.1750338875476; Thu, 19 Jun 2025 06:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750338875; cv=none; d=google.com; s=arc-20240605; b=WD7lzgz17Bggfc+rDHBZMVbSYw2i5g+rC4tYItOjVlvHv4VhHZBURYLQCZT5mBJgm8 jDWe2URvuxah9qcuIWcZ9b1IUgMXmU7vqH/Nb3WSMq6VL7KD7TTRN4cL8g4G6R782ydL 0g9+z6qbVOJSrAgd60werM/wiGx4ZpNtVlZzIuKQ6tTrFd0JXxlYVgY1BvzqeIy8I+uY tf19TIWp3W57O3o7pGPtK3TQ+6IUQaOcmdYFrc2mtfslkaE90S2Tdpa80bBLj1ZpV3hE 6nbSD1cBH+qfpFI9LljSWxolN709NcsjqUDTa0fZPwQkU4spZgugSlGBNIDnw55ND06n OPsQ== 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=UyPjw/EICSj11C7UIftsbx9d+1RqLVuFlx6cdDbkp90=; fh=HMBMEYbXwbwG+LSk9/wtQ+/LHaozQ4G5WTAv5SKNxMo=; b=JUbehX7d+bTnEXNO0zmrg8NkjkV2ZyCo0L/6o8ZkJyyKyTx0+6GmE+Gu+62YxvP7bK QOJGN8yPlQ4YmOx8oEuNGJ5U4A6audq988HnhnGGbdrH9AIEP78M7bklLwQAgWeLOUmL O4Q9TRgyt4MZ5x3oo/7qeh/RDjxE6OlKNsfHDbGwK04dfCSBdZHEHe0fZ0PTSPFTPdGB xYAa4GokUjv71EOPhWNCSJJKrI0UOWjNAEvzxjWtfSDcUO+6vYrjsMMlRKW39Xr8sXXk Dx6xMPTnkMk7QWUXS4u52RRO5M+ljCKYvlZ5KyvsFyarMP+Ps8vmdW98XjioFbzS1SIR U6qw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gr6+GD5+; 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-7d3b8ea7f10si1628525385a.224.2025.06.19.06.14.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jun 2025 06:14:35 -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=gr6+GD5+; 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 1uSF5k-0003eZ-91; Thu, 19 Jun 2025 09:14:10 -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 1uSF5a-0003bm-9v for qemu-devel@nongnu.org; Thu, 19 Jun 2025 09:13:58 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSF5Y-0003us-J8 for qemu-devel@nongnu.org; Thu, 19 Jun 2025 09:13:58 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-453426170b6so11657685e9.1 for ; Thu, 19 Jun 2025 06:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750338835; x=1750943635; 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=UyPjw/EICSj11C7UIftsbx9d+1RqLVuFlx6cdDbkp90=; b=gr6+GD5+OH3NlGnZnhU47urC5+DZB3m5ANhI7H5Ie6P1oBz64tpfPjizGD56sO49wb V08g53PAVJUduO29g3NmvLYwzlSOUq4aKph9ByjYn1lBcMWk2Am3RynaVVCFgCcXVhX6 bWKYl7K3hBINvku/pSvgiWOuKS9Z3FhmeVlOmwp2y/ZwNS+TD6WGdKxT74ZZEXX/3Pn1 3j7gP5ZhrvssGtW5QCa0SbXG7gD1oFx3SeFYoHVckl12olUSBVvAtApvXwwVfDYL176Z PUtvPLeJh0L6MttbAdD+pizk78iXNXrstKW/Cb/rPkdWWZW9MzDSOyT+PwjvmSyJJNfc /B+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750338835; x=1750943635; 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=UyPjw/EICSj11C7UIftsbx9d+1RqLVuFlx6cdDbkp90=; b=OElqdxpnMvQQoopYs3+V1rUfUJBdLzvfUZgoSwDKt+wAO4yHaFjd3R0cypAw8qISUm 2Dvb7Kx8PcYsVfHlxt1mbL93ib/OMdN/bcDF6FxI4JU9nCauzUQUHWCHJ/84E0iS7Bk6 LtFhXh40q+JqlndrKz8dMHgNSc+RHrfljXUSqWtzKGgDIHUaXZG0t70cj2tlJKkMrMLn fFjPGIQzzUoW8hLxVrUDOVRA/cYx2oyyx5Xsl8COfCFcQWySsduUKjb3b1yB5bMQtxFC O+U8S6gBx3fEggtIo9QcM1WQwOnv5U8C/n9ueX7U8zoXaQKZVCLzvvXe54t47RAAedAK zp5g== X-Gm-Message-State: AOJu0Yxz3ng2H40ssaQHP3svFkiiFPn9JUbWVflnnwaX6eBX1DBmhto8 gphi2EIJrNXehWVEjL2vicNr42CIQLDVwor2ENYO0wpMPErJKyTkClbAnhgriuR6qisx6uME+YB 6yX2YCVw= X-Gm-Gg: ASbGncuYxy8i6zti0l18IpxFF9Rmy5SGNv3yjHNOVmRLSZC+9rPtHCTeEJZnoyVIBQk e1cFvShkYchNj//b1+QHbikembxl5otfj4e2JMnvhl+sxpA+hPj1qZlquTtYzo1VtT0BaGVY62z 9tpKMynyJXDYhO5ENeKcY5Ptu84BhgZPKwt0sfqyERDXa9KGz9zbw2qT9oNv0WoD/lUu0tle4MC hyz0CjrkUEywu4ukDUQCbEs0LvoHk70sTd8hdrXqUGDM5pehpx1NoMtwVt0LiJmDCL8mqUDJmr+ DDQHc1lqggh02rpxZlvur8bx8sIM2q7h4TlAtUvhRysFcvI8hivlGwcE0Y5mfhetLetk+JarSCy Jhrw67N4WcdJkOoBmezlwNg6i7LOyJYHm6IUq X-Received: by 2002:a05:6000:2210:b0:3a5:1241:afde with SMTP id ffacd0b85a97d-3a6c9692af0mr3671381f8f.9.1750338834779; Thu, 19 Jun 2025 06:13:54 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b08c7csm19792341f8f.50.2025.06.19.06.13.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jun 2025 06:13:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cameron Esfahani , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Julian Armistead , Radoslaw Biernacki , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Phil Dennis-Jordan , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Daniel_P?= =?utf-8?q?=2E_Berrang=C3=A9?= , Paolo Bonzini , Peter Maydell , Leif Lindholm , Pierrick Bouvier , Richard Henderson , qemu-arm@nongnu.org, Roman Bolshakov , Alexander Graf Subject: [PATCH 06/20] target/arm/hvf: Trace hv_vcpu_run() failures Date: Thu, 19 Jun 2025 15:13:05 +0200 Message-ID: <20250619131319.47301-7-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250619131319.47301-1-philmd@linaro.org> References: <20250619131319.47301-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 30dfd97bebf..1ff3ff7b91a 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1914,7 +1914,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"