arm64: qcom: Add define for ARMv8 implementer (MIDR)
Subsystems (4)
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
@@ -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.
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
@@ -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
@@ -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
@@ -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.
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_KRYOto the KVM target list and modifiedvm_target_cpu()to returnKVM_ARM_TARGET_QCOM_KRYOwhen CPU running in AArch64 mode.Signed-off-by Shanker Donthineni <[email protected]>Signed-off-by Timur Tabi <[email protected]>--- 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@@ -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 0arch/arm64/kvm/guest.c +6
-0@@ -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
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...
Quoted 7 lines · Timur Tabi
From: Shanker Donthineni <[email protected]>
This patch adds define for Qualcomm Technologies ARMv8 CPU implementer ID
0x51and part number for Kryo inasm/cputype.h.Signed-off-by Shanker Donthineni <[email protected]>Signed-off-by Timur Tabi <[email protected]>
I think this patch together with the second one could go through the kvm tree. For the core arm64 part:
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:
Acked-by Catalin Marinas<[email protected]>
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.
Catalin Marinas
maintainerQuoted 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:
Acked-by Catalin Marinas<[email protected]>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
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