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

Build error #14

@lucabe72

Description

@lucabe72

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions