From patchwork Thu Aug 9 04:21:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 143659 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1603899ljj; Wed, 8 Aug 2018 21:25:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxAoDySUqROiaR48rzCCSDmEVfMpwBsJNwuucmFTVLM2Vr0dQVnk7JcI6wnfKKVzBdik0NA X-Received: by 2002:ac8:32c7:: with SMTP id a7-v6mr493913qtb.26.1533788732353; Wed, 08 Aug 2018 21:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533788732; cv=none; d=google.com; s=arc-20160816; b=TeiuH1CY/UdBUrtmCGOmOEs+zTbSMO9HxFYyMG7BJFme59idJLG9CgTfOYvAcHPShJ /zhfoK42QKGLbXCiy1eXx2oJ1WZRU0XGs7JZrBRNyYjkO043xfne0vvgGe+ti0qKZDji L9yFiGlD0VYVhS2itEGbUbubsIAlNM/46NDpdyAUfZov/oC9oX/P9VPqklcAO9NXuflu d5KSUq/hUCmuPgq1YG+0goROv+SV+9eEgpJv6IiIimx+Ae2iZZQMxGp66rUwjrehRXqe FaS2qimcLPKU351SkBPJNbtBPhWAvzjxTvXtIQQHOw6Y334zJfDoa8Ub4ifVa/iIEl6i /R8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=LD/vcIqlnO0xpD+E8Q45wGd4xiipQg1fxpSpB81mnec=; b=hG7kQL6AjBw4rpnOvYvYMToFZnZe8yQSQdZ8lb2n3FHG6iOxQedCGfwQkGOriRtuFk XzBw+50Oa9TeTYao+6d9n2JdoaG90cYGy3R9Ccb4/Gp4BBHaKpCoUOdgjaaTckZlCruy svj+fVaCCCUeXVNuJXovm7LHas7n+LpfzDz4v2zuZLpWzowczOSuvZ9usEBaFvNBjbuv 5Jy8Zd1USt4QkQuSGMRdN+aFChuhb2gzITNaOnEqr+VAPWa8GwrTnPPb7djndUIle5Vq t/1T9COflPllL9Ssm4LvZ6/g1R8dRe8sJJr6svzdUOVI5SDj7rhvfZ+JTj3fzfn1SmfN wx6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MwlTbhUN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n19-v6si1069998qtp.63.2018.08.08.21.25.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Aug 2018 21:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MwlTbhUN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncVv-0003Ad-NV for patch@linaro.org; Thu, 09 Aug 2018 00:25:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncSp-0000lX-Av for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fncSo-0007D2-HH for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:19 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:44953) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fncSo-0007CK-Aq for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:18 -0400 Received: by mail-pg1-x529.google.com with SMTP id r1-v6so2099238pgp.11 for ; Wed, 08 Aug 2018 21:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LD/vcIqlnO0xpD+E8Q45wGd4xiipQg1fxpSpB81mnec=; b=MwlTbhUNMbEESZq4YrbjKtslfLV9VhF8S7+hkvSKE9yAc97G/UDoqb4yL5UQ5K15Q/ rP7S5nqWuQf64FzbEbeBKnC6MIy0dBzjBb6eJiKs8OFbNGV8pWpaPOjzIkKZgRX+SCg+ aczV57JKf+66ORPSB8s7+vaI0K8gLG9nG2tZo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LD/vcIqlnO0xpD+E8Q45wGd4xiipQg1fxpSpB81mnec=; b=Gs6WzZxbFyeQLnSFlxwnjHRo9KqNPeim7EabC8vozJaTvsrDTCJ3qDA7cF/kIdA1P3 d8xZdoizPThKvuqVfVmC0+HEIxfcRn5HfgOqrzmsFKnptamN0N5ZDEvDNZTw6fApMzx4 igpVFpjKtKrgpPPqmjyQVgLX2jkHzurwBf1+WJy1Ae+6W2j8i+f84aEtcf48eayHayLL 0xw4E+8vEAzpH04o8uEQmY70Bd1Y0n11kdomBqzMxDvtxOyUBpm0KGOtrv8Mnik4Qr3K g03EOSC9Np3FLHVYDHIsZjRU8TM8htKWeiJaHZMOtJ0Wfo1Kx9NTjWLecWI2vvqjrKpI EZ1w== X-Gm-Message-State: AOUpUlFDOkBzHY0OevCw1FRJew5QZ4ZYQT9hN94EHNNMVfrxAQtxlaUU Xx3SETAiFK89T9tZhKS4OcymGTGNDcc= X-Received: by 2002:a62:4dc1:: with SMTP id a184-v6mr565653pfb.5.1533788537140; Wed, 08 Aug 2018 21:22:17 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id m30-v6sm7355799pff.121.2018.08.08.21.22.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Aug 2018 21:22:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 21:21:52 -0700 Message-Id: <20180809042206.15726-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809042206.15726-1-richard.henderson@linaro.org> References: <20180809042206.15726-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::529 Subject: [Qemu-devel] [PATCH 06/20] target/arm: Fix arm_current_el for user-only X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Saves about 12k code size in qemu-aarch64. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 2d6d7d03aa..aedaf2631e 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1958,6 +1958,9 @@ static inline bool arm_v7m_is_handler_mode(CPUARMState *env) */ static inline int arm_current_el(CPUARMState *env) { +#ifdef CONFIG_USER_ONLY + return 0; +#else if (arm_feature(env, ARM_FEATURE_M)) { return arm_v7m_is_handler_mode(env) || !(env->v7m.control[env->v7m.secure] & 1); @@ -1984,6 +1987,7 @@ static inline int arm_current_el(CPUARMState *env) return 1; } +#endif } typedef struct ARMCPRegInfo ARMCPRegInfo;