Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbbFZT6w (ORCPT ); Fri, 26 Jun 2015 15:58:52 -0400 Received: from mail-bn1bon0065.outbound.protection.outlook.com ([157.56.111.65]:27136 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751914AbbFZT6q (ORCPT ); Fri, 26 Jun 2015 15:58:46 -0400 Authentication-Results: lists.cs.columbia.edu; dkim=none (message not signed) header.d=none; From: Tirumalesh Chalamarla To: kvmarm@lists.cs.columbia.edu CC: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rrichter@cavium.com, will.deacon@arm.com, andre.przywara@arm.com, Tirumalesh Chalamarla 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 Content-Type: text/plain 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/gbEemFGJncnIsCSeTEiB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ywNA+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-pc.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1782;23:Cd7EIyhGeHI3FGtsZzTHDfdAfoGVO6aoUoTNIsp5H60HVwIOqgapqZuBj5f0t0g28kj8jIU8LvnZzskzFcW8kTmG9XQAoPcDN/3WYdFwk9/g1bgFqUZzaldwY6VL52J8Dq9MHI2cQd/nVE2iPIi/I8Kmq7N7cbj2gBPQtbByO7D/EdvdLdNja83b5KA7gxQ58R+KsKvArzcJU3jG5Te0zh695gNPSObmeyvE65Dai4itvIL+vRni16N+/Ae0P3VpI+ReciDN3dAyQ7r/fdCzaSSB0tCAsmTcZfwgnslPB3l4QZQnz1HgwaYE3KCbP+jxH67G/ceOU6r+ERbyQGmB9hLXN7sPhRhSRDeHsXXW0aQqI56Dr0jDtG6Dh5pcqM1zdFhJyHWrkHrNIAggHqpBDrUhlwRI5ezbcN6jcQbqI6FCUy5VBYxX+EbjzqSLIOXHJO2tJgcGdE/XzIIujoxAyX33mrJoeyIOrXqgA22aYJ+R4TYBW02QWVECO9EUicfe0nvIuRErvrd/cn3KBeZTE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563RFZ3Zm+A1hmckscjBpzuCTLn4oOjEU59QNtiMx9kn14ROdrdaFlR0gUQb7qivMXT+hEq0OXzcg/LAv8IpnGkwy39Sugc30C/jX9UTBP0dRxkC7AL6POCngJtxuuj8w9tNajG2l37Ge+cWoSImSmUjrA7jK/dBnDk 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-OriginatorOrg: caviumnetworks.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2790 Lines: 85 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; } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/