From patchwork Sun Apr 23 17:08:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9694981 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 E594A60245 for ; Sun, 23 Apr 2017 17:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD47126530 for ; Sun, 23 Apr 2017 17:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C140B265B9; Sun, 23 Apr 2017 17:11:53 +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=ham 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 5054126530 for ; Sun, 23 Apr 2017 17:11:53 +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=2MHx+62jteGAfST3D/LrsU9Ei/1+balm1NwmhK6Rllg=; b=nyhgbwvYtqIVo79G+8+iYCOHet tEWYvfYYT/qfn3+kSMmtRqAg48jD+e4RV6Kq7r77ToTGvCAOzPY8P8lBmxjh4LUmv35glpVyqEmvW 4NaVyuBgqe0e1noWFFeXzdUbgibgD2FSFlIHdWJDHanB8P5j3FzzVcFjKGpXOWOGPM85D0XAsUXwH fyoldcTMZybobM3PJqwehSPxFo6+/r3pfvCMAao7baILfKXsganiveH38+x30zKO+v6K6lSlBaecc UKvmFEJrBA0Gp49qR3Jo2Ww3he9yc4eZiashTh2Q8CBsRhhNnC9ycKXQX/hByLO34v0WIDMlboOdZ TPj1E2JQ==; 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 1d2L3A-00087O-PV; Sun, 23 Apr 2017 17:11:52 +0000 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2L1M-0004Ob-2v for linux-arm-kernel@lists.infradead.org; Sun, 23 Apr 2017 17:10:05 +0000 Received: by mail-wr0-x236.google.com with SMTP id z109so79238873wrb.1 for ; Sun, 23 Apr 2017 10:09:39 -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=UgzP3s1EUMO3kZDmKHZy1j08m2AZLioIZ7RkJ7x9gqU=; b=QSBUdxEDDTUH+KP/d3U/LNZc9PZKpjBRmaFepdxaETXwwzdzRZE3pRgYijG8AMCZyL sgXxZqVMZ8Kj+b0diYCUuSv9jGIbR9F2QAtLGvGXIyN3pifJK03Mxg7tRvTUyE6/pZZu +T7umMi/gAEvdViWb/jelq49itLjBZXctlr/0= 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=UgzP3s1EUMO3kZDmKHZy1j08m2AZLioIZ7RkJ7x9gqU=; b=XvXy2PGnv+VyD0GrJhNVxYmTf/mT/hGnbZp97wuS915U7nZttbcjqKzhav9PHNufow TL8m0BuO2sAGoXZnvA0jOK+NO4MqktBGCDAgHYtGU2L/FVpD1djVhmYTkK2TySDmN2Cd DgDBoImyzZFJDM7lCTRy/w/df1b2X+6c8xx0zij4aAqKY4i9MIchev02KN/wisam3v3I WLBk44CB6vIIivyoQD5/2ku8qnbzKt7mkQTdwpJFWRGZ14CaVAWfbfnnx+hR/+ztXtrB 0oDiqeCi/+3RGc1nLfHndo+yq/Inh0FEkH8rYJGQQgzVgrEZ/DpBgd0A58sn+znSHTqY u0Mg== X-Gm-Message-State: AN3rC/6c47Sd0wrT7mmbpF0eOGAKORvsnd69Ots1hHsa4FXACIxlRSRZ ZHfjmIencFhLgJZl X-Received: by 10.223.150.18 with SMTP id b18mr2568296wra.98.1492967378274; Sun, 23 Apr 2017 10:09:38 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:09:37 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 07/79] arm64: sysreg: add Set/Way sys encodings Date: Sun, 23 Apr 2017 19:08:17 +0200 Message-Id: <20170423170929.27334-8-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_101000_582754_0B760046 X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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 Cache maintenance ops fall in the SYS instruction class, and KVM needs to handle them. So as to keep all SYS encodings in one place, this patch adds them to sysreg.h. The encodings were taken from ARM DDI 0487A.k_iss10775, Table C5-2. To make it clear that these are instructions rather than registers, and to allow us to change the way these are handled in future, a new sys_insn() alias for sys_reg() is added and used for these new definitions. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon --- arch/arm64/include/asm/sysreg.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index f623320..128eae8 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -48,6 +48,8 @@ ((crn) << CRn_shift) | ((crm) << CRm_shift) | \ ((op2) << Op2_shift)) +#define sys_insn sys_reg + #define sys_reg_Op0(id) (((id) >> Op0_shift) & Op0_mask) #define sys_reg_Op1(id) (((id) >> Op1_shift) & Op1_mask) #define sys_reg_CRn(id) (((id) >> CRn_shift) & CRn_mask) @@ -89,6 +91,10 @@ #define SET_PSTATE_UAO(x) __emit_inst(0xd5000000 | REG_PSTATE_UAO_IMM | \ (!!x)<<8 | 0x1f) +#define SYS_DC_ISW sys_insn(1, 0, 7, 6, 2) +#define SYS_DC_CSW sys_insn(1, 0, 7, 10, 2) +#define SYS_DC_CISW sys_insn(1, 0, 7, 14, 2) + #define SYS_OSDTRRX_EL1 sys_reg(2, 0, 0, 0, 2) #define SYS_MDCCINT_EL1 sys_reg(2, 0, 0, 2, 0) #define SYS_MDSCR_EL1 sys_reg(2, 0, 0, 2, 2)