diff --git a/arch/sw_64/Kconfig b/arch/sw_64/Kconfig index cf2f6f00708c64669537b78371b9af7450a2a67b..f03be9ce50cca0beb2b36d92212d16ce94de0969 100644 --- a/arch/sw_64/Kconfig +++ b/arch/sw_64/Kconfig @@ -97,6 +97,7 @@ config SW64 select HAVE_REGS_AND_STACK_ACCESS_API select ARCH_HAS_PTE_SPECIAL select HARDIRQS_SW_RESEND + select MEMORY_HOTPLUG_SPARSE if MEMORY_HOTPLUG config LOCKDEP_SUPPORT def_bool y diff --git a/arch/sw_64/kernel/Makefile b/arch/sw_64/kernel/Makefile index d4dc9e175d67d21a64b15781e5bf2c09a5df64c3..8cc09dd8fdbc4c95dd60391cd405606d2cde48a1 100644 --- a/arch/sw_64/kernel/Makefile +++ b/arch/sw_64/kernel/Makefile @@ -31,9 +31,13 @@ obj-$(CONFIG_HIBERNATION) += hibernate_asm.o hibernate.o obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_PCI) += pci_common.o obj-$(CONFIG_RELOCATABLE) += relocate.o -obj-$(CONFIG_DEBUG_FS) += segvdbg.o bindvcpu.o +obj-$(CONFIG_DEBUG_FS) += segvdbg.o obj-$(CONFIG_JUMP_LABEL) += jump_label.o +ifeq ($(CONFIG_DEBUG_FS)$(CONFIG_NUMA),yy) +obj-y += bindvcpu.o +endif + ifndef CONFIG_PCI obj-y += pci-noop.o endif diff --git a/arch/sw_64/kvm/Kconfig b/arch/sw_64/kvm/Kconfig index 85323b48f56438f9e237ccf57a9f308cd8d20e1a..4b6201ff5dc80bacfe731c0d3469d847caeaef62 100644 --- a/arch/sw_64/kvm/Kconfig +++ b/arch/sw_64/kvm/Kconfig @@ -44,7 +44,7 @@ config KVM_SW64_HOST config KVM_MEMHOTPLUG bool "Memory hotplug support for guest" - depends on KVM + depends on KVM && MEMORY_HOTPLUG help Provides memory hotplug support for SW64 guest. diff --git a/arch/sw_64/kvm/kvm-sw64.c b/arch/sw_64/kvm/kvm-sw64.c index de81f7efe01a5fa219a4aacc3664c6cefed86704..8ba7e18698b32b1ba0689151cb1e6c993c7d5f09 100644 --- a/arch/sw_64/kvm/kvm-sw64.c +++ b/arch/sw_64/kvm/kvm-sw64.c @@ -21,7 +21,9 @@ bool set_msi_flag; unsigned long sw64_kvm_last_vpn[NR_CPUS]; +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_NUMA) __read_mostly bool bind_vcpu_enabled; +#endif #define cpu_last_vpn(cpuid) sw64_kvm_last_vpn[cpuid] #ifdef CONFIG_SUBARCH_C3B @@ -539,6 +541,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) vcpu->arch.vcb.vpcr = get_vpcr(vcpu->kvm->arch.host_phys_addr, vcpu->kvm->arch.size, 0); +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_NUMA) if (unlikely(bind_vcpu_enabled)) { int nid; unsigned long end; @@ -548,11 +551,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) if (pfn_to_nid(PHYS_PFN(end)) == nid) set_cpus_allowed_ptr(vcpu->arch.tsk, node_to_cpumask_map[nid]); } -#else +#endif +#else /* !CONFIG_KVM_MEMHOTPLUG */ unsigned long seg_base = virt_to_phys(vcpu->kvm->arch.seg_pgd); vcpu->arch.vcb.vpcr = get_vpcr_memhp(seg_base, 0); -#endif +#endif /* CONFIG_KVM_MEMHOTPLUG */ vcpu->arch.vcb.upcr = 0x7; } diff --git a/arch/sw_64/mm/init.c b/arch/sw_64/mm/init.c index 82f2414ef7f77f29cac58323185a12d279a6d87e..e0096a0b432a4ab8cdfd49e30b9d8f869b213e72 100644 --- a/arch/sw_64/mm/init.c +++ b/arch/sw_64/mm/init.c @@ -34,6 +34,7 @@ static pud_t vmalloc_pud[1024] __attribute__((__aligned__(PAGE_SIZE))); static phys_addr_t mem_start; static phys_addr_t mem_size_limit; +#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE unsigned long memory_block_size_bytes(void) { if (is_in_guest()) @@ -41,6 +42,7 @@ unsigned long memory_block_size_bytes(void) else return MIN_MEMORY_BLOCK_SIZE; } +#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ static int __init setup_mem_size(char *p) { diff --git a/arch/sw_64/mm/physaddr.c b/arch/sw_64/mm/physaddr.c index 26769f0bf7bf976a5cee620a4aa77f3f246b15b4..17840f4ef40bea3c26011d239d7c8aa1d5e020fc 100644 --- a/arch/sw_64/mm/physaddr.c +++ b/arch/sw_64/mm/physaddr.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include unsigned long __phys_addr(unsigned long x)