From patchwork Mon Jul 11 13:57:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 589353 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:bb16:0:0:0:0 with SMTP id jd22csp3277641mab; Mon, 11 Jul 2022 07:06:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVlf2E4PJEJe9QoswkaJ4pFQxVudlvQnh1FFQzCtLIVLLxNplgIUCb67o0lp1JhpQoiEK7 X-Received: by 2002:a05:620a:cfa:b0:6b5:684d:38c5 with SMTP id c26-20020a05620a0cfa00b006b5684d38c5mr10084663qkj.1.1657548391214; Mon, 11 Jul 2022 07:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657548391; cv=none; d=google.com; s=arc-20160816; b=CkEiRrHhWuhXtOGh6lqDtSWoZkHKDdTtDMG5TC0BxbbmeDco2zsw11OE8/JxzdXxoV v575tEq60QzJD86YC6ugjgpzHgve7q1zayNJREm5dTw9P+ApOlJ53Cwy1JPCs+6uScSD Bd6EQ42T4KQVTG94JvhFmlg3C+Izj+q36Zg8kAq2kAUDZeyBlIudcRlJK1YKueU+s6ZZ 1G3xa2GFo1kx+laiOboJrBE6oyblS0UNMy1Ini+Frhl04SPHXnsOqMGIlLhWUhJ+sjHx esaDnP3x4s59N1tye12asHKpxv482TN52kwjmckgfxluW1vMqOqbfpc7ySj3XlqWzQtH 3UtA== 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=arOhUrEykX6T/wdn4c/Rfw9Py5CnhEHkSl6mPSXt/2Q=; b=bzc3Wv7h1npoLjn/BPONoe9AUjp0LFlS1VRK7Na5B8O0HuFrx9lv084ZreuT2NYNRu aLjIS800kaqrpSM5Ruhhp5fugwlCzzcCxVM3bvewVPk+QwHVcxwHHzATLnm2Zo4NIH5y H8xl15Lyy1+UMoxkXXGdWaor95fLnK7hlKdmGltHOlAJNuYoW6vXGTaaX6qDuJvdTLVB cS3Y9uKjpDsRPMfmbyNtDjSdgd1NdxLq6Lrg/ZpzQZW8I7qWPzu52xTfysA8lcczdO8x TPkd1Crwz3yc71Yj7CbItFEFq+g1nVZmyE3GmCBzaDTBNV0nvKzUQh79OFEpEdtf9oey Kopg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PtyIRllw; 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 e18-20020ac84e52000000b0031eba97a167si411090qtw.775.2022.07.11.07.06.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jul 2022 07:06:31 -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=PtyIRllw; 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]:53202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAu3S-0007M9-Kx for patch@linaro.org; Mon, 11 Jul 2022 10:06:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAtvQ-0006VC-JJ for qemu-devel@nongnu.org; Mon, 11 Jul 2022 09:58:12 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:51890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAtv9-0002fb-5R for qemu-devel@nongnu.org; Mon, 11 Jul 2022 09:58:02 -0400 Received: by mail-wm1-x32f.google.com with SMTP id ay25so3094421wmb.1 for ; Mon, 11 Jul 2022 06:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=arOhUrEykX6T/wdn4c/Rfw9Py5CnhEHkSl6mPSXt/2Q=; b=PtyIRllweAUM8WqX0vdd4hE772d1r05p/MFAAdP5qCGfrPB/vUcBWCIV7RQHT0Rx/4 kDgPpAh/xvIoGlcZpN6nKewUyUP8y8oaRJRHRq8MYgwAu8u3ZGuNzHkD12Lqg9EGwuhT KNxcGYTD2qxnufhszxZPwqTw2D+dy1e8Xdy80BHJLAPRqnYK/Aek/I3MnBIDlBJYxKrD XkJ7IMV3ag6a7c86nSywtJhp8Bu3lDV1rtuC+/Gclp0VQUpa7n0Z4TC1UoHgGLabPXg7 Sm6WMSa6CJ4ViaT721dSHV5/3mFMjSD91DbGx7fdPeDYHA5vcHG3WuJ1Rm13CnwoZhPH 6z3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=arOhUrEykX6T/wdn4c/Rfw9Py5CnhEHkSl6mPSXt/2Q=; b=vqBOBVJXxcpCXNve4LQ0/yjMJ9G+v2z35EwyNiaBW8y8mOGoqXRZ8hMvdngGLYkgq3 UZVkvhA5c/iGHMurD4Qwep/M92Mlc8bfjaxEGvv+UC6SQz0r7MmleVi9p7bK/rM4zKvW VTeSc0x900LOil68VyLmiWNVxrMDAWzZfa1VKlAVYjQjwJyw/wtu06Pb/y7acL3SWtrV ZB2T07OuExnmETtE2gFf5tVkaZUX8m8mGHsrA88pADNd48KUD7Kcpuj5fvkc0XsjgzQ9 C+iDSrw/W8Z+5otONdVV2r6oTAClwuDy9akzXtrP2kOyZ56sgObrX3tZ4gq2bvdww+O9 dauQ== X-Gm-Message-State: AJIora8RoyvfTY6g8CWKdAA5enz72xwuzwq4i/be9T1D1HU9Iwe2j1XS FWk2YiZoAlM1jTjY/xywl8o2QAWI7Xu78g== X-Received: by 2002:a05:600c:4e07:b0:3a1:8548:4dd7 with SMTP id b7-20020a05600c4e0700b003a185484dd7mr16441021wmq.170.1657547873710; Mon, 11 Jul 2022 06:57:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q123-20020a1c4381000000b00397402ae674sm7595596wma.11.2022.07.11.06.57.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 06:57:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/45] target/arm: Handle SME in aarch64_cpu_dump_state Date: Mon, 11 Jul 2022 14:57:06 +0100 Message-Id: <20220711135750.765803-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220711135750.765803-1-peter.maydell@linaro.org> References: <20220711135750.765803-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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" From: Richard Henderson Dump SVCR, plus use the correct access check for Streaming Mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220708151540.18136-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ae6dca2f010..9c58be8b146 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -878,6 +878,7 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) int i; int el = arm_current_el(env); const char *ns_status; + bool sve; qemu_fprintf(f, " PC=%016" PRIx64 " ", env->pc); for (i = 0; i < 32; i++) { @@ -904,6 +905,12 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) el, psr & PSTATE_SP ? 'h' : 't'); + if (cpu_isar_feature(aa64_sme, cpu)) { + qemu_fprintf(f, " SVCR=%08" PRIx64 " %c%c", + env->svcr, + (FIELD_EX64(env->svcr, SVCR, ZA) ? 'Z' : '-'), + (FIELD_EX64(env->svcr, SVCR, SM) ? 'S' : '-')); + } if (cpu_isar_feature(aa64_bti, cpu)) { qemu_fprintf(f, " BTYPE=%d", (psr & PSTATE_BTYPE) >> 10); } @@ -918,7 +925,15 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) qemu_fprintf(f, " FPCR=%08x FPSR=%08x\n", vfp_get_fpcr(env), vfp_get_fpsr(env)); - if (cpu_isar_feature(aa64_sve, cpu) && sve_exception_el(env, el) == 0) { + if (cpu_isar_feature(aa64_sme, cpu) && FIELD_EX64(env->svcr, SVCR, SM)) { + sve = sme_exception_el(env, el) == 0; + } else if (cpu_isar_feature(aa64_sve, cpu)) { + sve = sve_exception_el(env, el) == 0; + } else { + sve = false; + } + + if (sve) { int j, zcr_len = sve_vqm1_for_el(env, el); for (i = 0; i <= FFR_PRED_NUM; i++) {