From patchwork Sat Jul 14 17:05:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10524877 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 2886A60245 for ; Sat, 14 Jul 2018 21:54:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16EED28895 for ; Sat, 14 Jul 2018 21:54:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09D3A288AC; Sat, 14 Jul 2018 21:54:05 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7B0E128895 for ; Sat, 14 Jul 2018 21:54:04 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=aGLodGE4ZqaZbyeJNs+CyW2PH/R+3yO5MlH1NUJFFqM=; b=GL5GvmrRl54a7c DsoKo+4SBNRpvOD9j6BwKzEm9D4gVdORZPhIZ2Fv0TRnkoQBvM8uKVRXLeKFwladG4yZM13ICXSM8 TD9eTg7bYB+KXoi4B6BEuQ+dQhm10sXgBtmwjioDk2oLlLSdgBWD5/Z7yrHJ3NPfIbsm5rBi356oK 0SYtJjx6/YRonWyKD6xR0zGkBMVa9OBJDxS3IEwgJNuTm0Jl9FWiNjqHXu7z6faIuYmi62iEH23Mt ptSd2QoXJFGbHwMzTBF7KBkcc43m/B0Nni0XsntVXoB6iG+b0hD2ZyttNTG9uKd0huHPGPlRBG7lj GTSDfd3xhEZPqAhTbFuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1feSUK-0004WB-GX; Sat, 14 Jul 2018 21:54:00 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1feSTi-0003VM-S0 for linux-arm-kernel@bombadil.infradead.org; Sat, 14 Jul 2018 21:53:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3kBC58cdZ/eLVHvBmcFskQVhwmyf6/Yo/PK0DyWIlgo=; b=AwtULMfZDdBbowzA6zOC6buZfU JCF1fHAFMHUYC6+Wc1xK1KjPMRuDNROlmHuv/Oq4k4H0zIBZhF5L7D1s3N2S44rsSl2jDylp5nrjB +z7ZBbolLSmUW35G8y1HIbJD/pzs5XN6LhlVm1dorabaSEl6qRzmkJ9T/nv3J9gDUY2DcMgBMAVDd /V/PqmuI6qFGPsHm+QBYE/6HOK0oCCCMMpW4ayj2CzGoSY6ORoNn13FUN+W4KdX2I+n1RK1WWcnd/ C50cfmbtUxd2CfcDmEUq9F38WnvJPxvtHMDevWE4FPBfPHS8W3hMy8nFften/0LTsZf1acjFbGSnv Ibr59JhQ==; Received: from mail-ve1eur02hn0209.outbound.protection.outlook.com ([104.47.6.209] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1feO0t-0000dq-G3 for linux-arm-kernel@lists.infradead.org; Sat, 14 Jul 2018 17:07:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3kBC58cdZ/eLVHvBmcFskQVhwmyf6/Yo/PK0DyWIlgo=; b=efUx2fGcT15a1xOxsGpOYYNVTFFn3fFYNEQ+Vufhl/ls1CB69o3A1g8WNiW1tlT0sU7rBdOyuK/JPGylSyNAvH4ehsunkxmXiKDzuxVDX245wvcKQQFU8jfhvicssojTb27WcXwgMOEljYA6AY7KYOhjvLJ2OFuc+QLkIzpI4E8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christoffer.Dall@arm.com; Received: from localhost (217.140.96.140) by AM5PR0801MB2036.eurprd08.prod.outlook.com (2603:10a6:203:4c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.19; Sat, 14 Jul 2018 17:05:59 +0000 From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/9] KVM: arm/arm64: vgic: Define GICD_IIDR fields for GICv2 and GIv3 Date: Sat, 14 Jul 2018 19:05:32 +0200 Message-Id: <1531587940-2490-2-git-send-email-christoffer.dall@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531587940-2490-1-git-send-email-christoffer.dall@arm.com> References: <1531587940-2490-1-git-send-email-christoffer.dall@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: HE1PR05CA0275.eurprd05.prod.outlook.com (2603:10a6:3:fc::27) To AM5PR0801MB2036.eurprd08.prod.outlook.com (2603:10a6:203:4c::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7981f1d3-03ec-4044-f049-08d5e9ac12ae X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB2036; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB2036; 3:MzvrMU9JOUkqZBzMr0UAQFTftCVQHCnE4FY6GwZnIxOe2q2ImYswsnhtmLAl1O5gaqgbX4bjeJJgJbJ9iZpYDejlDB8pmegBe4Xb4u9DduTSeTSOZ8VglZ/NHiEfnJl9ZudawA3tUZkiDniftVk9bAkHv7EZqKzU6Zi52E8wvCLFZAfTvKXaboqmKnvwyWzHEqyVfMIOfwxEkoZBZOmOoirp4YcN7sHFb9Y91Ampt+HYO9s6vGqNsv4zGxSlLE9J; 25:JLfZPPy1HQ/SGMR9TJbgawDVeTPpz06necwh1jX0KXv9AphzjTzhJg1MMnNff/Bgu/pACsb7LrUi3u30DFmXsKEs0txTb1cBypvZxTjde1p9/l85FMmW+BlGzvXjf/TKiRJUu76eD8tr1Y1n3S8f5+ncNVbmJSecelGT5KZWcyzoMV6qQRyQ7fxCr3c19dgzAlfQQHu4EQmXtq7wPfsADB/Jcm0+O4VvtWhuNkuswKay7QkENVgg1hgqZH3XFM4IeQ1EOaGIJB0ZIIkoJIzrv0Z6F6rDwcTISSPWujgXBOph+AG019fyPXXpbiLmiqzhdc92SdxCsdMrWdgt8/RpQg==; 31:Wdd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dkEVDJSj8DscvMJpRzaPVHZ+mrVT3Ti3yHzzgRfEERadxfjo3PVAl2drP6mfPfkIgAxYvyGcQA+E78bkDFd/WAo63bdmJs0v8WBgyMs+DzPY8Kov7Ctsq4Aq/Nny0kIbc44v0QFwIm8D3HEhucG7IkY3NDmhWd7UHEnXLIU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(209352067349851)(192374486261705)(223705240517415); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM5PR0801MB2036; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB2036; X-Forefront-PRVS: 07334CBCCD X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(6069001)(376002)(346002)(136003)(396003)(366004)(39850400004)(40434004)(189003)(199004)(6666003)(16526019)(72206003)(8676002)(81156014)(81166006)(97736004)(476003)(4326008)(2616005)(76176011)(478600001)(25786009)(956004)(2171002)(36756003)(8936002)(6116002)(386003)(11346002)(446003)(48376002)(86362001)(53936002)(6486002)(52116002)(51416003)(8746002)(2906002)(50466002)(6496006)(305945005)(186003)(3846002)(50226002)(26005)(68736007)(7736002)(5024004)(14444005)(54906003)(316002)(66066001)(47776003)(76506005)(106356001)(105586002)(486006)(44832011)(5660300001)(23200700001); DIR:OUT; SFP:1501; SCL:5; SRVR:AM5PR0801MB2036; H:localhost; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB2036; 23:1PjHlBp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B+r9kTK1zjL6D1CzPtWamD5aU5KcR9drsGOJ3YT6uDAblMYliM8yOz13ov6754jJ78Tfkjq7AzACcOh09zN3pB3jI2v4xPpdL78em1krvc/J0Otd/nPf4JLqL+d5N/o5Yxb9Vj//tE06juJSo6CJNbdHby1oblQVVyC7L8U//SQUvUfvpXqJ2n8OW/wFReZc7Sqn1iS1GIKq+vxVsQcl1CQytwqpRoiDGoY0Gg6P7emjc X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2018 17:05:59.7072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7981f1d3-03ec-4044-f049-08d5e9ac12ae X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2036 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180714_130719_680757_B9E88187 X-CRM114-Status: GOOD ( 10.41 ) 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: Peter Maydell , kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Christoffer Dall , Eric Auger 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 Instead of hardcoding the shifts and masks in the GICD_IIDR register emulation, let's add the definition of these fields to the GIC header files and use them. This will make things more obvious when we're going to bump the revision in the IIDR when we'll make guest-visible changes to the implementation. Signed-off-by: Christoffer Dall --- include/linux/irqchip/arm-gic-v3.h | 10 ++++++++++ include/linux/irqchip/arm-gic.h | 10 ++++++++++ virt/kvm/arm/vgic/vgic-mmio-v2.c | 3 ++- virt/kvm/arm/vgic/vgic-mmio-v3.c | 3 ++- 4 files changed, 24 insertions(+), 2 deletions(-) -- 2.7.4 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index cbb872c..b22f9df 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -61,6 +61,16 @@ #define GICD_CTLR_ENABLE_G1A (1U << 1) #define GICD_CTLR_ENABLE_G1 (1U << 0) +#define GICD_IIDR_IMPLEMENTER_SHIFT 0 +#define GICD_IIDR_IMPLEMENTER_MASK (0xfff << GICD_IIDR_IMPLEMENTER_SHIFT) +#define GICD_IIDR_REVISION_SHIFT 12 +#define GICD_IIDR_REVISION_MASK (0xf << GICD_IIDR_REVISION_SHIFT) +#define GICD_IIDR_VARIANT_SHIFT 16 +#define GICD_IIDR_VARIANT_MASK (0xf << GICD_IIDR_VARIANT_SHIFT) +#define GICD_IIDR_PRODUCT_ID_SHIFT 24 +#define GICD_IIDR_PRODUCT_ID_MASK (0xff << GICD_IIDR_PRODUCT_ID_SHIFT) + + /* * In systems with a single security state (what we emulate in KVM) * the meaning of the interrupt group enable bits is slightly different diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h index 68d8b1f..484f5bf 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h @@ -71,6 +71,16 @@ (GICD_INT_DEF_PRI << 8) |\ GICD_INT_DEF_PRI) +#define GICD_IIDR_IMPLEMENTER_SHIFT 0 +#define GICD_IIDR_IMPLEMENTER_MASK (0xfff << GICD_IIDR_IMPLEMENTER_SHIFT) +#define GICD_IIDR_REVISION_SHIFT 12 +#define GICD_IIDR_REVISION_MASK (0xf << GICD_IIDR_REVISION_SHIFT) +#define GICD_IIDR_VARIANT_SHIFT 16 +#define GICD_IIDR_VARIANT_MASK (0xf << GICD_IIDR_VARIANT_SHIFT) +#define GICD_IIDR_PRODUCT_ID_SHIFT 24 +#define GICD_IIDR_PRODUCT_ID_MASK (0xff << GICD_IIDR_PRODUCT_ID_SHIFT) + + #define GICH_HCR 0x0 #define GICH_VTR 0x4 #define GICH_VMCR 0x8 diff --git a/virt/kvm/arm/vgic/vgic-mmio-v2.c b/virt/kvm/arm/vgic/vgic-mmio-v2.c index ffc587b..af44e569 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v2.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v2.c @@ -37,7 +37,8 @@ static unsigned long vgic_mmio_read_v2_misc(struct kvm_vcpu *vcpu, value |= (atomic_read(&vcpu->kvm->online_vcpus) - 1) << 5; break; case GIC_DIST_IIDR: - value = (PRODUCT_ID_KVM << 24) | (IMPLEMENTER_ARM << 0); + value = (PRODUCT_ID_KVM << GICD_IIDR_PRODUCT_ID_SHIFT) | + (IMPLEMENTER_ARM << GICD_IIDR_IMPLEMENTER_SHIFT); break; default: return 0; diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c index 2877840..c03f424 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c @@ -81,7 +81,8 @@ static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu, } break; case GICD_IIDR: - value = (PRODUCT_ID_KVM << 24) | (IMPLEMENTER_ARM << 0); + value = (PRODUCT_ID_KVM << GICD_IIDR_PRODUCT_ID_SHIFT) | + (IMPLEMENTER_ARM << GICD_IIDR_IMPLEMENTER_SHIFT); break; default: return 0;