version 2 of the patch set with updates from comments.
The Dynamic Logical Partitioning (DLPAR) capabilities of the powerpc pseries
platform allows for the addition and removal of resources (i.e. cpus,
memory, pci devices) from a partition. The removal of a resource involves
removing the resource's node from the device tree and then returning the
resource to firmware via the rtas set-indicator call. To add a resource, it
is first obtained from firmware via the rtas set-indicator call and then a
new device tree node is created using the ibm,configure-coinnector rtas call
and added to the device tree.
The following set of patches implements the needed infrastructure to have the
kernel handle the DLPAR addition and removal of cpus (other DLPAR'able items to follow in future patches). The framework for this is to create a set of probe/release sysfs files that will facilitate arch-specific call-outs to handle addition and removal of cpus to the system.
-Nathan Fontenot
1/3 - powerpc/pseries kernel DLPAR infrastructure
2/3 - Create probe/release sysfs files and the powerpc handlers
3/3 - powerpc/pseries CPU DLPAR handling
arch/powerpc/Kconfig | 4 arch/powerpc/include/asm/machdep.h | 5 arch/powerpc/include/asm/pSeries_reconfig.h | 1 arch/powerpc/kernel/smp.c | 17 arch/powerpc/kernel/sysfs.c | 19 +
arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/dlpar.c | 500 +++++++++++++++++++++++++++-
arch/powerpc/platforms/pseries/reconfig.c | 2 drivers/base/cpu.c | 33 +
include/linux/cpu.h | 4
10 files changed, 581 insertions(+), 6 deletions(-)
The Dynamic Logical Partitioning capabilities of the powerpc pseries platform
allows for the addition and removal of resources (i.e. CPU's, memory, and PCI
devices) from a partition. The removal of a resource involves
removing the resource's node from the device tree and then returning the
resource to firmware via the rtas set-indicator call. To add a resource, it
is first obtained from firmware via the rtas set-indicator call and then a
new device tree node is created using the ibm,configure-coinnector rtas call
and added to the device tree.
This patch provides the kernel DLPAR infrastructure in a new filed named
dlpar.c. The functionality provided is for acquiring and releasing a resource
from firmware and the parsing of information returned from the
ibm,configure-connector rtas call. Additionally this exports the pSeries
reconfiguration notifier chain so that it can be invoked when device tree updates are made.
Signed-off-by: Nathan Fontenot <redacted> ---
arch/powerpc/include/asm/pSeries_reconfig.h | 1 arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/dlpar.c | 344 ++++++++++++++++++++++++++++
arch/powerpc/platforms/pseries/reconfig.c | 2 4 files changed, 347 insertions(+), 2 deletions(-)
Index: powerpc/arch/powerpc/platforms/pseries/dlpar.c
===================================================================
In order to support kernel DLPAR of CPU resources we need to provide an
interface to add (probe) and remove (release) the resource from the system.
This patch Creates new generic probe and release sysfs files to facilitate
cpu probe/release. The probe/release interface provides for allowing each
arch to supply their own routines for implementing the backend of adding
and removing cpus to/from the system.
This also creates the powerpc specific stubs to handle the arch callouts from writes to the sysfs files.
The creation and use of these files is regulated by the CONFIG_ARCH_CPU_PROBE_RELEASE option so that only architectures that need the
capability will have the files created.
Signed-off-by: Nathan Fontenot <redacted>
---
arch/powerpc/Kconfig | 4 ++++
arch/powerpc/include/asm/machdep.h | 5 +++++
arch/powerpc/kernel/sysfs.c | 19 +++++++++++++++++++
drivers/base/cpu.c | 32 ++++++++++++++++++++++++++++++++
include/linux/cpu.h | 2 ++
5 files changed, 62 insertions(+)
Index: powerpc/drivers/base/cpu.c
===================================================================
Say N if you are unsure.
+config ARCH_CPU_PROBE_RELEASE
+ def_bool y
+ depends on HOTPLUG_CPU
+
config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
Index: powerpc/include/linux/cpu.h
===================================================================
This patch adds the specific routines to probe and release (add and remove)
cpu resource for the powerpc pseries platform and registers these handlers
with the ppc_md callout structure.
Signed-off-by: Nathan Fontenot <redacted>
---
arch/powerpc/platforms/pseries/dlpar.c | 88 +++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
Index: powerpc/arch/powerpc/platforms/pseries/dlpar.c
===================================================================
On Wed, Nov 25, 2009 at 01:12:21AM -0600, Nathan Fontenot wrote:
In order to support kernel DLPAR of CPU resources we need to provide an
interface to add (probe) and remove (release) the resource from the system.
This patch Creates new generic probe and release sysfs files to facilitate
cpu probe/release. The probe/release interface provides for allowing each
arch to supply their own routines for implementing the backend of adding
and removing cpus to/from the system.
This also creates the powerpc specific stubs to handle the arch callouts
from writes to the sysfs files.
Can you document these new sysfs files with some information in the
Documentation/ABI/ directory please?
thanks,
greg k-h
From: Paul Mackerras <hidden> Date: 2009-11-26 03:00:44
Nathan Fontenot writes:
In order to support kernel DLPAR of CPU resources we need to provide an
interface to add (probe) and remove (release) the resource from the system.
This patch Creates new generic probe and release sysfs files to facilitate
cpu probe/release. The probe/release interface provides for allowing each
arch to supply their own routines for implementing the backend of adding
and removing cpus to/from the system.
This also creates the powerpc specific stubs to handle the arch callouts
from writes to the sysfs files.
The creation and use of these files is regulated by the
CONFIG_ARCH_CPU_PROBE_RELEASE option so that only architectures that need the
capability will have the files created.
Signed-off-by: Nathan Fontenot <redacted>
From: Paul Mackerras <hidden> Date: 2009-11-26 03:00:45
Nathan Fontenot writes:
This patch adds the specific routines to probe and release (add and remove)
cpu resource for the powerpc pseries platform and registers these handlers
with the ppc_md callout structure.
Signed-off-by: Nathan Fontenot <redacted>
From: Paul Mackerras <hidden> Date: 2009-11-26 03:00:58
Nathan Fontenot writes:
The Dynamic Logical Partitioning capabilities of the powerpc pseries platform
allows for the addition and removal of resources (i.e. CPU's, memory, and PCI
devices) from a partition. The removal of a resource involves
removing the resource's node from the device tree and then returning the
resource to firmware via the rtas set-indicator call. To add a resource, it
is first obtained from firmware via the rtas set-indicator call and then a
new device tree node is created using the ibm,configure-coinnector rtas call
and added to the device tree.
This patch provides the kernel DLPAR infrastructure in a new filed named
dlpar.c. The functionality provided is for acquiring and releasing a resource
from firmware and the parsing of information returned from the
ibm,configure-connector rtas call. Additionally this exports the pSeries
reconfiguration notifier chain so that it can be invoked when device tree
updates are made.
Signed-off-by: Nathan Fontenot <redacted>
Version 3 of this patch is updated with documentation added to
Documentation/ABI. There are no changes to any of the C code from v2
of the patch.
In order to support kernel DLPAR of CPU resources we need to provide an
interface to add (probe) and remove (release) the resource from the system.
This patch Creates new generic probe and release sysfs files to facilitate
cpu probe/release. The probe/release interface provides for allowing each
arch to supply their own routines for implementing the backend of adding
and removing cpus to/from the system.
This also creates the powerpc specific stubs to handle the arch callouts from writes to the sysfs files.
The creation and use of these files is regulated by the CONFIG_ARCH_CPU_PROBE_RELEASE option so that only architectures that need the
capability will have the files created.
Signed-off-by: Nathan Fontenot <redacted> ---
Documentation/ABI/testing/sysfs-devices-system-cpu | 15 +++++++++
arch/powerpc/Kconfig | 4 ++
arch/powerpc/include/asm/machdep.h | 5 +++
arch/powerpc/kernel/sysfs.c | 19 ++++++++++++
drivers/base/cpu.c | 32 +++++++++++++++++++++
include/linux/cpu.h | 2 +
6 files changed, 77 insertions(+)
Index: powerpc/drivers/base/cpu.c
===================================================================
Say N if you are unsure.
+config ARCH_CPU_PROBE_RELEASE
+ def_bool y
+ depends on HOTPLUG_CPU
+
config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
Index: powerpc/include/linux/cpu.h
===================================================================
See Documentation/cputopology.txt for more information.
+What: /sys/devices/system/cpu/probe
+ /sys/devices/system/cpu/release
+Date: November 2009
+Contact: Linux kernel mailing list [off-list ref]
+Description: Dynamic addition and removal of CPU's. This is not hotplug
+ removal, this is meant complete removal/addition of the CPU
+ from the system.
+
+ probe: writes to this file will dynamically add a CPU to the
+ system. Information written to the file to add CPU's is
+ architecture specific.
+
+ release: writes to this file dynamically remove a CPU from
+ the system. Information writtento the file to remove CPU's
+ is architecture specific.
What: /sys/devices/system/cpu/cpu#/node
Date: October 2009