Skip to content

ARM: plat-versatile: move secondary CPU startup out of .init.

Claudio Fontana linux-arm-kernel lkml 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 4/41 patch 0 repliesNew
  2. v1 posting 3/41 patch 0 repliesSuperseded
  3. v1 posting 2/40 of 1 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 posting 1/41 patch0 repliesSuperseded

Patches in v1 posting 4/4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1ARM: plat-versatile: move secondary CPU startup out of .init.arch/arm/plat-versatile/headsmp.S+1 -10 replies

Reviews trailers per patch

The patch has no Reviewed-by or Acked-by.

PatchClaudio Fontana
SeriesT-b T-b
1/1T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1 RESEND 2] ARM: plat-versatile: move secondary CPU startup out of .init.

Hello,

I am implementing virtual CPU hotplug for the the ARM Cortex A-15 VExpress motherboard. This is mainly a QEMU feature, which allows dynamically changing the number of 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(-)
Signature · 1 line
1.7.12.1