linux/arch/x86/xen/enlighten.c

// SPDX-License-Identifier: GPL-2.0

#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/kexec.h>
#include <linux/memblock.h>
#include <linux/slab.h>
#include <linux/panic_notifier.h>

#include <xen/xen.h>
#include <xen/features.h>
#include <xen/interface/sched.h>
#include <xen/interface/version.h>
#include <xen/page.h>

#include <asm/xen/hypercall.h>
#include <asm/xen/hypervisor.h>
#include <asm/cpu.h>
#include <asm/e820/api.h> 
#include <asm/setup.h>

#include "xen-ops.h"

EXPORT_SYMBOL_GPL();

/*
 * Pointer to the xen_vcpu_info structure or
 * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info
 * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info
 * but during boot it is switched to point to xen_vcpu_info.
 * The pointer is used in xen_evtchn_do_upcall to acknowledge pending events.
 * Make sure that xen_vcpu_info doesn't cross a page boundary by making it
 * cache-line aligned (the struct is guaranteed to have a size of 64 bytes,
 * which matches the cache line size of 64-bit x86 processors).
 */
DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
DEFINE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info);

/* Linux <-> Xen vCPU id mapping */
DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
EXPORT_PER_CPU_SYMBOL();

unsigned long *machine_to_phys_mapping =;
EXPORT_SYMBOL();
unsigned long  machine_to_phys_nr;
EXPORT_SYMBOL();

struct start_info *xen_start_info;
EXPORT_SYMBOL_GPL();

struct shared_info xen_dummy_shared_info;

__read_mostly bool xen_have_vector_callback =;
EXPORT_SYMBOL_GPL();

/*
 * NB: These need to live in .data or alike because they're used by
 * xen_prepare_pvh() which runs before clearing the bss.
 */
enum xen_domain_type __ro_after_init xen_domain_type =;
EXPORT_SYMBOL_GPL();
uint32_t __ro_after_init xen_start_flags;
EXPORT_SYMBOL();

/*
 * Point at some empty memory to start with. We map the real shared_info
 * page as soon as fixmap is up and running.
 */
struct shared_info *HYPERVISOR_shared_info =;

static int xen_cpu_up_online(unsigned int cpu)
{}

int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int),
		    int (*cpu_dead_cb)(unsigned int))
{}

static void xen_vcpu_setup_restore(int cpu)
{}

/*
 * On restore, set the vcpu placement up again.
 * If it fails, then we're in a bad state, since
 * we can't back out from using it...
 */
void xen_vcpu_restore(void)
{}

void xen_vcpu_info_reset(int cpu)
{}

void xen_vcpu_setup(int cpu)
{}

void __init xen_banner(void)
{}

/* Check if running on Xen version (major, minor) or later */
bool xen_running_on_version_or_later(unsigned int major, unsigned int minor)
{}

void __init xen_add_preferred_consoles(void)
{}

void xen_reboot(int reason)
{}

static int reboot_reason =;
static bool xen_legacy_crash;
void xen_emergency_restart(void)
{}

static int
xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
{}

static int __init parse_xen_legacy_crash(char *arg)
{}
early_param();

static struct notifier_block xen_panic_block =;

int xen_panic_handler_init(void)
{}

void xen_pin_vcpu(int cpu)
{}

#ifdef CONFIG_HOTPLUG_CPU
void xen_arch_register_cpu(int num)
{}
EXPORT_SYMBOL();

void xen_arch_unregister_cpu(int num)
{}
EXPORT_SYMBOL();
#endif

/* Amount of extra memory space we add to the e820 ranges */
struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata;

void __init xen_add_extra_mem(unsigned long start_pfn, unsigned long n_pfns)
{}

#ifdef CONFIG_XEN_UNPOPULATED_ALLOC
int __init arch_xen_unpopulated_init(struct resource **res)
{}
#endif