Skip to content

RFC Update hotplug for pseries systems

Nathan Fontenot linuxppc-dev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Create interface for rtas hotplug events and move mem hotplug to the kernelarch/powerpc/include/asm/rtas.h arch/powerpc/kernel/rtas.c arch/powerpc/platforms/pseries/dlpar.c +3 more+403 -560 replies
2/4Migrate cpu hotplug code to pseries/hotplug-cpu.carch/powerpc/platforms/pseries/dlpar.c arch/powerpc/platforms/pseries/hotplug-cpu.c+194 -1820 replies
3/4Handle cpu hotplug from rtas hotplug eventsarch/powerpc/platforms/pseries/dlpar.c arch/powerpc/platforms/pseries/hotplug-cpu.c arch/powerpc/platforms/pseries/pseries.h+169 -00 replies
4/4Hook into ras epow interrupt handler for hotplugarch/powerpc/include/asm/rtas.h arch/powerpc/platforms/pseries/dlpar.c arch/powerpc/platforms/pseries/pseries.h +1 more+14 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/4] Update hotplug for pseries systems

In order to support device hotplug (cpu, memory, and pci) in both the PowerVM and the PowerKVM environments the handling of hotplug events will need to be updated. This patch set adresses this by creating a common entry point for handling hotplug events in the kernel that can be used in both PowerVM and PowerKVM environments. To accomplish this several changes need to be made.

For PowerVM systems hotplug (DLPAR) events are requested by users from the HMC which then communicates the request to the partitions via the RSCT framework. The RSCT framework then invokes the drmgr command to handle the hotplug event. The drmgr command performs some of the work in user space and makes calls into the kernel to handle the remaining work.

For PowerKVM systems hotplug events are communicated to the guest via the ras epow interrupt by qemu. We could have the rtas event sent up to user space through rtas_errd that would then invoke drmgr. This is not the most ideal solution and it would be nicer to have hotplug handled completely in the kernel.

To do this, hotplug events will now be communicated to the kernel in the form of rtas hotplug events. For PowerKVM systems this is done by qemu using the ras epow interrupt. For PowerVM systems the drmgr command will be updated to create a rtas hotplug event and send it to the kernel via a new /proc/powerpc/dlpar interface. Both of these entry points for hotplug rtas events then call a common routine for handling rtas hotplug events.

Additionally we will need to be able to handle all of the work to do resource hotplug in the kernel. This patch set addresses this for cpu and memory hotplug, pci hotplug will be done later.

Once all of the work is done to move hotplug handling into the kernel we should also be able to get rid of the /proc/powerpc/ofdt interface.

Of course these updates do depend on updating the drmgr command. If you care to look the updates for this is here;

https://github.com/nfont/powerpc-utils/tree/mem_rtas_hp

Patch 1/4:
o Create a common rtas hotplug event handling routine
o Create the /proc/powerpc/dlpar interface for PowerVM systems
o Implement memory hotplug handling in the kernel.

Patch 2/4:
o Move the cpu hotplug code from pseries/dlpar.c to pseries/hotplug-cpu.c

Patch 3/4:
o Update cpu hotplug handling to allow for invocation from rtas event notifications.

Patch 4/4:
o Update the ras epow interrupt handler to recognize hotplug rtas events

This code (except for patch 4/4 which I cannot test right now) has been tested on PowerVM systems. There are some error paths that still need to be tested and of course testing on PowerKVM when cpu and memory hotplug is enabled for Power.

Thoughts?

-Nathan

---
 include/asm/rtas.h                 |   27 ++
 kernel/rtas.c                      |    7 
 platforms/pseries/dlpar.c          |  253 ++++++--------------------
 platforms/pseries/hotplug-cpu.c    |  358 +++++++++++++++++++++++++++++++++++++
 platforms/pseries/hotplug-memory.c |  351 ++++++++++++++++++++++++++++++------ 
 platforms/pseries/pseries.h        |    6                                      
 platforms/pseries/ras.c            |   12 +                                    
 platforms/pseries/reconfig.c       |    6 
 8 files changed, 780 insertions(+), 240 deletions(-)