Message ID | 20250312175824.1809636-10-tabba@google.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | KVM: Mapping guest_memfd backed memory at the host for software protected VMs | expand |
Hi Fuad, kernel test robot noticed the following build errors: [auto build test ERROR on 80e54e84911a923c40d7bee33a34c1b4be148d7a] url: https://github.com/intel-lab-lkp/linux/commits/Fuad-Tabba/mm-Consolidate-freeing-of-typed-folios-on-final-folio_put/20250313-020010 base: 80e54e84911a923c40d7bee33a34c1b4be148d7a patch link: https://lore.kernel.org/r/20250312175824.1809636-10-tabba%40google.com patch subject: [PATCH v6 09/10] KVM: arm64: Enable mapping guest_memfd in arm64 config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20250313/202503132205.Ajz52k8I-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250313/202503132205.Ajz52k8I-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202503132205.Ajz52k8I-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from arch/arm64/kernel/asm-offsets.c:15: >> include/linux/kvm_host.h:725:20: error: redefinition of 'kvm_arch_has_private_mem' 725 | static inline bool kvm_arch_has_private_mem(struct kvm *kvm) | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/kvm_host.h:45: arch/arm64/include/asm/kvm_host.h:1546:20: note: previous definition of 'kvm_arch_has_private_mem' with type 'bool(struct kvm *)' {aka '_Bool(struct kvm *)'} 1546 | static inline bool kvm_arch_has_private_mem(struct kvm *kvm) | ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/kvm_host.h:736:20: error: redefinition of 'kvm_arch_gmem_supports_shared_mem' 736 | static inline bool kvm_arch_gmem_supports_shared_mem(struct kvm *kvm) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/include/asm/kvm_host.h:1551:20: note: previous definition of 'kvm_arch_gmem_supports_shared_mem' with type 'bool(struct kvm *)' {aka '_Bool(struct kvm *)'} 1551 | static inline bool kvm_arch_gmem_supports_shared_mem(struct kvm *kvm) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[3]: *** [scripts/Makefile.build:102: arch/arm64/kernel/asm-offsets.s] Error 1 make[3]: Target 'prepare' not remade because of errors. make[2]: *** [Makefile:1269: prepare0] Error 2 make[2]: Target 'prepare' not remade because of errors. make[1]: *** [Makefile:251: __sub-make] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [Makefile:251: __sub-make] Error 2 make: Target 'prepare' not remade because of errors. vim +/kvm_arch_has_private_mem +725 include/linux/kvm_host.h f481b069e674378 Paolo Bonzini 2015-05-17 719 a7800aa80ea4d53 Sean Christopherson 2023-11-13 720 /* a7800aa80ea4d53 Sean Christopherson 2023-11-13 721 * Arch code must define kvm_arch_has_private_mem if support for private memory a7800aa80ea4d53 Sean Christopherson 2023-11-13 722 * is enabled. a7800aa80ea4d53 Sean Christopherson 2023-11-13 723 */ a7800aa80ea4d53 Sean Christopherson 2023-11-13 724 #if !defined(kvm_arch_has_private_mem) && !IS_ENABLED(CONFIG_KVM_PRIVATE_MEM) a7800aa80ea4d53 Sean Christopherson 2023-11-13 @725 static inline bool kvm_arch_has_private_mem(struct kvm *kvm) a7800aa80ea4d53 Sean Christopherson 2023-11-13 726 { a7800aa80ea4d53 Sean Christopherson 2023-11-13 727 return false; a7800aa80ea4d53 Sean Christopherson 2023-11-13 728 } a7800aa80ea4d53 Sean Christopherson 2023-11-13 729 #endif a7800aa80ea4d53 Sean Christopherson 2023-11-13 730 a765e4ca28eb657 Fuad Tabba 2025-03-12 731 /* a765e4ca28eb657 Fuad Tabba 2025-03-12 732 * Arch code must define kvm_arch_gmem_supports_shared_mem if support for a765e4ca28eb657 Fuad Tabba 2025-03-12 733 * private memory is enabled and it supports in-place shared/private conversion. a765e4ca28eb657 Fuad Tabba 2025-03-12 734 */ a765e4ca28eb657 Fuad Tabba 2025-03-12 735 #if !defined(kvm_arch_gmem_supports_shared_mem) && !IS_ENABLED(CONFIG_KVM_GMEM_SHARED_MEM) a765e4ca28eb657 Fuad Tabba 2025-03-12 @736 static inline bool kvm_arch_gmem_supports_shared_mem(struct kvm *kvm) a765e4ca28eb657 Fuad Tabba 2025-03-12 737 { a765e4ca28eb657 Fuad Tabba 2025-03-12 738 return false; a765e4ca28eb657 Fuad Tabba 2025-03-12 739 } a765e4ca28eb657 Fuad Tabba 2025-03-12 740 #endif a765e4ca28eb657 Fuad Tabba 2025-03-12 741
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index d919557af5e5..b3b154b81d97 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -1543,4 +1543,14 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); #define kvm_has_s1poe(k) \ (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP)) +static inline bool kvm_arch_has_private_mem(struct kvm *kvm) +{ + return IS_ENABLED(CONFIG_KVM_PRIVATE_MEM); +} + +static inline bool kvm_arch_gmem_supports_shared_mem(struct kvm *kvm) +{ + return IS_ENABLED(CONFIG_KVM_GMEM_SHARED_MEM); +} + #endif /* __ARM64_KVM_HOST_H__ */ diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index ead632ad01b4..4830d8805bed 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -38,6 +38,7 @@ menuconfig KVM select HAVE_KVM_VCPU_RUN_PID_CHANGE select SCHED_INFO select GUEST_PERF_EVENTS if PERF_EVENTS + select KVM_GMEM_SHARED_MEM help Support hosting virtualized guest machines.
Enable mapping guest_memfd in arm64. For now, it applies to all VMs in arm64 that use guest_memfd. In the future, new VM types can restrict this via kvm_arch_gmem_supports_shared_mem(). Signed-off-by: Fuad Tabba <tabba@google.com> --- arch/arm64/include/asm/kvm_host.h | 10 ++++++++++ arch/arm64/kvm/Kconfig | 1 + 2 files changed, 11 insertions(+)