From patchwork Sun Apr 23 17:08:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9694917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9DFA860245 for ; Sun, 23 Apr 2017 17:10:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 843CF26530 for ; Sun, 23 Apr 2017 17:10:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7785C267EC; Sun, 23 Apr 2017 17:10:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F79C26530 for ; Sun, 23 Apr 2017 17:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NE0nromaEM9myi5qfZcUA5Cg20cIg8uUmFRR89fdZPU=; b=CXc48WdoWjwnPesZNQhozGYG7+ zc+a4/kOIanM6qI1KS9QK8TLp8pbDW9TfODkFSoA9dPh/o3JPIZODVsQKNFkixvdOu/jODrw8mrjN wkXWruwzx8Ha+lRY2IXPVNrZKYY8XvWO70iFlmtCioNc7Jx2VaNlLTIx9a2D+Dyuu6Dzft6zVRA55 NghijmViM9FBMJFEfoNWEMkqwQJ2hshtPcggxv4cjmy8v6ZsFDk/T4CrocuRVt0hjL1RbT8EUnAY5 C0OPY2z2WxYIXTxO04MJBtK3i0cXvPXjdhuh/ILJXJ/xKTQYeFCBAcqJ1juxHFer9uofQ1hDkJywY RWO82ipw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d2L1I-0004XK-0b; Sun, 23 Apr 2017 17:09:56 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2L1E-0004Gm-7Y for linux-arm-kernel@lists.infradead.org; Sun, 23 Apr 2017 17:09:54 +0000 Received: by mail-wm0-x22f.google.com with SMTP id m123so50330792wma.0 for ; Sun, 23 Apr 2017 10:09:32 -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=/8ThtQqUqtdt76e8AoPewqCX0F6gMjQa7PStdJq+t/E=; b=YlWF+lrh/z60OsPSxbz1ZD8zTM0HQmyxOKBTvfybuOlfj/U2EUBPr1aZMyIZSyp9Dg OQZh48Glm0VNebN80HR6Ih8+umsjgQfBEONOkB/aoxMIY/tqfQU8YsEfrAQrvsho9BKT uWg2Ku/AVrUyun+HQS/xG6Gu+KSPqnvhG/640= 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=/8ThtQqUqtdt76e8AoPewqCX0F6gMjQa7PStdJq+t/E=; b=uhtyTYcmyLCOJTCHijynwRGG/nHFFCIh03jHyBWsDraF1H4g+ho+y6HGlBMX0LKK6p 0PA6gj1xtadiRgeLbtdj3ppEpjifY+ASh6vC6VbgV7/O5nZvhSy4mll/P5hoU63Up/En wK74n+C+1/Gs8WuRLnmmy62A2t+2bXNuNcWxiICGvzyzANLeocdMfszxrm/9KVbkH7TX 9DDgoNw4bbxczMoNmpWYsCCmfb70drpLMLbdbtz++44NSGJMEnxgMmHMI3RgOuzZxM8N 2gQKVor6eRI93ctIfHNKQHF12BnR0hVKCP5pQ5jG5kBHgfT0G1QF2Ii99qGXt8I8Kdx5 vV7A== X-Gm-Message-State: AN3rC/5IvZxwzL1hrOR7x3np23XehuSW/U1QYUnZ803JzPWZePj2Tw00 H+SRdIkVGA5LZ6ZX X-Received: by 10.80.163.146 with SMTP id s18mr137656edb.107.1492967371190; Sun, 23 Apr 2017 10:09:31 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id 58sm2803521edz.2.2017.04.23.10.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:09:30 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 01/79] arm64: sysreg: sort by encoding Date: Sun, 23 Apr 2017 19:08:11 +0200 Message-Id: <20170423170929.27334-2-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170423170929.27334-1-cdall@linaro.org> References: <20170423170929.27334-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170423_100952_424578_536DF4F5 X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kvm@vger.kernel.org, Suzuki K Poulose , Marc Zyngier , Catalin Marinas , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mark Rutland Out sysreg definitions are largely (but not entirely) in ascending order of op0:op1:CRn:CRm:op2. It would be preferable to enforce this sort, as this makes it easier to verify the set of encodings against documentation, and provides an obvious location for each addition in future, minimising conflicts. This patch enforces this order, by moving the few items that break it. There should be no functional change. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon --- arch/arm64/include/asm/sysreg.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index ac24b6e..e6498ac 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -81,6 +81,14 @@ #endif /* CONFIG_BROKEN_GAS_INST */ +#define REG_PSTATE_PAN_IMM sys_reg(0, 0, 4, 0, 4) +#define REG_PSTATE_UAO_IMM sys_reg(0, 0, 4, 0, 3) + +#define SET_PSTATE_PAN(x) __emit_inst(0xd5000000 | REG_PSTATE_PAN_IMM | \ + (!!x)<<8 | 0x1f) +#define SET_PSTATE_UAO(x) __emit_inst(0xd5000000 | REG_PSTATE_UAO_IMM | \ + (!!x)<<8 | 0x1f) + #define SYS_MIDR_EL1 sys_reg(3, 0, 0, 0, 0) #define SYS_MPIDR_EL1 sys_reg(3, 0, 0, 0, 5) #define SYS_REVIDR_EL1 sys_reg(3, 0, 0, 0, 6) @@ -118,17 +126,10 @@ #define SYS_ID_AA64MMFR1_EL1 sys_reg(3, 0, 0, 7, 1) #define SYS_ID_AA64MMFR2_EL1 sys_reg(3, 0, 0, 7, 2) -#define SYS_CNTFRQ_EL0 sys_reg(3, 3, 14, 0, 0) #define SYS_CTR_EL0 sys_reg(3, 3, 0, 0, 1) #define SYS_DCZID_EL0 sys_reg(3, 3, 0, 0, 7) -#define REG_PSTATE_PAN_IMM sys_reg(0, 0, 4, 0, 4) -#define REG_PSTATE_UAO_IMM sys_reg(0, 0, 4, 0, 3) - -#define SET_PSTATE_PAN(x) __emit_inst(0xd5000000 | REG_PSTATE_PAN_IMM | \ - (!!x)<<8 | 0x1f) -#define SET_PSTATE_UAO(x) __emit_inst(0xd5000000 | REG_PSTATE_UAO_IMM | \ - (!!x)<<8 | 0x1f) +#define SYS_CNTFRQ_EL0 sys_reg(3, 3, 14, 0, 0) /* Common SCTLR_ELx flags. */ #define SCTLR_ELx_EE (1 << 25)