diff options
| author | Zhao Yakui <yakui.zhao@intel.com> | 2019-04-30 11:45:24 +0800 | 
|---|---|---|
| committer | Borislav Petkov <bp@suse.de> | 2019-06-11 21:29:22 +0200 | 
| commit | ec7972c99fffb4d2739f286ce9b544a71aa1d05f (patch) | |
| tree | fbbde046f0914fbcd21a027df937757b67e37fd9 /arch/x86/kernel/cpu/acrn.c | |
| parent | ecca25029473bee6e98ce062e76b7310904bbdd1 (diff) | |
x86: Add support for Linux guests on an ACRN hypervisor
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
Diffstat (limited to 'arch/x86/kernel/cpu/acrn.c')
| -rw-r--r-- | arch/x86/kernel/cpu/acrn.c | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c new file mode 100644 index 000000000000..6d365e97cce6 --- /dev/null +++ b/arch/x86/kernel/cpu/acrn.c @@ -0,0 +1,39 @@ +// 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, +}; | 
