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: 9694903 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 6E43960245 for ; Sun, 23 Apr 2017 17:09:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54E5926530 for ; Sun, 23 Apr 2017 17:09:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49BDD265B9; Sun, 23 Apr 2017 17:09:54 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC3BB26530 for ; Sun, 23 Apr 2017 17:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162473AbdDWRJw (ORCPT ); Sun, 23 Apr 2017 13:09:52 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:34999 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162311AbdDWRJj (ORCPT ); Sun, 23 Apr 2017 13:09:39 -0400 Received: by mail-wr0-f175.google.com with SMTP id z52so37728273wrc.2 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=DDirSIWeHb3bhJ+SeKYod1yy1dYHT1nTolq2FtIha+fQCmhk7h+Rpmrkkgkv0XHBqF nQXgp087jIxXvPdxJ6qN9eI+PSBmylEnuaJb+Rkxn513KNeC7hvxmj83Q1cmsRLNaUqt PULqnG50EYNPKdOkfx/YxiwNnDIrjwM36hV3P6QMy/uC3RYUmuW7BrcOyq0+2oEA/9o6 MsMDwtZin3xGyAwyzo9Mr4n3f3U/X0vRnDHOzq/IxkBN2BP1biy16NlRv6QMRMo7s0Lq 4JGJAw6SAdMmDVBhifh4sBxF3N951n23t2oEGgGw9StCwwPuyWupV+GGSjzE6I8C2kTj 25tg== X-Gm-Message-State: AN3rC/4w709td5EHwGmGYowXeBRd3TtmxKoL3r9lrgahNZQsrT7B8zuj 199sVDT9I44E4FbV 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?= Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Rutland , Catalin Marinas , Suzuki K Poulose , Will Deacon 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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)