
ACRN is an open-source hypervisor maintained by The Linux Foundation. It is built for embedded IOT with small footprint and real-time features. Add ACRN guest support so that it allows Linux to be booted under the ACRN hypervisor. This adds only the barebones implementation. [ bp: Massage commit message and help text. ] Co-developed-by: Jason Chen CJ <jason.cj.chen@intel.com> Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/1559108037-18813-3-git-send-email-yakui.zhao@intel.com
40 lines
885 B
C
40 lines
885 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* ACRN detection support
|
|
*
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
*
|
|
* Jason Chen CJ <jason.cj.chen@intel.com>
|
|
* Zhao Yakui <yakui.zhao@intel.com>
|
|
*
|
|
*/
|
|
|
|
#include <asm/hypervisor.h>
|
|
|
|
static uint32_t __init acrn_detect(void)
|
|
{
|
|
return hypervisor_cpuid_base("ACRNACRNACRN\0\0", 0);
|
|
}
|
|
|
|
static void __init acrn_init_platform(void)
|
|
{
|
|
}
|
|
|
|
static bool acrn_x2apic_available(void)
|
|
{
|
|
/*
|
|
* x2apic is not supported for now. Future enablement will have to check
|
|
* X86_FEATURE_X2APIC to determine whether x2apic is supported in the
|
|
* guest.
|
|
*/
|
|
return false;
|
|
}
|
|
|
|
const __initconst struct hypervisor_x86 x86_hyper_acrn = {
|
|
.name = "ACRN",
|
|
.detect = acrn_detect,
|
|
.type = X86_HYPER_ACRN,
|
|
.init.init_platform = acrn_init_platform,
|
|
.init.x2apic_available = acrn_x2apic_available,
|
|
};
|