diff --git a/.gitignore b/.gitignore index 789fe084..bc8218e7 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ loader/**/*.o loader/**/*.o.cmd loader/**/*.cmd loader/**/*.dwo +loader/linux/Makefile # Windows Loader loader/windows/x64/ diff --git a/cmake/target/loader_build.cmake b/cmake/target/loader_build.cmake index fbe1540b..6069d655 100644 --- a/cmake/target/loader_build.cmake +++ b/cmake/target/loader_build.cmake @@ -20,6 +20,12 @@ # SOFTWARE. if(HYPERVISOR_BUILD_LOADER AND NOT HYPERVISOR_TARGET_ARCH STREQUAL "aarch64") + configure_file( + ${hypervisor_SOURCE_DIR}/loader/linux/Makefile.in + ${hypervisor_SOURCE_DIR}/loader/linux/Makefile + @ONLY + ) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") add_custom_target(loader_build COMMAND ${CMAKE_COMMAND} -E chdir ${hypervisor_SOURCE_DIR}/loader/linux make CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' diff --git a/loader/linux/Makefile b/loader/linux/Makefile.in similarity index 99% rename from loader/linux/Makefile rename to loader/linux/Makefile.in index 2e93c951..19b7b91b 100644 --- a/loader/linux/Makefile +++ b/loader/linux/Makefile.in @@ -21,7 +21,7 @@ # SOFTWARE. TARGET_MODULE := bareflank_loader -VENDOR_ID := $(shell lscpu | grep 'Vendor ID') +VENDOR_ID := @HYPERVISOR_TARGET_ARCH@ ifneq ($(KERNELRELEASE),) obj-m := $(TARGET_MODULE).o diff --git a/loader/src/x64/amd/check_cpu_configuration.c b/loader/src/x64/amd/check_cpu_configuration.c index ce1ab848..7e7a765d 100644 --- a/loader/src/x64/amd/check_cpu_configuration.c +++ b/loader/src/x64/amd/check_cpu_configuration.c @@ -84,17 +84,17 @@ check_for_amd(void) NOEXCEPT intrinsic_cpuid(&eax, &ebx, &ecx, &edx); if (CPUID_VENDOR_EBX != ebx) { - bferror_x32("cpu is vendor is not AuthenticAMD", ebx); + bferror_x32("cpu vendor is not AuthenticAMD", ebx); return LOADER_FAILURE; } if (CPUID_VENDOR_ECX != ecx) { - bferror_x32("cpu is vendor is not AuthenticAMD", ecx); + bferror_x32("cpu vendor is not AuthenticAMD", ecx); return LOADER_FAILURE; } if (CPUID_VENDOR_EDX != edx) { - bferror_x32("cpu is vendor is not AuthenticAMD", edx); + bferror_x32("cpu vendor is not AuthenticAMD", edx); return LOADER_FAILURE; } diff --git a/loader/src/x64/intel/check_cpu_configuration.c b/loader/src/x64/intel/check_cpu_configuration.c index 1039868b..75914f15 100644 --- a/loader/src/x64/intel/check_cpu_configuration.c +++ b/loader/src/x64/intel/check_cpu_configuration.c @@ -106,17 +106,17 @@ check_for_intel(void) NOEXCEPT intrinsic_cpuid(&eax, &ebx, &ecx, &edx); if (CPUID_VENDOR_EBX != ebx) { - bferror_x32("cpu is vendor is not GenuineIntel", ebx); + bferror_x32("cpu vendor is not GenuineIntel", ebx); return LOADER_FAILURE; } if (CPUID_VENDOR_ECX != ecx) { - bferror_x32("cpu is vendor is not GenuineIntel", ecx); + bferror_x32("cpu vendor is not GenuineIntel", ecx); return LOADER_FAILURE; } if (CPUID_VENDOR_EDX != edx) { - bferror_x32("cpu is vendor is not GenuineIntel", edx); + bferror_x32("cpu vendor is not GenuineIntel", edx); return LOADER_FAILURE; }