提交 fc453d57 编写于 作者: M Mao Minkai 提交者: guzitao

sw64: adjust make rules to avoid compile error

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG

--------------------------------

Fix compile errors when CONFIG_NUMA or CONFIG_SPARSEMEM is not set.
Some make rules are changed to avoid potential compile errors.
Signed-off-by: NMao Minkai <maominkai@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 5841266c
...@@ -97,6 +97,7 @@ config SW64 ...@@ -97,6 +97,7 @@ config SW64
select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_REGS_AND_STACK_ACCESS_API
select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_PTE_SPECIAL
select HARDIRQS_SW_RESEND select HARDIRQS_SW_RESEND
select MEMORY_HOTPLUG_SPARSE if MEMORY_HOTPLUG
config LOCKDEP_SUPPORT config LOCKDEP_SUPPORT
def_bool y def_bool y
......
...@@ -31,9 +31,13 @@ obj-$(CONFIG_HIBERNATION) += hibernate_asm.o hibernate.o ...@@ -31,9 +31,13 @@ obj-$(CONFIG_HIBERNATION) += hibernate_asm.o hibernate.o
obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_AUDIT) += audit.o
obj-$(CONFIG_PCI) += pci_common.o obj-$(CONFIG_PCI) += pci_common.o
obj-$(CONFIG_RELOCATABLE) += relocate.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 obj-$(CONFIG_JUMP_LABEL) += jump_label.o
ifeq ($(CONFIG_DEBUG_FS)$(CONFIG_NUMA),yy)
obj-y += bindvcpu.o
endif
ifndef CONFIG_PCI ifndef CONFIG_PCI
obj-y += pci-noop.o obj-y += pci-noop.o
endif endif
......
...@@ -44,7 +44,7 @@ config KVM_SW64_HOST ...@@ -44,7 +44,7 @@ config KVM_SW64_HOST
config KVM_MEMHOTPLUG config KVM_MEMHOTPLUG
bool "Memory hotplug support for guest" bool "Memory hotplug support for guest"
depends on KVM depends on KVM && MEMORY_HOTPLUG
help help
Provides memory hotplug support for SW64 guest. Provides memory hotplug support for SW64 guest.
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
bool set_msi_flag; bool set_msi_flag;
unsigned long sw64_kvm_last_vpn[NR_CPUS]; unsigned long sw64_kvm_last_vpn[NR_CPUS];
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_NUMA)
__read_mostly bool bind_vcpu_enabled; __read_mostly bool bind_vcpu_enabled;
#endif
#define cpu_last_vpn(cpuid) sw64_kvm_last_vpn[cpuid] #define cpu_last_vpn(cpuid) sw64_kvm_last_vpn[cpuid]
#ifdef CONFIG_SUBARCH_C3B #ifdef CONFIG_SUBARCH_C3B
...@@ -539,6 +541,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) ...@@ -539,6 +541,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
vcpu->arch.vcb.vpcr vcpu->arch.vcb.vpcr
= get_vpcr(vcpu->kvm->arch.host_phys_addr, vcpu->kvm->arch.size, 0); = 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)) { if (unlikely(bind_vcpu_enabled)) {
int nid; int nid;
unsigned long end; unsigned long end;
...@@ -548,11 +551,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) ...@@ -548,11 +551,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
if (pfn_to_nid(PHYS_PFN(end)) == nid) if (pfn_to_nid(PHYS_PFN(end)) == nid)
set_cpus_allowed_ptr(vcpu->arch.tsk, node_to_cpumask_map[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); unsigned long seg_base = virt_to_phys(vcpu->kvm->arch.seg_pgd);
vcpu->arch.vcb.vpcr = get_vpcr_memhp(seg_base, 0); vcpu->arch.vcb.vpcr = get_vpcr_memhp(seg_base, 0);
#endif #endif /* CONFIG_KVM_MEMHOTPLUG */
vcpu->arch.vcb.upcr = 0x7; vcpu->arch.vcb.upcr = 0x7;
} }
......
...@@ -34,6 +34,7 @@ static pud_t vmalloc_pud[1024] __attribute__((__aligned__(PAGE_SIZE))); ...@@ -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_start;
static phys_addr_t mem_size_limit; static phys_addr_t mem_size_limit;
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
unsigned long memory_block_size_bytes(void) unsigned long memory_block_size_bytes(void)
{ {
if (is_in_guest()) if (is_in_guest())
...@@ -41,6 +42,7 @@ unsigned long memory_block_size_bytes(void) ...@@ -41,6 +42,7 @@ unsigned long memory_block_size_bytes(void)
else else
return MIN_MEMORY_BLOCK_SIZE; return MIN_MEMORY_BLOCK_SIZE;
} }
#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
static int __init setup_mem_size(char *p) static int __init setup_mem_size(char *p)
{ {
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/mmdebug.h> #include <linux/mmdebug.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mm.h>
#include <asm/page.h> #include <asm/page.h>
unsigned long __phys_addr(unsigned long x) unsigned long __phys_addr(unsigned long x)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册