Re: [PATCH] xen: Remove support for PV ACPI cpu/memory hotplug
On Tue, Apr 13, 2021 at 7:53 PM Boris Ostrovsky wrote: > > Commit 76fc253723ad ("xen/acpi-stub: Disable it b/c the acpi_processor_add > is no longer called.") declared as BROKEN support for Xen ACPI stub (which > is required for xen-acpi-{cpu|memory}-hotplug) and suggested that this > is temporary and will be soon fixed. This was in March 2013. > > Further, commit cfafae940381 ("xen: rename dom0_op to platform_op") > renamed an interface used by memory hotplug code without updating that > code (as it was BROKEN and therefore not compiled). This was > in November 2015 and has gone unnoticed for over 5 year. > > It is now clear that this code is of no interest to anyone and therefore > should be removed. > > Signed-off-by: Boris Ostrovsky Acked-by: Rafael J. Wysocki Thanks for doing this! > --- > drivers/xen/Kconfig | 31 --- > drivers/xen/Makefile | 3 - > drivers/xen/pcpu.c| 35 --- > drivers/xen/xen-acpi-cpuhotplug.c | 446 --- > drivers/xen/xen-acpi-memhotplug.c | 475 > -- > drivers/xen/xen-stub.c| 90 > include/xen/acpi.h| 35 --- > 7 files changed, 1115 deletions(-) > delete mode 100644 drivers/xen/xen-acpi-cpuhotplug.c > delete mode 100644 drivers/xen/xen-acpi-memhotplug.c > delete mode 100644 drivers/xen/xen-stub.c > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > index ea0efd290c37..5f1ce59b44b9 100644 > --- a/drivers/xen/Kconfig > +++ b/drivers/xen/Kconfig > @@ -238,37 +238,6 @@ config XEN_PRIVCMD > depends on XEN > default m > > -config XEN_STUB > - bool "Xen stub drivers" > - depends on XEN && X86_64 && BROKEN > - help > - Allow kernel to install stub drivers, to reserve space for Xen > drivers, > - i.e. memory hotplug and cpu hotplug, and to block native drivers > loaded, > - so that real Xen drivers can be modular. > - > - To enable Xen features like cpu and memory hotplug, select Y here. > - > -config XEN_ACPI_HOTPLUG_MEMORY > - tristate "Xen ACPI memory hotplug" > - depends on XEN_DOM0 && XEN_STUB && ACPI > - help > - This is Xen ACPI memory hotplug. > - > - Currently Xen only support ACPI memory hot-add. If you want > - to hot-add memory at runtime (the hot-added memory cannot be > - removed until machine stop), select Y/M here, otherwise select N. > - > -config XEN_ACPI_HOTPLUG_CPU > - tristate "Xen ACPI cpu hotplug" > - depends on XEN_DOM0 && XEN_STUB && ACPI > - select ACPI_CONTAINER > - help > - Xen ACPI cpu enumerating and hotplugging > - > - For hotplugging, currently Xen only support ACPI cpu hotadd. > - If you want to hotadd cpu at runtime (the hotadded cpu cannot > - be removed until machine stop), select Y/M here. > - > config XEN_ACPI_PROCESSOR > tristate "Xen ACPI processor" > depends on XEN && XEN_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ > diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile > index c3621b9f4012..3434593455b2 100644 > --- a/drivers/xen/Makefile > +++ b/drivers/xen/Makefile > @@ -26,9 +26,6 @@ obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o > obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o > obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/ > obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o > -obj-$(CONFIG_XEN_STUB) += xen-stub.o > -obj-$(CONFIG_XEN_ACPI_HOTPLUG_MEMORY) += xen-acpi-memhotplug.o > -obj-$(CONFIG_XEN_ACPI_HOTPLUG_CPU) += xen-acpi-cpuhotplug.o > obj-$(CONFIG_XEN_ACPI_PROCESSOR) += xen-acpi-processor.o > obj-$(CONFIG_XEN_EFI) += efi.o > obj-$(CONFIG_XEN_SCSI_BACKEND) += xen-scsiback.o > diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c > index cdc6daa7a9f6..1bcdd5227771 100644 > --- a/drivers/xen/pcpu.c > +++ b/drivers/xen/pcpu.c > @@ -345,41 +345,6 @@ static irqreturn_t xen_pcpu_interrupt(int irq, void > *dev_id) > return IRQ_HANDLED; > } > > -/* Sync with Xen hypervisor after cpu hotadded */ > -void xen_pcpu_hotplug_sync(void) > -{ > - schedule_work(&xen_pcpu_work); > -} > -EXPORT_SYMBOL_GPL(xen_pcpu_hotplug_sync); > - > -/* > - * For hypervisor presented cpu, return logic cpu id; > - * For hypervisor non-presented cpu, return -ENODEV. > - */ > -int xen_pcpu_id(uint32_t acpi_id) > -{ > - int cpu_id = 0, max_id = 0; > - struct xen_platform_op op; > - > - op.cmd = XENPF_get_cpuinfo; > - while (cpu_id <= max_id) { > - op.u.pcpu_info.xen_cpuid = cpu_id; > - if (HYPERVISOR_platform_op(&op)) { > - cpu_id++; > - continue; > - } > - > - if (acpi_id == op.u.pcpu_info.acpi_id) > - return cpu_id; > - if (op.u.pcpu_info.max_present > max_id)
[PATCH] xen: Remove support for PV ACPI cpu/memory hotplug
Commit 76fc253723ad ("xen/acpi-stub: Disable it b/c the acpi_processor_add is no longer called.") declared as BROKEN support for Xen ACPI stub (which is required for xen-acpi-{cpu|memory}-hotplug) and suggested that this is temporary and will be soon fixed. This was in March 2013. Further, commit cfafae940381 ("xen: rename dom0_op to platform_op") renamed an interface used by memory hotplug code without updating that code (as it was BROKEN and therefore not compiled). This was in November 2015 and has gone unnoticed for over 5 year. It is now clear that this code is of no interest to anyone and therefore should be removed. Signed-off-by: Boris Ostrovsky --- drivers/xen/Kconfig | 31 --- drivers/xen/Makefile | 3 - drivers/xen/pcpu.c| 35 --- drivers/xen/xen-acpi-cpuhotplug.c | 446 --- drivers/xen/xen-acpi-memhotplug.c | 475 -- drivers/xen/xen-stub.c| 90 include/xen/acpi.h| 35 --- 7 files changed, 1115 deletions(-) delete mode 100644 drivers/xen/xen-acpi-cpuhotplug.c delete mode 100644 drivers/xen/xen-acpi-memhotplug.c delete mode 100644 drivers/xen/xen-stub.c diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index ea0efd290c37..5f1ce59b44b9 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -238,37 +238,6 @@ config XEN_PRIVCMD depends on XEN default m -config XEN_STUB - bool "Xen stub drivers" - depends on XEN && X86_64 && BROKEN - help - Allow kernel to install stub drivers, to reserve space for Xen drivers, - i.e. memory hotplug and cpu hotplug, and to block native drivers loaded, - so that real Xen drivers can be modular. - - To enable Xen features like cpu and memory hotplug, select Y here. - -config XEN_ACPI_HOTPLUG_MEMORY - tristate "Xen ACPI memory hotplug" - depends on XEN_DOM0 && XEN_STUB && ACPI - help - This is Xen ACPI memory hotplug. - - Currently Xen only support ACPI memory hot-add. If you want - to hot-add memory at runtime (the hot-added memory cannot be - removed until machine stop), select Y/M here, otherwise select N. - -config XEN_ACPI_HOTPLUG_CPU - tristate "Xen ACPI cpu hotplug" - depends on XEN_DOM0 && XEN_STUB && ACPI - select ACPI_CONTAINER - help - Xen ACPI cpu enumerating and hotplugging - - For hotplugging, currently Xen only support ACPI cpu hotadd. - If you want to hotadd cpu at runtime (the hotadded cpu cannot - be removed until machine stop), select Y/M here. - config XEN_ACPI_PROCESSOR tristate "Xen ACPI processor" depends on XEN && XEN_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile index c3621b9f4012..3434593455b2 100644 --- a/drivers/xen/Makefile +++ b/drivers/xen/Makefile @@ -26,9 +26,6 @@ obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/ obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o -obj-$(CONFIG_XEN_STUB) += xen-stub.o -obj-$(CONFIG_XEN_ACPI_HOTPLUG_MEMORY) += xen-acpi-memhotplug.o -obj-$(CONFIG_XEN_ACPI_HOTPLUG_CPU) += xen-acpi-cpuhotplug.o obj-$(CONFIG_XEN_ACPI_PROCESSOR) += xen-acpi-processor.o obj-$(CONFIG_XEN_EFI) += efi.o obj-$(CONFIG_XEN_SCSI_BACKEND) += xen-scsiback.o diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index cdc6daa7a9f6..1bcdd5227771 100644 --- a/drivers/xen/pcpu.c +++ b/drivers/xen/pcpu.c @@ -345,41 +345,6 @@ static irqreturn_t xen_pcpu_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -/* Sync with Xen hypervisor after cpu hotadded */ -void xen_pcpu_hotplug_sync(void) -{ - schedule_work(&xen_pcpu_work); -} -EXPORT_SYMBOL_GPL(xen_pcpu_hotplug_sync); - -/* - * For hypervisor presented cpu, return logic cpu id; - * For hypervisor non-presented cpu, return -ENODEV. - */ -int xen_pcpu_id(uint32_t acpi_id) -{ - int cpu_id = 0, max_id = 0; - struct xen_platform_op op; - - op.cmd = XENPF_get_cpuinfo; - while (cpu_id <= max_id) { - op.u.pcpu_info.xen_cpuid = cpu_id; - if (HYPERVISOR_platform_op(&op)) { - cpu_id++; - continue; - } - - if (acpi_id == op.u.pcpu_info.acpi_id) - return cpu_id; - if (op.u.pcpu_info.max_present > max_id) - max_id = op.u.pcpu_info.max_present; - cpu_id++; - } - - return -ENODEV; -} -EXPORT_SYMBOL_GPL(xen_pcpu_id); - static int __init xen_pcpu_init(void) { int irq, ret; diff --git a/drivers/xen/xen-acpi-cpuhotplug.c b/drivers/xen/xen-acpi-cpuhotplug.c deleted file mode 100644 index 00ab1ece0