From a2decec2008a6d7cb2ed082bbfc18bcc6f472d60 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Sun, 24 Dec 2023 11:19:59 +0300 Subject: [PATCH] LinuxKPI: Add asm/hypervisor.h header Sponsored by: Serenity Cyber Security, LLC Obtained from: OpenBSD Reviewed by: manu, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42802 (cherry picked from commit 206e9fea7502dccd126a721c30a1675bdef48633) --- .../linuxkpi/common/include/asm/hypervisor.h | 19 +++++++++++++++++++ .../linuxkpi/dummy/include/asm/hypervisor.h | 0 2 files changed, 19 insertions(+) create mode 100644 sys/compat/linuxkpi/common/include/asm/hypervisor.h delete mode 100644 sys/compat/linuxkpi/dummy/include/asm/hypervisor.h diff --git a/sys/compat/linuxkpi/common/include/asm/hypervisor.h b/sys/compat/linuxkpi/common/include/asm/hypervisor.h new file mode 100644 index 00000000000..f344a292935 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/asm/hypervisor.h @@ -0,0 +1,19 @@ +/* Public domain. */ + +#ifndef _LINUXKPI_ASM_HYPERVISOR_H +#define _LINUXKPI_ASM_HYPERVISOR_H + +#if defined(__i386__) || defined(__amd64__) + +#define X86_HYPER_NATIVE 1 +#define X86_HYPER_MS_HYPERV 2 + +static inline bool +hypervisor_is_type(int type) +{ + return (type == X86_HYPER_NATIVE); +} + +#endif + +#endif diff --git a/sys/compat/linuxkpi/dummy/include/asm/hypervisor.h b/sys/compat/linuxkpi/dummy/include/asm/hypervisor.h deleted file mode 100644 index e69de29bb2d..00000000000