linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: timur@codeaurora.org (Timur Tabi)
To: linux-arm-kernel@lists.infradead.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	[thread overview]
Message-ID: <1434146263-30972-2-git-send-email-timur@codeaurora.org> (raw)
In-Reply-To: <1434146263-30972-1-git-send-email-timur@codeaurora.org>

From: Shanker Donthineni <shankerd@codeaurora.org>

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 <shankerd@codeaurora.org>
Signed-off-by: Timur Tabi <timur@codeaurora.org>
---
 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;
 }
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

  reply	other threads:[~2015-06-12 21:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 21:57 [PATCH 1/2] arm64: qcom: Add define for ARMv8 implementer (MIDR) Timur Tabi
2015-06-12 21:57 ` Timur Tabi [this message]
2015-06-16 13:32   ` [PATCH 2/2] arm64: KVM: Add VCPU support for Qualcomm Technologies Kryo ARMv8 CPU Marc Zyngier
2015-06-15 10:59 ` [PATCH 1/2] arm64: qcom: Add define for ARMv8 implementer (MIDR) Catalin Marinas
2015-06-19 22:28   ` Timur Tabi
2015-06-22 11:09     ` Catalin Marinas
2015-06-22 12:36       ` Timur Tabi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434146263-30972-2-git-send-email-timur@codeaurora.org \
    --to=timur@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).