Skip to contentSkip to conversation

x86: qemu: Fix broken multi-core boot

PATCH New Bin Meng 2 participants 3 messages Feb 2, 2021 – Feb 3, 2021 x86

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 x86: qemu: Fix broken multi-core boot

Unfortunately the multi-core boot for QEMU x86 has been broken since commit 77a5e2d3bc61 ("x86: mp_init: Set up the CPU numbers at the start").

In order to support QEMU x86 multi-core boot, the /cpus node must be bound before any actual fix up in qemu_cpu_fixup(). This adds the uclass_get() call to ensure this, just like what was done before.

Fixes 77a5e2d3bc61 ("x86: mp_init: Set up the CPU numbers at the start")

---

 arch/x86/cpu/qfw_cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/cpu/qfw_cpu.c +6 -0
index a35de87..b959ead 100644
@@ -17,10 +17,16 @@ int qemu_cpu_fixup(void)
 	int ret;
 	int cpu_num;
 	int cpu_online;
+	struct uclass *uc;
 	struct udevice *dev, *pdev;
 	struct cpu_plat *plat;
 	char *cpu;
 
+	/* This will cause the CPUs devices to be bound */
+	ret = uclass_get(UCLASS_CPU, &uc);
+	if (ret)
+		return ret;
+
 	/* first we need to find '/cpus' */
 	for (device_find_first_child(dm_root(), &pdev);
 	     pdev;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 x86: qemu: Fix broken multi-core boot

Quoted 8 lines · Bin Meng

Unfortunately the multi-core boot for QEMU x86 has been broken since commit 77a5e2d3bc61 ("x86: mp_init: Set up the CPU numbers at the start").

In order to support QEMU x86 multi-core boot, the /cpus node must be bound before any actual fix up in qemu_cpu_fixup(). This adds the uclass_get() call to ensure this, just like what was done before.

Quoted 6 lines
Fixes 77a5e2d3bc61 ("x86: mp_init: Set up the CPU numbers at the start")

---

 arch/x86/cpu/qfw_cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)
author
#2 lore raw

PATCH 1/1 x86: qemu: Fix broken multi-core boot

Quoted 10 lines · Simon Glass
Quoted 8 lines · Bin Meng

Unfortunately the multi-core boot for QEMU x86 has been broken since commit 77a5e2d3bc61 ("x86: mp_init: Set up the CPU numbers at the start").

In order to support QEMU x86 multi-core boot, the /cpus node must be bound before any actual fix up in qemu_cpu_fixup(). This adds the uclass_get() call to ensure this, just like what was done before.

Quoted 8 lines
Quoted 6 lines
Fixes 77a5e2d3bc61 ("x86: mp_init: Set up the CPU numbers at the start")

---

 arch/x86/cpu/qfw_cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

applied to u-boot-x86, thanks!