All of lore.kernel.org
 help / color / mirror / Atom feed
* [xinli-intel-fred-public:intel-lkp 15/34] arch/x86/kvm/vmx/vmx.c:1515:81: error: 'DB' undeclared; did you mean 'DS'?
@ 2024-08-19 16:09 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-08-19 16:09 UTC (permalink / raw)
  To: Xin3 Li; +Cc: oe-kbuild-all

tree:   https://github.com/xinli-intel/linux-fred-public.git intel-lkp
head:   ae58d028f319b7fde38a21d188e30e46471e1e3c
commit: 4584c853845ae8950025fa5e40335060a2eec7a3 [15/34] KVM: VMX: Initialize VMCS FRED fields
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240820/202408200026.ytNs3H4F-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240820/202408200026.ytNs3H4F-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/202408200026.ytNs3H4F-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/x86/include/asm/pgtable_32_areas.h:4,
                    from arch/x86/include/asm/pgtable_areas.h:5,
                    from arch/x86/include/asm/highmem.h:29,
                    from include/linux/highmem-internal.h:25,
                    from include/linux/highmem.h:14,
                    from arch/x86/kvm/vmx/vmx.c:17:
   arch/x86/kvm/vmx/vmx.c: In function 'vmx_vcpu_load_vmcs':
