From patchwork Thu Feb 13 14:41:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 183384 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp636415ile; Thu, 13 Feb 2020 07:07:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxefDFdMDXznSaUYwy/cvlq8UA2Yi4Z0L3zARozt1DFdmNqlzYxvVTZzm04E3PQibtroiL1 X-Received: by 2002:a37:a7c2:: with SMTP id q185mr15247441qke.97.1581606467277; Thu, 13 Feb 2020 07:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581606467; cv=none; d=google.com; s=arc-20160816; b=nUUVY/VTLXRtLxTTnCFTiUX4I1rcgnXzt5YMvikCHm0TVQxph+yCkOTltfIfvg65F8 RZhgYTXfJhLwpl4WVnToss4683rMVujbpAhy0OMWRnIZY2u/AcYU+euQ14jHJRetma4S jVeShGT0WXQA9fSaAEaIUP4a7DiYQCRoADPnQwAfdHQqeYbIj4diy/aiNjiqhLD46L4t wD6lUVd2ZUphFPppms/e9VeDgvoAotpur/2kzCWPYoxzVWocTAty9tldjOxAEKdAI7Zb Yu9E8WksdFEl91pTug4xVxhp4DXEvS2d8b1pD+jjXza9R5T2qJyFAV++dOSHWSQnYfhH nIIQ== 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=9tFGVjt/GzRfWPBxkYgLYTC/HKT0pYq/v3Uvgjdh4bY=; b=GzIwug+DcM8oVVGv7CyUiHxG709t3Op/pcxvYVrURduL6ncr2HFJp5lxCBShSnVNTF Ge00G5B0LV/rLS59OPA4rW1o6lf8KS/B7sl/kIuv5SwMu55ym+TTSXNzyDNOCuU9m/Xp vkxb+XfzHSgzyvZdvBnS4x0hG8o/P+ZiPjiEiXu/6CMkdcIEpfURedV3tPoKndcx95Dd KQ5IMcFCEa8C3FHGcANnKQ9+D/f6eb0MyjwY5tJ+YMYTl8CoRWZvSGS8HfDtQ0BhV3Wx pmDnizhLJlcGraafEBV//veA4hDhoHNvAf7TaYyHAx+sxNQOmnNNu1ZEIt+DFeYQAitF z12A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uIqpCsoD; 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 v5si1255581qtp.106.2020.02.13.07.07.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Feb 2020 07:07:47 -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=uIqpCsoD; 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]:54278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2G5i-0003Dr-Q2 for patch@linaro.org; Thu, 13 Feb 2020 10:07:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60278) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2Fgy-0004PX-Ga for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:42:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2Fgx-0001tm-Be for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:42:12 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2Fgx-0001rd-3C for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:42:11 -0500 Received: by mail-wr1-x443.google.com with SMTP id r11so6955866wrq.10 for ; Thu, 13 Feb 2020 06:42:11 -0800 (PST) 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=9tFGVjt/GzRfWPBxkYgLYTC/HKT0pYq/v3Uvgjdh4bY=; b=uIqpCsoDSFdkQayU1x2GtBIFGQRt9/4V1wxrfmdz8r6qRzPyrfp8SAvaHhDP8e0HCi 3g7kAZW6KkiRvqo9BG7Bxqp2gxjAAYqYtLliZFBNecsaupymtrQWIsBlbPo+JhZEfA1+ WBq4AjvNhVSLhv6UtUZM8RyiJ+uKz6Z0QsfoP9rOoMUyKoEW5XwYpMw4s4pIWRTCmxkB 74pFnwfRxyQsZ7yD0WJUwjVPEbH8MovdnqRxpWoTWMSUZ3p3kfqmmmo9qXulha3XvbOV gpa+9HCZkVhq6duazP2szy5LCDxAQ2PVbVrPCktnrmuw/IzveMUPyQ4RVdT90iXpcaiJ x2lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9tFGVjt/GzRfWPBxkYgLYTC/HKT0pYq/v3Uvgjdh4bY=; b=LkEwlJQzlIkArm0SzjGYnps55f5EGRV5qJUI99Z4dtSlH1eFBUJN5QCvGjbtYFaKmc mIX36I8nCmfE+4+fbHxGvjNxas3FEWLbbGm1ItxIEDAQw9VCZ4L4j66YuxfU2WexPWsa 6Hwv0EfboRAfvvttrj+7D/t3dd3FH6Bag360lpcFpq4ulj/99TwBcw0OuMfIYk1DLef3 4yw7/vOciKJ4LfopGQbSNHf0V6Mjer9OlQDZ56HMljm9ZTHTzca7pEqBF8q78l2oDXLh 2d55ONl5izSFFjKRtsM/Vgt1S1Jwcnskp065PiLDnJ5eLrj3/e+clIlSpElbVS8ZqFaH MG4w== X-Gm-Message-State: APjAAAVlI1oePs1vbFo0fffm4cXcQdR2tuRW5dkZEePjBehjAketqBEV PmNtav+tsKJ2yLG8szSy6gSknuBN1EQ= X-Received: by 2002:a5d:4fce:: with SMTP id h14mr24014325wrw.60.1581604929740; Thu, 13 Feb 2020 06:42:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id e22sm3362454wme.45.2020.02.13.06.42.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 06:42:09 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/46] target/arm: Remove CPSR_RESERVED Date: Thu, 13 Feb 2020 14:41:17 +0000 Message-Id: <20200213144145.818-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200213144145.818-1-peter.maydell@linaro.org> References: <20200213144145.818-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 The only remaining use was in op_helper.c. Use PSTATE_SS directly, and move the commentary so that it is more obvious what is going on. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-id: 20200208125816.14954-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.h | 6 ------ target/arm/op_helper.c | 9 ++++++++- 2 files changed, 8 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 694b0742983..c6dff1d55b6 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1186,12 +1186,6 @@ void pmu_init(ARMCPU *cpu); #define CPSR_IT_2_7 (0xfc00U) #define CPSR_GE (0xfU << 16) #define CPSR_IL (1U << 20) -/* Note that the RESERVED bits include bit 21, which is PSTATE_SS in - * an AArch64 SPSR but RES0 in AArch32 SPSR and CPSR. In QEMU we use - * env->uncached_cpsr bit 21 to store PSTATE.SS when executing in AArch32, - * where it is live state but not accessible to the AArch32 code. - */ -#define CPSR_RESERVED (0x7U << 21) #define CPSR_J (1U << 24) #define CPSR_IT_0_1 (3U << 25) #define CPSR_Q (1U << 27) diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index acf1815ea3e..af3020b78f8 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -387,7 +387,14 @@ void HELPER(exception_bkpt_insn)(CPUARMState *env, uint32_t syndrome) uint32_t HELPER(cpsr_read)(CPUARMState *env) { - return cpsr_read(env) & ~(CPSR_EXEC | CPSR_RESERVED); + /* + * We store the ARMv8 PSTATE.SS bit in env->uncached_cpsr. + * This is convenient for populating SPSR_ELx, but must be + * hidden from aarch32 mode, where it is not visible. + * + * TODO: ARMv8.4-DIT -- need to move SS somewhere else. + */ + return cpsr_read(env) & ~(CPSR_EXEC | PSTATE_SS); } void HELPER(cpsr_write)(CPUARMState *env, uint32_t val, uint32_t mask)