Skip to contentSkip to conversation

arm64: qcom: Add define for ARMv8 implementer (MIDR)

PATCH In review Timur Tabi 3 participants 7 messages Jun 12, 2015 – Jun 22, 2015

Subsystems (4)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/2 arm64: qcom: Add define for ARMv8 implementer (MIDR)

From: Shanker Donthineni <[email protected]>

This patch adds define for Qualcomm Technologies ARMv8 CPU implementer ID 0x51 and part number for Kryo in asm/cputype.h.

---
 arch/arm64/include/asm/cputype.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/include/asm/cputype.h +4 -0
index a84ec60..6978764 100644
@@ -64,6 +64,7 @@
 
 #define ARM_CPU_IMP_ARM		0x41
 #define ARM_CPU_IMP_APM		0x50
+#define ARM_CPU_IMP_QCOM	0x51
 
 #define ARM_CPU_PART_AEM_V8	0xD0F
 #define ARM_CPU_PART_FOUNDATION	0xD00
@@ -84,6 +85,9 @@
 #define SCTLR_EL1_CP15BEN	(0x1 << 5)
 #define SCTLR_EL1_SED		(0x1 << 8)
 
+#define QCOM_CPU_PART_MASK	0xF00
+#define QCOM_CPU_PART_KRYO	0x200
+
 #ifndef __ASSEMBLY__
 
 /*
Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
author
#1 lore raw

PATCH 2/2 arm64: KVM: Add VCPU support for Qualcomm Technologies Kryo ARMv8 CPU

From: Shanker Donthineni <[email protected]>

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.

---
 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(-)
arch/arm64/include/uapi/asm/kvm.h +2 -1
index d268320..426933e 100644
@@ -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
arch/arm64/kvm/guest.c +6 -0
index 9535bd5..836cf16 100644
@@ -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;
arch/arm64/kvm/sys_regs_generic_v8.c +2 -0
index 475fd29..3712ea8 100644
@@ -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;
 }
Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#2 lore raw

Re: [PATCH 2/2] arm64: KVM: Add VCPU support for Qualcomm Technologies Kryo ARMv8 CPU

In the future, please add the KVM/ARM maintainers on Cc.

Quoted 53 lines · Timur Tabi

From: Shanker Donthineni <[email protected]>

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.

---
 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(-)
arch/arm64/include/uapi/asm/kvm.h +2 -1
index d268320..426933e 100644
@@ -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
arch/arm64/kvm/guest.c +6 -0
index 9535bd5..836cf16 100644
@@ -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;
arch/arm64/kvm/sys_regs_generic_v8.c +0 -0
index 475fd29..3712ea8 100644

arch/arm64/kvm/sys_regs_generic_v8.c static int __init sys_reg_genericv8_init(void) · line 101

Quoted 8 lines
arch/arm64/kvm/sys_regs_generic_v8.c +2 -0
@@ -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;
 }

That's getting slightly out of hand and I think we need to stop being paranoid.

All our target CPUs are using the generic tables, and this looks like an unnecessary complexity as long as we choose to ignore cross-microarchitecture migration (things like big-little or live migration from one CPU type to another).

Let's just implement a default target that works for everything. Should we support some CPUs in a more specific manner, it will then be worth adding to that list. I believe Suzuki (cc-ed) has something brewing.

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
maintainer Acked-by on v1 1/2
#3 lore raw
In reply to Timur Tabi
Quoted 7 lines · Timur Tabi

From: Shanker Donthineni <[email protected]>

This patch adds define for Qualcomm Technologies ARMv8 CPU implementer ID 0x51 and part number for Kryo in asm/cputype.h.

I think this patch together with the second one could go through the kvm tree. For the core arm64 part:

author
#4 lore raw
Quoted 4 lines · Catalin Marinas

I think this patch together with the second one could go through the kvm tree. For the core arm64 part:

Suzuki Poulose posted a patch that adds generic support for ARMv8 KVM targets. I want to drop my second patch, so can we pick up this first patch through the ARM tree?

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
maintainer
#5 lore raw
Quoted 9 lines · Timur Tabi
Quoted 4 lines · Catalin Marinas

I think this patch together with the second one could go through the kvm tree. For the core arm64 part:

Suzuki Poulose posted a patch that adds generic support for ARMv8 KVM targets. I want to drop my second patch, so can we pick up this first patch through the ARM tree?

So if the second patch is no longer needed, what's using this patch? I would defer merging it until actually required in some part of the kernel.

Signature · 1 line
Catalin
author
#6 lore raw
Quoted 3 lines · Catalin Marinas

So if the second patch is no longer needed, what's using this patch? I would defer merging it until actually required in some part of the kernel.

Fair enough.

Signature · 5 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in