* [luto:x86/kvm 1/1] arch/x86/kvm/vmx/vmx.c:1176:31: error: 'struct vcpu_vmx' has no member named 'host_gs_base'; did you mean
@ 2020-12-03 0:37 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-03 0:37 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 6131 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/kvm
head: 17d57f185ff5b3de483594a9663f3bf96080d4ce
commit: 17d57f185ff5b3de483594a9663f3bf96080d4ce [1/1] x86/vmx: Rewrite segment switching logic
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id=17d57f185ff5b3de483594a9663f3bf96080d4ce
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/kvm
git checkout 17d57f185ff5b3de483594a9663f3bf96080d4ce
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
arch/x86/kvm/vmx/vmx.c:1114:6: warning: no previous prototype for 'vmx_set_host_fs_gs' [-Wmissing-prototypes]
1114 | void vmx_set_host_fs_gs(struct vmcs_host_state *host_state)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/export.h:43,
from include/linux/linkage.h:7,
from include/linux/fs.h:5,
from include/linux/highmem.h:5,
from arch/x86/kvm/vmx/vmx.c:17:
arch/x86/kvm/vmx/vmx.c: In function 'vmx_prepare_switch_to_guest':
>> arch/x86/kvm/vmx/vmx.c:1176:31: error: 'struct vcpu_vmx' has no member named 'host_gs_base'; did you mean 'host_gs_sel'?
1176 | if (unlikely(gs_base != vmx->host_gs_base)) {
| ^~~~~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
arch/x86/kvm/vmx/vmx.c:1178:8: error: 'struct vcpu_vmx' has no member named 'host_gs_base'; did you mean 'host_gs_sel'?
1178 | vmx->host_gs_base = gs_base;
| ^~~~~~~~~~~~
| host_gs_sel
>> arch/x86/kvm/vmx/vmx.c:1182:13: error: implicit declaration of function '__rdfsbase'; did you mean 'rdfsbase'? [-Werror=implicit-function-declaration]
1182 | fs_base = __rdfsbase();
| ^~~~~~~~~~
| rdfsbase
>> arch/x86/kvm/vmx/vmx.c:1183:34: error: implicit declaration of function '__rdgsbase_inactive' [-Werror=implicit-function-declaration]
1183 | vmx->msr_host_kernel_gs_base = __rdgsbase_inactive();
| ^~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/vmx/vmx.c:1184:3: error: implicit declaration of function '__wrgsbase_inactive' [-Werror=implicit-function-declaration]
1184 | __wrgsbase_inactive(vmx->msr_guest_kernel_gs_base);
| ^~~~~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/vmx.c: In function 'vmx_prepare_switch_to_host':
arch/x86/kvm/vmx/vmx.c:1274:26: warning: variable 'host_state' set but not used [-Wunused-but-set-variable]
1274 | struct vmcs_host_state *host_state;
| ^~~~~~~~~~
cc1: some warnings being treated as errors
vim +1176 arch/x86/kvm/vmx/vmx.c
1127
1128 vmx->req_immediate_exit = false;
1129
1130 /*
1131 * Note that guest MSRs to be saved/restored can also be changed
1132 * when guest state is loaded. This happens when guest transitions
1133 * to/from long-mode by setting MSR_EFER.LMA.
1134 */
1135 if (!vmx->guest_msrs_ready) {
1136 vmx->guest_msrs_ready = true;
1137 for (i = 0; i < vmx->save_nmsrs; ++i)
1138 kvm_set_shared_msr(vmx->guest_msrs[i].index,
1139 vmx->guest_msrs[i].data,
1140 vmx->guest_msrs[i].mask);
1141
1142 }
1143
1144 if (vmx->nested.need_vmcs12_to_shadow_sync)
1145 nested_sync_vmcs12_to_shadow(vcpu);
1146
1147 if (vmx->guest_state_loaded)
1148 return;
1149
1150 host_state = &vmx->loaded_vmcs->host_state;
1151
1152 vmx->host_ldt_sel = kvm_read_ldt();
1153
1154 /*
1155 * Set host fs and gs selectors. Unfortunately, 26.2.3 does not
1156 * allow segment selectors with RPL > 0 or TI == 1. Additionally,
1157 * VM exit cannot restore segment attributes other than the base.
1158 * This means that the only user selector that can be usefully
1159 * restored by VM exit is 0.
1160 *
1161 * Fortunately, the common case is that userspace is a normal
1162 * 64-bit program with all selectors except CS and SS set to 0.
1163 */
1164
1165 #ifdef CONFIG_X86_64
1166 /*
1167 * On 64-bit kernels, DS, ES, FS, and GS contain their userspace
1168 * values. Save them.
1169 */
1170 savesegment(ds, vmx->host_ds_sel);
1171 savesegment(es, vmx->host_es_sel);
1172 savesegment(fs, vmx->host_fs_sel);
1173 savesegment(gs, vmx->host_gs_sel);
1174
1175 gs_base = cpu_kernelmode_gs_base(smp_processor_id());
> 1176 if (unlikely(gs_base != vmx->host_gs_base)) {
1177 vmcs_writel(HOST_GS_BASE, gs_base);
1178 vmx->host_gs_base = gs_base;
1179 }
1180
1181 if (cpu_feature_enabled(X86_FEATURE_FSGSBASE)) {
> 1182 fs_base = __rdfsbase();
> 1183 vmx->msr_host_kernel_gs_base = __rdgsbase_inactive();
> 1184 __wrgsbase_inactive(vmx->msr_guest_kernel_gs_base);
1185 } else {
1186 fs_base = read_msr(MSR_FS_BASE);
1187 vmx->msr_host_kernel_gs_base = read_msr(MSR_KERNEL_GS_BASE);
1188 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
1189 }
1190 #else
1191 fs_base = segment_base(__KERNEL_PERCPU);
1192 savesegment(gs, vmx->host_gs_sel);
1193 #endif
1194
1195 if (unlikely(fs_base != host_state->fs_base)) {
1196 vmcs_writel(HOST_FS_BASE, fs_base);
1197 host_state->fs_base = fs_base;
1198 }
1199
1200 vmx->guest_state_loaded = true;
1201 }
1202
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45195 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-03 0:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 0:37 [luto:x86/kvm 1/1] arch/x86/kvm/vmx/vmx.c:1176:31: error: 'struct vcpu_vmx' has no member named 'host_gs_base'; did you mean 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.