From 77aa55d40255be13648cab53c72ea82ad66020a8 Mon Sep 17 00:00:00 2001 From: yangyinglu Date: Mon, 15 May 2023 17:26:28 +0800 Subject: [PATCH 1/2] LoongArch: defconfig: Add memory hotplug support LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I77Q98 -------------------------------- Signed-off-by: lixianglai Signed-off-by: yangyinglu Change-Id: I640f550277271f97317e084aecb03c9a5da3cd01 --- arch/loongarch/Kconfig | 6 ++++++ arch/loongarch/configs/loongson3_defconfig | 4 ++++ arch/loongarch/mm/init.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 56b121c3577c..2f6dbaa12d43 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -594,5 +594,11 @@ source "drivers/cpufreq/Kconfig" endmenu +config ARCH_ENABLE_MEMORY_HOTPLUG + def_bool y + +config ARCH_ENABLE_MEMORY_HOTREMOVE + def_bool y + source "drivers/firmware/Kconfig" source "arch/loongarch/kvm/Kconfig" diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig index e64d09fee827..37626454a6be 100644 --- a/arch/loongarch/configs/loongson3_defconfig +++ b/arch/loongarch/configs/loongson3_defconfig @@ -45,6 +45,7 @@ CONFIG_ACPI_SPCR_TABLE=y CONFIG_ACPI_DOCK=y CONFIG_ACPI_IPMI=m CONFIG_ACPI_PCI_SLOT=y +CONFIG_ACPI_HOTPLUG_MEMORY=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y @@ -66,6 +67,9 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_IOSCHED_BFQ=y CONFIG_BFQ_GROUP_IOSCHED=y CONFIG_BINFMT_MISC=m +CONFIG_MEMORY_HOTPLUG=y +CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y +CONFIG_MEMORY_HOTREMOVE=y CONFIG_KSM=y CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_ZPOOL=y diff --git a/arch/loongarch/mm/init.c b/arch/loongarch/mm/init.c index 5b26c36f00c3..1534617178c0 100644 --- a/arch/loongarch/mm/init.c +++ b/arch/loongarch/mm/init.c @@ -143,7 +143,7 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); #endif #ifdef CONFIG_MEMORY_HOTREMOVE -void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) +void arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap) { unsigned long start_pfn = start >> PAGE_SHIFT; unsigned long nr_pages = size >> PAGE_SHIFT; -- Gitee From e57f9c05d6a5e09e091a5070605af5342b3f018b Mon Sep 17 00:00:00 2001 From: yangyinglu Date: Mon, 15 May 2023 17:35:30 +0800 Subject: [PATCH 2/2] LoongArch: defconfig: Add PCI hotplug support LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I77Q98 -------------------------------- Signed-off-by: lixianglai Signed-off-by: yangyinglu Change-Id: I6b4ca700f830c05c2cf62695c22bb110dd6f017b --- arch/loongarch/configs/loongson3_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig index 37626454a6be..43ec73c9cc2d 100644 --- a/arch/loongarch/configs/loongson3_defconfig +++ b/arch/loongarch/configs/loongson3_defconfig @@ -574,9 +574,9 @@ CONFIG_NET_9P_VIRTIO=y CONFIG_PCIEPORTBUS=y CONFIG_HOTPLUG_PCI_PCIE=y CONFIG_PCIEAER=y -# CONFIG_PCIEASPM is not set CONFIG_PCI_IOV=y CONFIG_HOTPLUG_PCI=y +CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_HOTPLUG_PCI_SHPC=y CONFIG_PCCARD=m CONFIG_YENTA=m -- Gitee