]> rtime.felk.cvut.cz Git - jailhouse.git/commit
arm: add platform-dependent SMP operations
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Thu, 7 Aug 2014 13:42:30 +0000 (14:42 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 19 Dec 2014 10:04:07 +0000 (11:04 +0100)
commit7d65457ba01c21a1e470f7043f1914f0f76757bf
tree82356b7ce139be7d41baf075c3d8edd3c5d4d034
parentd41dba035dae5f20653bcd4d2bc7f01da8a1f0a3
arm: add platform-dependent SMP operations

Hotplugging CPUs on ARM is quite difficult, as each platform uses its
own system. The use of PSCI emulation will greatly simplify this, but
on many platforms, we still have to define a series of specific SMP
operations wrapped around the kernel hotplug implementation.

This patch adds support for the vexpress hotplug system:
- When the root cell attempts to unplug a CPU, to give it to a new
  cell, it is put in a WFI loop, which is left when Jailhouse sends
  a synchronising IPI to all CPUs that need to be parked.
- When re-assigning a CPU to the root cell, the simplest return path
  is through the kernel's secondary entry, whose address is stored in
  the system flags register.

Because the kernel only writes the flag register once, plugging CPUs in
the host cannot be accomplished by waiting for a trapped MMIO. Moreover,
such a trap would be missed on hypervisor shutdown, since CPU0 may
return to bare EL1 before secondary CPUs. On some platforms, it may be
necessary to park secondary CPUs outside of the hypervisor on shutdown,
by copying a minimal spin code in a reserved location...

This patch also attempts to combine both classical and PSCI boot methods
in SMP guests: secondary CPUs are held in the psci_emulate_spin handler,
and can be woken up by both a PSCI call and a trapped access to the
vexpress mbox.
The same applies for hotplugging secondary CPUs in the guests, but the
mailbox method only waits for an IPI.

PSCI in the host is not currently supported: it would require a call to
the actual CPU_OFF handler when shutting down the whole hypervisor.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
[Jan: switch to mmio accessor]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/Makefile
hypervisor/arch/arm/control.c
hypervisor/arch/arm/include/asm/cell.h
hypervisor/arch/arm/include/asm/control.h
hypervisor/arch/arm/include/asm/platform.h
hypervisor/arch/arm/include/asm/smp.h [new file with mode: 0644]
hypervisor/arch/arm/mmio.c
hypervisor/arch/arm/setup.c
hypervisor/arch/arm/smp-vexpress.c [new file with mode: 0644]
hypervisor/arch/arm/smp.c [new file with mode: 0644]
hypervisor/arch/arm/spin.c [deleted file]