From patchwork Fri Jun 12 21:57:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 6600981 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 884FCC0020 for ; Fri, 12 Jun 2015 21:57:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79F6620665 for ; Fri, 12 Jun 2015 21:57:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 874AF20662 for ; Fri, 12 Jun 2015 21:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbbFLV5t (ORCPT ); Fri, 12 Jun 2015 17:57:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54730 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbbFLV5q (ORCPT ); Fri, 12 Jun 2015 17:57:46 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 76A52140664; Fri, 12 Jun 2015 21:57:46 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 694E014067D; Fri, 12 Jun 2015 21:57:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from timur-ubuntu.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com [67.52.129.61]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: timur@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9C826140664; Fri, 12 Jun 2015 21:57:45 +0000 (UTC) From: Timur Tabi To: Vipul Gandhi , Shanker Donthineni , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH 2/2] arm64: KVM: Add VCPU support for Qualcomm Technologies Kryo ARMv8 CPU Date: Fri, 12 Jun 2015 16:57:43 -0500 Message-Id: <1434146263-30972-2-git-send-email-timur@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1434146263-30972-1-git-send-email-timur@codeaurora.org> References: <1434146263-30972-1-git-send-email-timur@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shanker Donthineni This patch enables assignment of 32/64bit guest VCPU to Qualcomm Technologies ARMv8 CPU. Added KVM_ARM_TARGET_QCOM_KRYO to the KVM target list and modified vm_target_cpu() to return KVM_ARM_TARGET_QCOM_KRYO when CPU running in AArch64 mode. Signed-off-by: Shanker Donthineni Signed-off-by: Timur Tabi --- arch/arm64/include/uapi/asm/kvm.h | 3 ++- arch/arm64/kvm/guest.c | 6 ++++++ arch/arm64/kvm/sys_regs_generic_v8.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index d268320..426933e 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_QCOM_KRYO 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..836cf16 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_QCOM: + switch (part_number & QCOM_CPU_PART_MASK) { + case QCOM_CPU_PART_KRYO: + return KVM_ARM_TARGET_QCOM_KRYO; + } + 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..3712ea8 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_QCOM_KRYO, + &genericv8_target_table); return 0; }