tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git 
kvm-arm64/nv-wip-v5.0-rc1
head:   688c386ca096f2c1f2eee386697586c88df5d5bc
commit: 4d8a6cc25603cc92352d861970f1a678411af963 [46/75] KVM: arm64: nv: Move 
last_vcpu_ran to be per s2 mmu
config: arm-axm55xx_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 4d8a6cc25603cc92352d861970f1a678411af963
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm 

All error/warnings (new ones prefixed by >>):

   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 'kvm_arch_init_vm':
>> arch/arm/kvm/../../../virt/kvm/arm/arm.c:125:8: error: implicit declaration 
>> of function 'kvm_init_stage2_mmu'; did you mean 'kvm_free_stage2_pgd'? 
>> [-Werror=implicit-function-declaration]
     ret = kvm_init_stage2_mmu(kvm, &kvm->arch.mmu);
           ^~~~~~~~~~~~~~~~~~~
           kvm_free_stage2_pgd
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:125:43: error: 'struct kvm_arch' 
has no member named 'mmu'
     ret = kvm_init_stage2_mmu(kvm, &kvm->arch.mmu);
                                              ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:129:11: error: 'struct kvm_arch' 
has no member named 'nested_mmus'
     kvm->arch.nested_mmus = NULL;
              ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:130:11: error: 'struct kvm_arch' 
has no member named 'nested_mmus_size'
     kvm->arch.nested_mmus_size = 0;
              ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:144:32: error: 'struct kvm_arch' 
has no member named 'mmu'
     kvm_free_stage2_pgd(&kvm->arch.mmu);
                                   ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 'kvm_arch_vcpu_init':
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:343:12: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
     vcpu->arch.hw_mmu = &vcpu->kvm->arch.mmu;
               ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:343:38: error: 'struct kvm_arch' 
has no member named 'mmu'
     vcpu->arch.hw_mmu = &vcpu->kvm->arch.mmu;
                                         ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 'kvm_arch_vcpu_load':
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:352:2: error: implicit declaration 
of function 'kvm_vcpu_load_hw_mmu'; did you mean 'kvm_vcpu_load_sysregs'? 
[-Werror=implicit-function-declaration]
     kvm_vcpu_load_hw_mmu(vcpu);
     ^~~~~~~~~~~~~~~~~~~~
     kvm_vcpu_load_sysregs
   In file included from include/asm-generic/percpu.h:7:0,
                    from arch/arm/include/asm/percpu.h:50,
                    from include/linux/percpu.h:13,
                    from include/linux/context_tracking_state.h:5,
                    from include/linux/vtime.h:5,
                    from include/linux/hardirq.h:8,
                    from include/linux/kvm_host.h:10,
                    from arch/arm/kvm/../../../virt/kvm/arm/arm.c:23:
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:36: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                                       ^
   include/linux/percpu-defs.h:219:47: note: in definition of macro 
'__verify_pcpu_ptr'
     const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
                                                  ^~~
>> arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:13: note: in expansion of macro 
>> 'this_cpu_ptr'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                ^~~~~~~~~~~~
   In file included from include/linux/compiler_types.h:68:0,
                    from <command-line>:0:
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:36: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                                       ^
   include/linux/compiler-gcc.h:57:34: note: in definition of macro 'RELOC_HIDE'
     __asm__ ("" : "=r"(__ptr) : "0"(ptr));    \
                                     ^~~
   include/linux/percpu-defs.h:249:2: note: in expansion of macro 
'SHIFT_PERCPU_PTR'
     SHIFT_PERCPU_PTR(ptr, my_cpu_offset);    \
     ^~~~~~~~~~~~~~~~
>> arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:13: note: in expansion of macro 
>> 'this_cpu_ptr'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                ^~~~~~~~~~~~
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:36: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                                       ^
   include/linux/compiler-gcc.h:57:34: note: in definition of macro 'RELOC_HIDE'
     __asm__ ("" : "=r"(__ptr) : "0"(ptr));    \
                                     ^~~
   include/linux/percpu-defs.h:249:2: note: in expansion of macro 
'SHIFT_PERCPU_PTR'
     SHIFT_PERCPU_PTR(ptr, my_cpu_offset);    \
     ^~~~~~~~~~~~~~~~
>> arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:13: note: in expansion of macro 
>> 'this_cpu_ptr'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                ^~~~~~~~~~~~
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:36: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                                       ^
   include/linux/compiler-gcc.h:58:10: note: in definition of macro 'RELOC_HIDE'
     (typeof(ptr)) (__ptr + (off));     \
             ^~~
   include/linux/percpu-defs.h:249:2: note: in expansion of macro 
'SHIFT_PERCPU_PTR'
     SHIFT_PERCPU_PTR(ptr, my_cpu_offset);    \
     ^~~~~~~~~~~~~~~~
>> arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:13: note: in expansion of macro 
>> 'this_cpu_ptr'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                ^~~~~~~~~~~~
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:36: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                                       ^
   include/linux/compiler-gcc.h:58:10: note: in definition of macro 'RELOC_HIDE'
     (typeof(ptr)) (__ptr + (off));     \
             ^~~
   include/linux/percpu-defs.h:249:2: note: in expansion of macro 
'SHIFT_PERCPU_PTR'
     SHIFT_PERCPU_PTR(ptr, my_cpu_offset);    \
     ^~~~~~~~~~~~~~~~
>> arch/arm/kvm/../../../virt/kvm/arm/arm.c:354:13: note: in expansion of macro 
>> 'this_cpu_ptr'
     last_ran = this_cpu_ptr(vcpu->arch.hw_mmu->last_vcpu_ran);
                ^~~~~~~~~~~~
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:361:39: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
      u64 vttbr = kvm_get_vttbr(vcpu->arch.hw_mmu);
                                          ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 'kvm_arch_vcpu_put':
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:389:2: error: implicit declaration 
of function 'kvm_vcpu_put_hw_mmu'; did you mean 'kvm_vcpu_dabt_is_cm'? 
[-Werror=implicit-function-declaration]
     kvm_vcpu_put_hw_mmu(vcpu);
     ^~~~~~~~~~~~~~~~~~~
     kvm_vcpu_dabt_is_cm
   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 
'kvm_arch_vcpu_ioctl_run':
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:672:26: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
      update_vmid(&vcpu->arch.hw_mmu->vmid);
                             ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:721:48: error: 'struct 
