From cae9c05f75974de32353a688bef2503b4f3debd3 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Fri, 10 Apr 2020 10:17:27 +0800 Subject: [PATCH] arm/cpu: assign arm_get_arch_id handler to get_arch_id hook This hook will be called in get_cpu_status, which is called during cpu hotplug. Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta (cherry picked from commit dc4b675a897d6094b60ef462482e03b2905e1737) --- ...rm_get_arch_id-handler-to-get_arch_i.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 arm-cpu-assign-arm_get_arch_id-handler-to-get_arch_i.patch diff --git a/arm-cpu-assign-arm_get_arch_id-handler-to-get_arch_i.patch b/arm-cpu-assign-arm_get_arch_id-handler-to-get_arch_i.patch new file mode 100644 index 0000000..91c7181 --- /dev/null +++ b/arm-cpu-assign-arm_get_arch_id-handler-to-get_arch_i.patch @@ -0,0 +1,43 @@ +From 42072fd4b33125959d825a0c5cee0d1122072f71 Mon Sep 17 00:00:00 2001 +From: Keqian Zhu +Date: Fri, 10 Apr 2020 10:17:27 +0800 +Subject: [PATCH] arm/cpu: assign arm_get_arch_id handler to get_arch_id hook + +This hook will be called in get_cpu_status, which is called +during cpu hotplug. + +Signed-off-by: Keqian Zhu +Signed-off-by: Salil Mehta +--- + target/arm/cpu.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/target/arm/cpu.c b/target/arm/cpu.c +index 65163f5135..f06ba29885 100644 +--- a/target/arm/cpu.c ++++ b/target/arm/cpu.c +@@ -2557,6 +2557,13 @@ static const struct TCGCPUOps arm_tcg_ops = { + }; + #endif /* CONFIG_TCG */ + ++static int64_t arm_cpu_get_arch_id(CPUState *cs) ++{ ++ ARMCPU *cpu = ARM_CPU(cs); ++ ++ return cpu->mp_affinity; ++} ++ + static void arm_cpu_class_init(ObjectClass *oc, void *data) + { + ARMCPUClass *acc = ARM_CPU_CLASS(oc); +@@ -2575,6 +2582,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) + cc->set_pc = arm_cpu_set_pc; + cc->gdb_read_register = arm_cpu_gdb_read_register; + cc->gdb_write_register = arm_cpu_gdb_write_register; ++ cc->get_arch_id = arm_cpu_get_arch_id; + #ifndef CONFIG_USER_ONLY + cc->sysemu_ops = &arm_sysemu_ops; + #endif +-- +2.27.0 +