>> arch/x86/include/asm/cpu_entry_area.h:148:9: error: implicit declaration of function 'CEA_ESTACK_TOP'; did you mean 'STACK_TOP'? [-Werror=implicit-function-declaration]
     148 |         CEA_ESTACK_TOP(__this_cpu_read(cea_exception_stacks), name)
         |         ^~~~~~~~~~~~~~
   arch/x86/kvm/vmx/vmx.c:1515:59: note: in expansion of macro '__this_cpu_ist_top_va'
    1515 |                         vmcs_write64(HOST_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
         |                                                           ^~~~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/vmx/vmx.c:1515:81: error: 'DB' undeclared (first use in this function); did you mean 'DS'?
    1515 |                         vmcs_write64(HOST_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
         |                                                                                 ^~
   arch/x86/include/asm/cpu_entry_area.h:148:63: note: in definition of macro '__this_cpu_ist_top_va'
     148 |         CEA_ESTACK_TOP(__this_cpu_read(cea_exception_stacks), name)
         |                                                               ^~~~
   arch/x86/kvm/vmx/vmx.c:1515:81: note: each undeclared identifier is reported only once for each function it appears in
    1515 |                         vmcs_write64(HOST_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
         |                                                                                 ^~
   arch/x86/include/asm/cpu_entry_area.h:148:63: note: in definition of macro '__this_cpu_ist_top_va'
     148 |         CEA_ESTACK_TOP(__this_cpu_read(cea_exception_stacks), name)
         |                                                               ^~~~
>> arch/x86/kvm/vmx/vmx.c:1516:81: error: 'NMI' undeclared (first use in this function)
    1516 |                         vmcs_write64(HOST_IA32_FRED_RSP2, __this_cpu_ist_top_va(NMI));
         |                                                                                 ^~~
   arch/x86/include/asm/cpu_entry_area.h:148:63: note: in definition of macro '__this_cpu_ist_top_va'
     148 |         CEA_ESTACK_TOP(__this_cpu_read(cea_exception_stacks), name)
         |                                                               ^~~~
>> arch/x86/kvm/vmx/vmx.c:1517:81: error: 'DF' undeclared (first use in this function); did you mean 'DS'?
    1517 |                         vmcs_write64(HOST_IA32_FRED_RSP3, __this_cpu_ist_top_va(DF));
         |                                                                                 ^~
   arch/x86/include/asm/cpu_entry_area.h:148:63: note: in definition of macro '__this_cpu_ist_top_va'
     148 |         CEA_ESTACK_TOP(__this_cpu_read(cea_exception_stacks), name)
         |                                                               ^~~~
   cc1: some warnings being treated as errors


vim +1515 arch/x86/kvm/vmx/vmx.c

  1449	
  1450	void vmx_vcpu_load_vmcs(struct kvm_vcpu *vcpu, int cpu,
  1451				struct loaded_vmcs *buddy)
  1452	{
  1453		struct vcpu_vmx *vmx = to_vmx(vcpu);
  1454		bool already_loaded = vmx->loaded_vmcs->cpu == cpu;
  1455		struct vmcs *prev;
  1456	
  1457		if (!already_loaded) {
  1458			loaded_vmcs_clear(vmx->loaded_vmcs);
  1459			local_irq_disable();
  1460	
  1461			/*
  1462			 * Ensure loaded_vmcs->cpu is read before adding loaded_vmcs to
  1463			 * this cpu's percpu list, otherwise it may not yet be deleted
  1464			 * from its previous cpu's percpu list.  Pairs with the
  1465			 * smb_wmb() in __loaded_vmcs_clear().
  1466			 */
  1467			smp_rmb();
  1468	
  1469			list_add(&vmx->loaded_vmcs->loaded_vmcss_on_cpu_link,
  1470				 &per_cpu(loaded_vmcss_on_cpu, cpu));
  1471			local_irq_enable();
  1472		}
  1473	
  1474		prev = per_cpu(current_vmcs, cpu);
  1475		if (prev != vmx->loaded_vmcs->vmcs) {
  1476			per_cpu(current_vmcs, cpu) = vmx->loaded_vmcs->vmcs;
  1477			vmcs_load(vmx->loaded_vmcs->vmcs);
  1478	
  1479			/*
  1480			 * No indirect branch prediction barrier needed when switching
  1481			 * the active VMCS within a vCPU, unless IBRS is advertised to
  1482			 * the vCPU.  To minimize the number of IBPBs executed, KVM
  1483			 * performs IBPB on nested VM-Exit (a single nested transition
  1484			 * may switch the active VMCS multiple times).
  1485			 */
  1486			if (!buddy || WARN_ON_ONCE(buddy->vmcs != prev))
  1487				indirect_branch_prediction_barrier();
  1488		}
  1489	
  1490		if (!already_loaded) {
  1491			void *gdt = get_current_gdt_ro();
  1492	
  1493			/*
  1494			 * Flush all EPTP/VPID contexts, the new pCPU may have stale
  1495			 * TLB entries from its previous association with the vCPU.
  1496			 */
  1497			kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
  1498	
  1499			/*
  1500			 * Linux uses per-cpu TSS and GDT, so set these when switching
  1501			 * processors.  See 22.2.4.
  1502			 */
  1503			vmcs_writel(HOST_TR_BASE,
  1504				    (unsigned long)&get_cpu_entry_area(cpu)->tss.x86_tss);
  1505			vmcs_writel(HOST_GDTR_BASE, (unsigned long)gdt);   /* 22.2.4 */
  1506	
  1507			if (IS_ENABLED(CONFIG_IA32_EMULATION) || IS_ENABLED(CONFIG_X86_32)) {
  1508				/* 22.2.3 */
  1509				vmcs_writel(HOST_IA32_SYSENTER_ESP,
  1510					    (unsigned long)(cpu_entry_stack(cpu) + 1));
  1511			}
  1512	
  1513			/* Per-CPU FRED MSRs */
  1514			if (kvm_cpu_cap_has(X86_FEATURE_FRED)) {
> 1515				vmcs_write64(HOST_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
> 1516				vmcs_write64(HOST_IA32_FRED_RSP2, __this_cpu_ist_top_va(NMI));
> 1517				vmcs_write64(HOST_IA32_FRED_RSP3, __this_cpu_ist_top_va(DF));
  1518				vmcs_write64(HOST_IA32_FRED_SSP1, 0);
  1519				vmcs_write64(HOST_IA32_FRED_SSP2, 0);
  1520				vmcs_write64(HOST_IA32_FRED_SSP3, 0);
  1521			}
  1522	
  1523			vmx->loaded_vmcs->cpu = cpu;
  1524		}
  1525	}
  1526	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-19 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 16:09 [xinli-intel-fred-public:intel-lkp 15/34] arch/x86/kvm/vmx/vmx.c:1515:81: error: 'DB' undeclared; did you mean 'DS'? kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.