kvm_vcpu_arch' has no member named 'hw_mmu'
      if (ret <= 0 || need_new_vmid_gen(&vcpu->arch.hw_mmu->vmid) ||
                                                   ^
   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 'kvm_vcpu_set_target':
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:956:15: error: 
'KVM_ARM_VCPU_NESTED_VIRT' undeclared (first use in this function); did you 
mean 'KVM_ARM_VCPU_TIMER_CTRL'?
     if (test_bit(KVM_ARM_VCPU_NESTED_VIRT, vcpu->arch.features)) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~
                  KVM_ARM_VCPU_TIMER_CTRL
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:956:15: note: each undeclared 
identifier is reported only once for each function it appears in
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:959:8: error: implicit declaration 
of function 'cpus_have_const_cap'; did you mean 'cpu_have_feature'? 
[-Werror=implicit-function-declaration]
      if (!cpus_have_const_cap(ARM64_HAS_NESTED_VIRT))
           ^~~~~~~~~~~~~~~~~~~
           cpu_have_feature
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:959:28: error: 
'ARM64_HAS_NESTED_VIRT' undeclared (first use in this function); did you mean 
'KVM_ARM_VCPU_NESTED_VIRT'?
      if (!cpus_have_const_cap(ARM64_HAS_NESTED_VIRT))
                               ^~~~~~~~~~~~~~~~~~~~~
                               KVM_ARM_VCPU_NESTED_VIRT
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:962:9: error: implicit declaration 
of function 'kvm_vcpu_init_nested'; did you mean 'kvm_vcpu_initialized'? 
[-Werror=implicit-function-declaration]
      ret = kvm_vcpu_init_nested(vcpu);
            ^~~~~~~~~~~~~~~~~~~~
            kvm_vcpu_initialized
   arch/arm/kvm/../../../virt/kvm/arm/arm.c: In function 
'kvm_arch_vcpu_ioctl_vcpu_init':
   arch/arm/kvm/../../../virt/kvm/arm/arm.c:986:3: error: implicit declaration 
of function 'kvm_nested_s2_clear'; did you mean '__nodes_clear'? 
[-Werror=implicit-function-declaration]
      kvm_nested_s2_clear(vcpu->kvm);
      ^~~~~~~~~~~~~~~~~~~
      __nodes_clear
   cc1: some warnings being treated as errors

vim +125 arch/arm/kvm/../../../virt/kvm/arm/arm.c

  > 23  #include <linux/kvm_host.h>
    24  #include <linux/list.h>
    25  #include <linux/module.h>
    26  #include <linux/vmalloc.h>
    27  #include <linux/fs.h>
    28  #include <linux/mman.h>
    29  #include <linux/sched.h>
    30  #include <linux/kvm.h>
    31  #include <linux/kvm_irqfd.h>
    32  #include <linux/irqbypass.h>
    33  #include <linux/sched/stat.h>
    34  #include <trace/events/kvm.h>
    35  #include <kvm/arm_pmu.h>
    36  #include <kvm/arm_psci.h>
    37  
    38  #define CREATE_TRACE_POINTS
    39  #include "trace.h"
    40  
    41  #include <linux/uaccess.h>
    42  #include <asm/ptrace.h>
    43  #include <asm/mman.h>
    44  #include <asm/tlbflush.h>
    45  #include <asm/cacheflush.h>
    46  #include <asm/cpufeature.h>
    47  #include <asm/virt.h>
    48  #include <asm/kvm_arm.h>
    49  #include <asm/kvm_asm.h>
    50  #include <asm/kvm_mmu.h>
    51  #include <asm/kvm_emulate.h>
    52  #include <asm/kvm_coproc.h>
    53  #include <asm/sections.h>
    54  
    55  #ifdef REQUIRES_VIRT
    56  __asm__(".arch_extension        virt");
    57  #endif
    58  
    59  DEFINE_PER_CPU(kvm_cpu_context_t, kvm_host_cpu_state);
    60  static DEFINE_PER_CPU(unsigned long, kvm_arm_hyp_stack_page);
    61  
    62  /* Per-CPU variable containing the currently running vcpu. */
    63  static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
    64  
    65  /* The VMID used in the VTTBR */
    66  static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
    67  static u32 kvm_next_vmid;
    68  static DEFINE_SPINLOCK(kvm_vmid_lock);
    69  
    70  static bool vgic_present;
    71  
    72  static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled);
    73  
    74  static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
    75  {
    76          __this_cpu_write(kvm_arm_running_vcpu, vcpu);
    77  }
    78  
    79  DEFINE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
    80  
    81  /**
    82   * kvm_arm_get_running_vcpu - get the vcpu running on the current CPU.
    83   * Must be called from non-preemptible context
    84   */
    85  struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
    86  {
    87          return __this_cpu_read(kvm_arm_running_vcpu);
    88  }
    89  
    90  /**
    91   * kvm_arm_get_running_vcpus - get the per-CPU array of currently 
running vcpus.
    92   */
    93  struct kvm_vcpu * __percpu *kvm_get_running_vcpus(void)
    94  {
    95          return &kvm_arm_running_vcpu;
    96  }
    97  
    98  int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
    99  {
   100          return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE;
   101  }
   102  
   103  int kvm_arch_hardware_setup(void)
   104  {
   105          return 0;
   106  }
   107  
   108  void kvm_arch_check_processor_compat(void *rtn)
   109  {
   110          *(int *)rtn = 0;
   111  }
   112  
   113  /**
   114   * kvm_arch_init_vm - initializes a VM data structure
   115   * @kvm:        pointer to the KVM struct
   116   */
   117  int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
   118  {
   119          int ret;
   120  
   121          ret = kvm_arm_setup_stage2(kvm, type);
   122          if (ret)
   123                  return ret;
   124  
 > 125          ret = kvm_init_stage2_mmu(kvm, &kvm->arch.mmu);
   126          if (ret)
   127                  return ret;
   128  
   129          kvm->arch.nested_mmus = NULL;
   130          kvm->arch.nested_mmus_size = 0;
   131  
   132          ret = create_hyp_mappings(kvm, kvm + 1, PAGE_HYP);
   133          if (ret)
   134                  goto out_free_stage2_pgd;
   135  
   136          kvm_vgic_early_init(kvm);
   137  
   138          /* The maximum number of VCPUs is limited by the host's GIC 
model */
   139          kvm->arch.max_vcpus = vgic_present ?
   140                                  kvm_vgic_get_max_vcpus() : 
KVM_MAX_VCPUS;
   141  
   142          return ret;
   143  out_free_stage2_pgd:
   144          kvm_free_stage2_pgd(&kvm->arch.mmu);
   145          return ret;
   146  }
   147  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to