Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Build error #14

Open
lucabe72 opened this issue Jul 14, 2020 · 0 comments
Open

Build error #14

lucabe72 opened this issue Jul 14, 2020 · 0 comments

Comments

@lucabe72
Copy link

Hello,

I get a build error when compiling on Ubuntu 20.04:

luca@luca64:/data/Test/Virt/vbh/sources$ make
make -C /lib/modules/5.4.0-40-lowlatency/build M=/data/Test/Virt/vbh/sources
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-40-lowlatency'
AR /data/Test/Virt/vbh/sources/built-in.a
CC [M] /data/Test/Virt/vbh/sources/kernelhardening.o
In file included from /data/Test/Virt/vbh/sources/kernelhardening.c:6:
/data/Test/Virt/vbh/sources/vmx_common.h: In function ‘__vmcs_readl’:
/data/Test/Virt/vbh/sources/vmx_common.h:322:15: error: expected string literal before ‘ASM_VMX_VMREAD_RDX_RAX’
322 | asm volatile(ASM_VMX_VMREAD_RDX_RAX
| ^~~~~~~~~~~~~~~~~~~~~~
/data/Test/Virt/vbh/sources/vmx_common.h: In function ‘__vmcs_writel’:
/data/Test/Virt/vbh/sources/vmx_common.h:364:20: error: expected string literal before ‘ASM_VMX_VMWRITE_RAX_RDX’
364 | asm volatile(__ex(ASM_VMX_VMWRITE_RAX_RDX) "; setna %0"
| ^~~~~~~~~~~~~~~~~~~~~~~
/data/Test/Virt/vbh/sources/vmx_common.h:263:17: note: in definition of macro ‘__ex’
263 | #define __ex(x) x
| ^

It looks like the source expect to find ASM_VMX_VMREAD_RDX_RAX and similar defined in the kernel sources... However, that define has been removed some time ago (and the kernel now uses the vmread and vmwrite assembly instructions directly).

I think there are 2 possible solutions:

  1. switch to using vmread and vmwrite directly, as current kernels do
  2. define ASM_VMX_VMREAD_RDX_RAX and similar in vbh/sources/vmx_common.h

Which solution do you think is more appropriate?

As a side note, what is the purpose of the "__ex()" macro?

Thanks,
Luca

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant