From patchwork Sun Apr 23 17:08:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9694905 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 C163360245 for ; Sun, 23 Apr 2017 17:09:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A866226530 for ; Sun, 23 Apr 2017 17:09:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D467265B9; Sun, 23 Apr 2017 17:09:57 +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 0611526530 for ; Sun, 23 Apr 2017 17:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162340AbdDWRJy (ORCPT ); Sun, 23 Apr 2017 13:09:54 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:33892 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162324AbdDWRJk (ORCPT ); Sun, 23 Apr 2017 13:09:40 -0400 Received: by mail-wr0-f182.google.com with SMTP id z109so79239019wrb.1 for ; Sun, 23 Apr 2017 10:09:40 -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=h67Zu93PFaaH3riW1MElJ+ljOzxYeH0NMsN/EZYEV6s=; b=XzXNexiGTxhzR/qaFG6RksiuatC4PlOJtG7OyGGW22e1wq3coblsN0B1dXO2M57btn KCGFO37L0Zj4qzuc9gWnKELR3ZzxQJ3X1pwUxxS6mvjrHJ50IlAipz+vz1oqIOFRJfhb Ee7qpMabrSuTQGWkaD/L6FSfbvXULmNG6g0pA= 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=h67Zu93PFaaH3riW1MElJ+ljOzxYeH0NMsN/EZYEV6s=; b=KPRXb4SFtDPT5qWCc1736qAcSfL4/859ksurHsHpRThZBzPna24FzkMeHTSxfL30b1 tutUw+OBmsPy6IwZLhiVgWnfBoHu5kyawPvaib9jEYFA7NQjQKu/Wjn6FeMFuDsOuj2y oSKyyOYnrTMpd8ErECnqlPKPWPoD4BBExsd/io21jgZPJ4had84hLBe3fWZnM/6pK52c K1pYn5mE7wAfMsX8YrN53W0UaZKghxsnICOuIdH/P+YMia4BnqRcPF7fIzoGnCAluFN2 54hJbUt5v47n7eOJ/BIU2Vx8VX6MDoelCIEPzqhT9Sg3BPyIgPwh9Dh/xq3te/78//s8 Z69Q== X-Gm-Message-State: AN3rC/5vhlhkcAXb0ccJDCU3d+ypoiZsEKuAYQ+FqczS03G6YyxQHyYS eXNWaGrFACX19H4v X-Received: by 10.223.151.6 with SMTP id r6mr2608410wrb.189.1492967379240; Sun, 23 Apr 2017 10:09:39 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:09:38 -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 Subject: [PULL 08/79] KVM: arm64: add SYS_DESC() Date: Sun, 23 Apr 2017 19:08:18 +0200 Message-Id: <20170423170929.27334-9-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 This patch adds a macro enabling us to initialise sys_reg_desc structures based on common sysreg encoding definitions in . Subsequent patches will use this to simplify the KVM code. Signed-off-by: Mark Rutland Acked-by: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu --- arch/arm64/kvm/sys_regs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h index 9c6ffd0..66859a5 100644 --- a/arch/arm64/kvm/sys_regs.h +++ b/arch/arm64/kvm/sys_regs.h @@ -147,4 +147,9 @@ const struct sys_reg_desc *find_reg_by_id(u64 id, #define CRm(_x) .CRm = _x #define Op2(_x) .Op2 = _x +#define SYS_DESC(reg) \ + Op0(sys_reg_Op0(reg)), Op1(sys_reg_Op1(reg)), \ + CRn(sys_reg_CRn(reg)), CRm(sys_reg_CRm(reg)), \ + Op2(sys_reg_Op2(reg)) + #endif /* __ARM64_KVM_SYS_REGS_LOCAL_H__ */