[intel-tdx:kvm-upstream-workaround 693/846] arch/x86/kvm/mmu/mmu.c:7264:27: error: 'struct kvm' has no member named 'mem_attr_array'
From: kernel test robot
Date: Tue Aug 09 2022 - 19:53:31 EST
tree: https://github.com/intel/tdx.git kvm-upstream-workaround
head: 6e62680f6e4094d3986229a4145ebd54390dc110
commit: bb9b2174d4d2edc63bdaf11c0ab09af02f64ca44 [693/846] KVM: Update lpage info when private/shared memory are mixed
config: i386-randconfig-a001-20220808 (https://download.01.org/0day-ci/archive/20220810/202208100759.CNcZjfEI-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/tdx/commit/bb9b2174d4d2edc63bdaf11c0ab09af02f64ca44
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx kvm-upstream-workaround
git checkout bb9b2174d4d2edc63bdaf11c0ab09af02f64ca44
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kvm/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
arch/x86/kvm/mmu/mmu.c: In function 'kvm_mmu_zap_collapsible_spte':
arch/x86/kvm/mmu/mmu.c:6667:19: warning: variable 'pfn' set but not used [-Wunused-but-set-variable]
6667 | kvm_pfn_t pfn;
| ^~~
arch/x86/kvm/mmu/mmu.c: In function 'kvm_mmu_map_gpa':
arch/x86/kvm/mmu/mmu.c:6839:30: error: 'KVM_MEM_ATTR_PRIVATE' undeclared (first use in this function); did you mean 'KVM_MEM_PRIVATE'?
6839 | attr = map_private ? KVM_MEM_ATTR_PRIVATE : KVM_MEM_ATTR_SHARED;
| ^~~~~~~~~~~~~~~~~~~~
| KVM_MEM_PRIVATE
arch/x86/kvm/mmu/mmu.c:6839:30: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/kvm/mmu/mmu.c:6839:53: error: 'KVM_MEM_ATTR_SHARED' undeclared (first use in this function)
6839 | attr = map_private ? KVM_MEM_ATTR_PRIVATE : KVM_MEM_ATTR_SHARED;
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/list_lru.h:14,
from include/linux/fs.h:13,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:700,
from include/linux/kvm_host.h:16,
from arch/x86/kvm/irq.h:15,
from arch/x86/kvm/mmu/mmu.c:18:
arch/x86/kvm/mmu/mmu.c: In function '__mem_attr_is_mixed':
>> arch/x86/kvm/mmu/mmu.c:7264:27: error: 'struct kvm' has no member named 'mem_attr_array'
7264 | XA_STATE(xas, &kvm->mem_attr_array, start);
| ^~
include/linux/xarray.h:1333:15: note: in definition of macro '__XA_STATE'
1333 | .xa = array, \
| ^~~~~
arch/x86/kvm/mmu/mmu.c:7264:9: note: in expansion of macro 'XA_STATE'
7264 | XA_STATE(xas, &kvm->mem_attr_array, start);
| ^~~~~~~~
arch/x86/kvm/mmu/mmu.c: In function 'mem_attr_is_mixed':
arch/x86/kvm/mmu/mmu.c:7308:29: error: 'struct kvm' has no member named 'mem_attr_array'
7308 | entry = xa_load(&kvm->mem_attr_array, start);
| ^~
arch/x86/kvm/mmu/mmu.c:7315:33: error: 'struct kvm' has no member named 'mem_attr_array'
7315 | if (xa_load(&kvm->mem_attr_array, gfn) != entry) {
| ^~
In file included from include/linux/printk.h:10,
from include/linux/kernel.h:29,
from include/linux/cpumask.h:10,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from arch/x86/kvm/irq.h:13,
from arch/x86/kvm/mmu/mmu.c:18:
arch/x86/kvm/mmu/mmu.c: In function 'kvm_arch_update_mem_attr':
arch/x86/kvm/mmu/mmu.c:7369:29: error: 'KVM_MEM_ATTR_PRIVATE' undeclared (first use in this function); did you mean 'KVM_MEM_PRIVATE'?
7369 | WARN_ONCE(!(attr & (KVM_MEM_ATTR_PRIVATE | KVM_MEM_ATTR_SHARED)),
| ^~~~~~~~~~~~~~~~~~~~
include/linux/once_lite.h:15:41: note: in definition of macro 'DO_ONCE_LITE_IF'
15 | bool __ret_do_once = !!(condition); \
| ^~~~~~~~~
arch/x86/kvm/mmu/mmu.c:7369:9: note: in expansion of macro 'WARN_ONCE'
7369 | WARN_ONCE(!(attr & (KVM_MEM_ATTR_PRIVATE | KVM_MEM_ATTR_SHARED)),
| ^~~~~~~~~
arch/x86/kvm/mmu/mmu.c:7369:52: error: 'KVM_MEM_ATTR_SHARED' undeclared (first use in this function)
7369 | WARN_ONCE(!(attr & (KVM_MEM_ATTR_PRIVATE | KVM_MEM_ATTR_SHARED)),
| ^~~~~~~~~~~~~~~~~~~
include/linux/once_lite.h:15:41: note: in definition of macro 'DO_ONCE_LITE_IF'
15 | bool __ret_do_once = !!(condition); \
| ^~~~~~~~~
arch/x86/kvm/mmu/mmu.c:7369:9: note: in expansion of macro 'WARN_ONCE'
7369 | WARN_ONCE(!(attr & (KVM_MEM_ATTR_PRIVATE | KVM_MEM_ATTR_SHARED)),
| ^~~~~~~~~
vim +7264 arch/x86/kvm/mmu/mmu.c
7261
7262 static bool __mem_attr_is_mixed(struct kvm *kvm, gfn_t start, gfn_t end)
7263 {
> 7264 XA_STATE(xas, &kvm->mem_attr_array, start);
7265 bool mixed = false;
7266 gfn_t gfn = start;
7267 void *s_entry;
7268 void *entry;
7269
7270 rcu_read_lock();
7271 s_entry = xas_load(&xas);
7272 while (gfn < end) {
7273 if (xas_retry(&xas, entry))
7274 continue;
7275
7276 KVM_BUG_ON(gfn != xas.xa_index, kvm);
7277
7278 entry = xas_next(&xas);
7279 if (entry != s_entry) {
7280 mixed = true;
7281 break;
7282 }
7283 gfn++;
7284 }
7285 rcu_read_unlock();
7286 return mixed;
7287 }
7288
--
0-DAY CI Kernel Test Service
https://01.org/lkp