From patchwork Fri Jun 26 19:51:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tirumalesh Chalamarla X-Patchwork-Id: 6682911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2BE579F380 for ; Fri, 26 Jun 2015 19:54:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46BC5205EE for ; Fri, 26 Jun 2015 19:54:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 478EA205AA for ; Fri, 26 Jun 2015 19:54:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8ZfW-0002fY-BA; Fri, 26 Jun 2015 19:52:10 +0000 Received: from mail-bl2on0057.outbound.protection.outlook.com ([65.55.169.57] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8ZfS-0002d4-W7 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2015 19:52:07 +0000 Authentication-Results: lists.cs.columbia.edu; dkim=none (message not signed) header.d=none; Received: from tiru-pc.caveonetworks.com (64.2.3.194) by BY1PR0701MB1782.namprd07.prod.outlook.com (10.162.141.20) with Microsoft SMTP Server (TLS) id 15.1.201.16; Fri, 26 Jun 2015 19:51:43 +0000 From: Tirumalesh Chalamarla To: kvmarm@lists.cs.columbia.edu Subject: [PATCH] arm64: KVM: Enable minimalistic support for Thunder Date: Fri, 26 Jun 2015 12:51:24 -0700 Message-ID: <1435348284-32132-1-git-send-email-tchalamarla@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BY1PR13CA0037.namprd13.prod.outlook.com (25.162.107.175) To BY1PR0701MB1782.namprd07.prod.outlook.com (25.162.141.20) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1782; 2:YJrjjpUyODoHiNTFwRq9Fwy84cnzVTv6yQi9+csm8OVC1i7nx3DzOOoIO1OdGTyx; 3:+8YqBGD+YT+fd2DbT8L31sUkVPToJyv4RG388JX04qZV44InVbbJ7ZOozfhr5YoJej/9v9ZK0t7ip1O/nyISCwpTBR0PhOwuropcT+aC0V+Ge9Icz8hyhgjCuLma11exaHqj4bNUlP0z4Bg+VMcIKQ==; 25:2t9hEU8HZZJMVV11fOZM06sXjNDTjW5Nj9QVQrV5ejg9QlIcmf4dqGq+DIgxl6uylzLbqVu5FFJ7itUmx0L8D2K/llOoN3kd3UcTpD1pkPBASoJF5gC+CsZd3Tx4m6yn+Kl/gbEemFGJncnIsCSeTEiBch94/k0sRvJUw0SoW6P657Wzvb4v7ukNsAHOeZV7WsPAd2m151VSjnuh/36gz0obrqnpkte/YEpvxiYe3yqV70P7P8KEdKkVM0L0H/CR X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1782; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1782; 20:v7nbdktRrC/ZlRj4Kw3RTSVUX+N/NC7vgGmHDtDSQoRJ8FRo1TgxzCDy9gvLfKDZOr2lLGsaHTaTkMaq4DM1ZBtum9mXw7nK8vNL5NejVovvs5Nf0EGzkFUWhJZibJH73p+0PX9koR8pNFwNpBbM+hW1o15JSaEZ55xoZAP8w9wYinMS9pn5Et7pqdbEsddZbj7285RqJYkfNkm5enZ7pdz0oItNHE0qqQn66AIZyOozk2qUGeWEhzhPPnzYYAEcI/47rGJaBfzvQCCdsEtOQiU6fwTVph020rytB+XdnLXjs0rPqjMx9Blp6vJwjzqnOKijnvWxSMtZ4cr/XsptwY0v+PKTSQa34AS81n2f11vZ64CRndp1aQVfQ9YUG7thB+uAfYUs6oAP06bNq0zOZ7Af9LX7YExMf1Tzhg1UxFWU0FI7j6gARy9J4k3nObJAzBLAuqZusfTllxlA1iD99Zdz/lTjSpdNfXFf3n+rIad/kvqaw7SdggRnGfvHoLK2LF8pRIzRo81uFm3eza/xRyzTqi1XiyS7nzufX5vqqJTk+Svq+tM6dhoSSq1he9QT7fSCV8851XlDqzp5J1QvdI31ToYsA8Frd+r7UGpVL30=; 4:VXb9VNVO9qkAGaL/EKkPfYBfFni1sV0vrRDkhIEMIMClrMprraGKtVw3mbfQrU7EId9RwsgGIax/KJweHaD7rwBCYGTlE+2SigBgE3nmhzDMNlc2szh30/Qo2vVnp8z1XM5G0V8SPNWX15Khi8lVc+Svfw7RlTz8zJ8G1QV9rcIdm+Kgf0xyziLpQxpLgXbRfxGDqClepSVOAsIBEB1eNfheM5ECx7G1Gx1CzZtcH+2/YHXukol2t6MLfSu1DRWNMDFyvVywNA+vQchnxv0amCJtcGVWuEs9OkEgGJsovUs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY1PR0701MB1782; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1782; X-Forefront-PRVS: 0619D53754 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(36756003)(110136002)(5001960100002)(47776003)(53416004)(50986999)(77096005)(122386002)(107886002)(50226001)(42186005)(189998001)(48376002)(92566002)(50466002)(40100003)(33646002)(19580405001)(19580395003)(62966003)(2361001)(229853001)(46102003)(2351001)(2171001)(87976001)(575784001)(77156002)(66066001)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1782; H:tiru-p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UVIABAwm852O31msPolNJZTWy/vJh5dfl0BhpQTkHEwkq37nJNM9Kq7rbeXw==; 24:qB/YtSp2t4MKJTvexaFgAm4aQ+rfCEfoYbO9GprwUP7/Y04Tcd2zhNV4erscEsJkxSBzyfthooeqq3FzUuHrM94F4F9Zqdqq2Sb8CizwI5s=; 20:fP9uOWlFLB+gJMTmA3hFALYseMQ5zYFJu2cKvjTFgYBEXidzcMqfYVDEMUZwExH+l1oN7TCI9kHWE7xbqvB/mw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2015 19:51:43.1208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1782 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150626_125207_306620_26128D84 X-CRM114-Status: UNSURE ( 7.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) Cc: andre.przywara@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, rrichter@cavium.com, Tirumalesh Chalamarla , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to allow KVM to run on Thunder implementations, add the minimal support required. Signed-off-by: Tirumalesh Chalamarla --- arch/arm64/include/asm/cputype.h | 3 +++ arch/arm64/include/uapi/asm/kvm.h | 3 ++- arch/arm64/kvm/guest.c | 6 ++++++ arch/arm64/kvm/sys_regs_generic_v8.c | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index a84ec60..f603dcd 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h @@ -63,6 +63,7 @@ ((partnum) << MIDR_PARTNUM_SHIFT)) #define ARM_CPU_IMP_ARM 0x41 +#define ARM_CPU_IMP_CAVIUM 0x43 #define ARM_CPU_IMP_APM 0x50 #define ARM_CPU_PART_AEM_V8 0xD0F @@ -72,6 +73,8 @@ #define APM_CPU_PART_POTENZA 0x000 +#define ARM_CPU_PART_THUNDER 0x0A1 + #define ID_AA64MMFR0_BIGENDEL0_SHIFT 16 #define ID_AA64MMFR0_BIGENDEL0_MASK (0xf << ID_AA64MMFR0_BIGENDEL0_SHIFT) #define ID_AA64MMFR0_BIGENDEL0(mmfr0) \ diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index d268320..6c4c556 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -59,8 +59,9 @@ struct kvm_regs { #define KVM_ARM_TARGET_CORTEX_A57 2 #define KVM_ARM_TARGET_XGENE_POTENZA 3 #define KVM_ARM_TARGET_CORTEX_A53 4 +#define KVM_ARM_TARGET_CAVIUM_THUNDER 5 -#define KVM_ARM_NUM_TARGETS 5 +#define KVM_ARM_NUM_TARGETS 6 /* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */ #define KVM_ARM_DEVICE_TYPE_SHIFT 0 diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 9535bd5..3751f37 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -291,6 +291,12 @@ int __attribute_const__ kvm_target_cpu(void) return KVM_ARM_TARGET_XGENE_POTENZA; }; break; + case ARM_CPU_IMP_CAVIUM: + switch (part_number) { + case ARM_CPU_PART_THUNDER: + return KVM_ARM_TARGET_CAVIUM_THUNDER; + }; + break; }; return -EINVAL; diff --git a/arch/arm64/kvm/sys_regs_generic_v8.c b/arch/arm64/kvm/sys_regs_generic_v8.c index 475fd29..0e48ee8 100644 --- a/arch/arm64/kvm/sys_regs_generic_v8.c +++ b/arch/arm64/kvm/sys_regs_generic_v8.c @@ -94,6 +94,8 @@ static int __init sys_reg_genericv8_init(void) &genericv8_target_table); kvm_register_target_sys_reg_table(KVM_ARM_TARGET_XGENE_POTENZA, &genericv8_target_table); + kvm_register_target_sys_reg_table(KVM_ARM_TARGET_CAVIUM_THUNDER, + &genericv8_target_table); return 0; }