All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1 RESEND] ARM: plat-versatile: move secondary CPU startup out of .init.
@ 2012-11-16 12:16 ` Claudio Fontana
  0 siblings, 0 replies; 2+ messages in thread
From: Claudio Fontana @ 2012-11-16 12:16 UTC (permalink / raw)
  To: linux-arm-kernel


Hello,

I am implementing a new feature in QEMU, including virtual CPU hotplug
for the the ARM Cortex A-15 VExpress motherboard.
This new QEMU feature includes a new monitor command "smp_cpus_set",
which allows changing the number of visible CPUs in the guest.

I stumbled upon a limitation in the kernel support for plat-versatile,
which contains the secondary CPU startup code for the VExpress.

Basically, the secondary CPU startup code is preceded by the macro __INIT,
which causes the code to be freed in free_initmem() during kernel_init().

This means that any attempt at hot-booting CPUs in the guest results in
VCPUs jumping to a memory address that was freed, after which the VCPU
behaves erratically, as can be expected.

With this patch applied, we use __CPUINIT instead of __INIT, so that
the right thing happens:
under CONFIG_HOTPLUG_CPU, the secondary CPU startup code is not freed,
the secondary VCPUs start successfully, and it's all gardens and blue skies.

Tested successfully using the ARM fast models for the Cortex-A15.

--
Claudio Fontana (1):
  ARM: plat-versatile: move secondary CPU startup code out of .init.

 arch/arm/plat-versatile/headsmp.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.7.12.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 0/1 RESEND] ARM: plat-versatile: move secondary CPU startup out of .init.
@ 2012-11-16 12:16 ` Claudio Fontana
  0 siblings, 0 replies; 2+ messages in thread
From: Claudio Fontana @ 2012-11-16 12:16 UTC (permalink / raw)
  To: Russell King; +Cc: linux-arm-kernel, linux-kernel


Hello,

I am implementing a new feature in QEMU, including virtual CPU hotplug
for the the ARM Cortex A-15 VExpress motherboard.
This new QEMU feature includes a new monitor command "smp_cpus_set",
which allows changing the number of visible CPUs in the guest.

I stumbled upon a limitation in the kernel support for plat-versatile,
which contains the secondary CPU startup code for the VExpress.

Basically, the secondary CPU startup code is preceded by the macro __INIT,
which causes the code to be freed in free_initmem() during kernel_init().

This means that any attempt at hot-booting CPUs in the guest results in
VCPUs jumping to a memory address that was freed, after which the VCPU
behaves erratically, as can be expected.

With this patch applied, we use __CPUINIT instead of __INIT, so that
the right thing happens:
under CONFIG_HOTPLUG_CPU, the secondary CPU startup code is not freed,
the secondary VCPUs start successfully, and it's all gardens and blue skies.

Tested successfully using the ARM fast models for the Cortex-A15.

--
Claudio Fontana (1):
  ARM: plat-versatile: move secondary CPU startup code out of .init.

 arch/arm/plat-versatile/headsmp.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.7.12.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-16 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 12:16 [PATCH 0/1 RESEND] ARM: plat-versatile: move secondary CPU startup out of .init Claudio Fontana
2012-11-16 12:16 ` Claudio Fontana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.