From patchwork Thu Jan 11 11:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 761819 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2337393wrz; Thu, 11 Jan 2024 03:10:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbfq2Z1QUfYr31r0ww5ECRW9ijJ5ccywm0SZ43XSgYQzO0/lUegX1+cGPCYSL3pcFHQwfv X-Received: by 2002:ad4:5dcb:0:b0:680:d280:c4b4 with SMTP id m11-20020ad45dcb000000b00680d280c4b4mr684082qvh.24.1704971432457; Thu, 11 Jan 2024 03:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704971432; cv=none; d=google.com; s=arc-20160816; b=il6kLBoBKfnUAfiUgwT4N4wdWR8DOORZHJrVFY/KaYTBPHBU8FxufcHE5efVjpUcru qaRlb1tOR3AHAKP5VE56ZdUX2/ouL+bRouPbBPKk5TqEv28QnUyrf8jefEDPu1mYzrwM waOLCpFEnxNLXPzOxMQOVWLwjf4zEFDu8C4ssErOsphbcJI2+6SSF+UriRi+3Qq4lQYS iRi4W9L9ypLU0Ms76ScXDtt3STNh2XdyW/UT8WWJoJm7IkF5uJK6mKsffoU2NgDb2BKy e7LHexQpHP1s1OhUkLFtN1Hb5cksJpbzPQKec61LUEJaA5y0c1OjmXaMGGydA6BZMGW7 sKtQ== 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=1O9OPo4rv9t8UJdjCTvrRPzHe9Vt4uLDECv1wcuWN70=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=NUQkNru3/z9XNsbSS1UG9Y6OKiJjjPUe8OV/lt5HGnqFh9stbH76G/F35oeMx2KaYZ nNzsciAm3eSmZV6ceVn/OUAChTtzceWWzVIiXX8SLD+W53AmdrWkD/3F/MipPHG/RZzs h8jg9DpRlJfwSM2nA20DqdrS/e+ocEWwyKOtxMFC1M+s9xvGtZdegDZ/C894SaM04fFw l36j3QCWTMG+zYWw6ELd6h+vOqdPox9oGJApoYDHtzMvsIF1NOJ7ZxodXRvGB8721XQE NXihWOK2jyWFuTpBHfDfjGFO3bSm49x5RvsmGlQAxgFtIYfcQBFqvrjiuOuJeKROpHbl XXDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wMDNaPuj; 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 w15-20020a0c8e4f000000b0067f02b93d86si582815qvb.35.2024.01.11.03.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2024 03:10:32 -0800 (PST) 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=wMDNaPuj; 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 1rNssW-0001Rn-3t; Thu, 11 Jan 2024 06:05:41 -0500 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 1rNssN-0001PU-9N for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:31 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNssH-0004Yh-V8 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:30 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-336dcebcdb9so4808302f8f.1 for ; Thu, 11 Jan 2024 03:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704971124; x=1705575924; 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=1O9OPo4rv9t8UJdjCTvrRPzHe9Vt4uLDECv1wcuWN70=; b=wMDNaPujpnQPBfJ9xvfuTuuPAA+YWgj1m3fAwfdt3KDEGAsGHvNReHu9tfE0+tLyXn NwJIc7UIKJm85qNLAUPEEOK13P0Q35555pbBY97tQiQSJBI6T/GfwntnM1YsR55vAyZF RI0ZSRA9p0glZqbcOJdz7LfrOVmGQWlwjqGk2r3ePGdatLQ9FQcj4iHz+pz9fWjQdXiC 5NCtMmeIeuAD6TYJVebJ3CO4BH9q7EzVUCmm+9THB1E5sGj6DuQ6RVtevHkhNxSqnkX5 JrZD78jiKKc9O6pM+18Cw3Wj4Z1pq4O41Cm4H2mPEp8sx2Yo5IgcSPJ9RsNceiNHssaV 8Zjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704971124; x=1705575924; 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=1O9OPo4rv9t8UJdjCTvrRPzHe9Vt4uLDECv1wcuWN70=; b=VzdHbEC3/7oVXKPskWP+Olw4MTLG7XYxu3Mo4yIuwrzj+2DjY4w8lXuoWWBTjBVm4t PmWnDwuBh7DH72f/KZVBibbIDPy6ED1elCc1yMMC9s4KjNSNMykGUupcDHW8MktbmG5d 28V31SOlxReEfgOJvk18JxRUsTrrg8qiua/nXfOuK+/z+dISDKtqtHx9+ZkgeAk//372 5nzhRccvkKjHS9nbxIqJxmoXwWaLmIFlCVjhzvjvCwQSex0I3RLbIkVdQrgz1QZuSw1y pScbpZhfKJ1QLGXBAkbh9h2t2qiTdo4xHR0MYhHk9Wl/CywDlrByGNV7XZCkRRdS0goj EeCQ== X-Gm-Message-State: AOJu0Yzo/KJ/jbl3TZ5uDhXklV5nK+OPhXnYnCghoh8TmSkLjTB2nS62 0IVz9IWoNP91fscp/sAvCalNrKVEukqLdpvXLQR9LRPVdsQ= X-Received: by 2002:adf:ebc8:0:b0:337:4d36:ae41 with SMTP id v8-20020adfebc8000000b003374d36ae41mr265708wrn.35.1704971124034; Thu, 11 Jan 2024 03:05:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v30-20020adf8b5e000000b0033690139ea5sm951323wra.44.2024.01.11.03.05.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:05:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 39/41] target/arm: Report HCR_EL2.{NV,NV1,NV2} in cpu dumps Date: Thu, 11 Jan 2024 11:05:03 +0000 Message-Id: <20240111110505.1563291-40-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111110505.1563291-1-peter.maydell@linaro.org> References: <20240111110505.1563291-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 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 When interpreting CPU dumps where FEAT_NV and FEAT_NV2 are in use, it's helpful to include the values of HCR_EL2.{NV,NV1,NV2} in the CPU dump format, as a way of distinguishing when we are in EL1 as part of executing guest-EL2 and when we are just in normal EL1. Add the bits to the end of the log line that shows PSTATE and similar information: PSTATE=000003c9 ---- EL2h BTYPE=0 NV NV2 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Tested-by: Miguel Luis --- target/arm/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index c15ad52ab3d..7d763786d88 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1059,6 +1059,7 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) uint32_t psr = pstate_read(env); int i, j; int el = arm_current_el(env); + uint64_t hcr = arm_hcr_el2_eff(env); const char *ns_status; bool sve; @@ -1096,6 +1097,10 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) if (cpu_isar_feature(aa64_bti, cpu)) { qemu_fprintf(f, " BTYPE=%d", (psr & PSTATE_BTYPE) >> 10); } + qemu_fprintf(f, "%s%s%s", + (hcr & HCR_NV) ? " NV" : "", + (hcr & HCR_NV1) ? " NV1" : "", + (hcr & HCR_NV2) ? " NV2" : ""); if (!(flags & CPU_DUMP_FPU)) { qemu_fprintf(f, "\n"); return;