Opened 2 years ago
Last modified 2 years ago
#21321 new defect
Compiling the kernel-modules fails with error: ‘VMX_BF_EPT_PT_0_MASK’ undeclared
Reported by: | gentoo-bird | Owned by: | |
---|---|---|---|
Component: | host support | Version: | VirtualBox-7.0.4 |
Keywords: | Cc: | ||
Guest type: | all | Host type: | Linux |
Description
The compilation fails with:
vboxdrv/include/VBox/vmm/hm_vmx.h:532:29: error: ‘VMX_BF_EPT_PT_0_MASK’ undeclared here (not in a function); did you mean ‘VMX_BF_EPT_PT_READ_MASK’?
532 | RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
The line in hm_vmx.h which is causing this:
RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
(READ, WRITE, EXECUTE, MEMTYPE, IGNORE_PAT, IGN_7, ACCESSED, DIRTY, EXECUTE_USER, IGN_59_11, SUPER_SHW_STACK, IGN_62_61, SUPPRESS_VE));
The cause is that the C preprocessor is replacing READ with '0' (and WRITE with '1') due to the linux kernel header file: tools/virtio/linux/kernel.h
which has (line 29): /* generic data direction definitions */ #define READ 0 #define WRITE 1
I would say this is an unintended side effect and a small rename of the variables in hm_vmx.h would fix this
Apparently a workaround (https://bugs.gentoo.org/880229) is to set the Linux kernel config option CONFIG_JUMP_LABEL but I did not test this yet
Setting the Linux kernel config option CONFIG_JUMP_LABEL to true solves the issue. But that is more a workaround.. A small rename of the variables in hm_vmx.h would really fix this