Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #include <xen/xen.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #include <xen/events.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) #include <xen/grant_table.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #include <xen/hvm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #include <xen/interface/vcpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <xen/interface/xen.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <xen/interface/memory.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <xen/interface/hvm/params.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <xen/features.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <xen/platform_pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <xen/xenbus.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <xen/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <xen/interface/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <xen/xen-ops.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <asm/xen/hypervisor.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <asm/xen/hypercall.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <asm/system_misc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <asm/efi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/irqreturn.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/of.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/of_fdt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/of_irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <linux/of_address.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/cpuidle.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <linux/cpufreq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include <linux/cpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include <linux/console.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <linux/pvclock_gtod.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include <linux/reboot.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include <linux/time64.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include <linux/timekeeping.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include <linux/timekeeper_internal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #include <linux/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #include <linux/mm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) static struct start_info _xen_start_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) struct start_info *xen_start_info = &_xen_start_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) EXPORT_SYMBOL(xen_start_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) enum xen_domain_type xen_domain_type = XEN_NATIVE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) EXPORT_SYMBOL(xen_domain_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) struct shared_info xen_dummy_shared_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) static struct vcpu_info __percpu *xen_vcpu_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) /* Linux <-> Xen vCPU id mapping */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) /* These are unused until we support booting "pre-ballooned" */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) unsigned long xen_released_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) static __read_mostly unsigned int xen_events_irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) uint32_t xen_start_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) EXPORT_SYMBOL(xen_start_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 			       int nr, struct page **pages)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	return xen_xlate_unmap_gfn_range(vma, nr, pages);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) EXPORT_SYMBOL_GPL(xen_unmap_domain_gfn_range);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) static void xen_read_wallclock(struct timespec64 *ts)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	u32 version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	struct timespec64 now, ts_monotonic;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	struct shared_info *s = HYPERVISOR_shared_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	struct pvclock_wall_clock *wall_clock = &(s->wc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	/* get wallclock at system boot */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		version = wall_clock->version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 		rmb();		/* fetch version before time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		now.tv_sec  = ((uint64_t)wall_clock->sec_hi << 32) | wall_clock->sec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		now.tv_nsec = wall_clock->nsec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		rmb();		/* fetch time before checking version */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	} while ((wall_clock->version & 1) || (version != wall_clock->version));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	/* time since system boot */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	ktime_get_ts64(&ts_monotonic);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	*ts = timespec64_add(now, ts_monotonic);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) static int xen_pvclock_gtod_notify(struct notifier_block *nb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 				   unsigned long was_set, void *priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	/* Protected by the calling core code serialization */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	static struct timespec64 next_sync;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	struct xen_platform_op op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	struct timespec64 now, system_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	struct timekeeper *tk = priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	now.tv_sec = tk->xtime_sec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	now.tv_nsec = (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	system_time = timespec64_add(now, tk->wall_to_monotonic);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	 * We only take the expensive HV call when the clock was set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	 * or when the 11 minutes RTC synchronization time elapsed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	if (!was_set && timespec64_compare(&now, &next_sync) < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		return NOTIFY_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	op.cmd = XENPF_settime64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	op.u.settime64.mbz = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	op.u.settime64.secs = now.tv_sec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	op.u.settime64.nsecs = now.tv_nsec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	op.u.settime64.system_time = timespec64_to_ns(&system_time);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	(void)HYPERVISOR_platform_op(&op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	 * Move the next drift compensation time 11 minutes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	 * ahead. That's emulating the sync_cmos_clock() update for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	 * the hardware RTC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	next_sync = now;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	next_sync.tv_sec += 11 * 60;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	return NOTIFY_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) static struct notifier_block xen_pvclock_gtod_notifier = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	.notifier_call = xen_pvclock_gtod_notify,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) static int xen_starting_cpu(unsigned int cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	struct vcpu_register_vcpu_info info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	struct vcpu_info *vcpup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	/* 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	 * VCPUOP_register_vcpu_info cannot be called twice for the same
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	 * vcpu, so if vcpu_info is already registered, just get out. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	 * can happen with cpu-hotplug.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	if (per_cpu(xen_vcpu, cpu) != NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		goto after_register_vcpu_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	pr_info("Xen: initializing cpu%d\n", cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	info.mfn = percpu_to_gfn(vcpup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	info.offset = xen_offset_in_page(vcpup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 				 &info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	BUG_ON(err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	per_cpu(xen_vcpu, cpu) = vcpup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	if (!xen_kernel_unmapped_at_usr())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		xen_setup_runstate_info(cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) after_register_vcpu_info:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	enable_percpu_irq(xen_events_irq, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) static int xen_dying_cpu(unsigned int cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	disable_percpu_irq(xen_events_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) void xen_reboot(int reason)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	struct sched_shutdown r = { .reason = reason };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	int rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	BUG_ON(rc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) static int xen_restart(struct notifier_block *nb, unsigned long action,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		       void *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	xen_reboot(SHUTDOWN_reboot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	return NOTIFY_DONE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) static struct notifier_block xen_restart_nb = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	.notifier_call = xen_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	.priority = 192,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) static void xen_power_off(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	xen_reboot(SHUTDOWN_poweroff);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) static irqreturn_t xen_arm_callback(int irq, void *arg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	xen_hvm_evtchn_do_upcall();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	return IRQ_HANDLED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) static __initdata struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	const char *compat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	const char *prefix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	const char *version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	bool found;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) } hyper_node = {"xen,xen", "xen,xen-", NULL, false};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) static int __init fdt_find_hyper_node(unsigned long node, const char *uname,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 				      int depth, void *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	const void *s = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	int len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	if (depth != 1 || strcmp(uname, "hypervisor") != 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	if (of_flat_dt_is_compatible(node, hyper_node.compat))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		hyper_node.found = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	s = of_get_flat_dt_prop(node, "compatible", &len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	if (strlen(hyper_node.prefix) + 3  < len &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	    !strncmp(hyper_node.prefix, s, strlen(hyper_node.prefix)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		hyper_node.version = s + strlen(hyper_node.prefix);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	 * Check if Xen supports EFI by checking whether there is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	 * "/hypervisor/uefi" node in DT. If so, runtime services are available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	 * through proxy functions (e.g. in case of Xen dom0 EFI implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	 * they call special hypercall which executes relevant EFI functions)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	 * and that is why they are always enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	if (IS_ENABLED(CONFIG_XEN_EFI)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		if ((of_get_flat_dt_subnode_by_name(node, "uefi") > 0) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		    !efi_runtime_disabled())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 			set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)  * see Documentation/devicetree/bindings/arm/xen.txt for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)  * documentation of the Xen Device Tree format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) void __init xen_early_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	of_scan_flat_dt(fdt_find_hyper_node, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	if (!hyper_node.found) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 		pr_debug("No Xen support\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	if (hyper_node.version == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 		pr_debug("Xen version not found\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	pr_info("Xen %s support found\n", hyper_node.version);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	xen_domain_type = XEN_HVM_DOMAIN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	xen_setup_features();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	if (xen_feature(XENFEAT_dom0))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 		xen_start_flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	if (!console_set_on_cmdline && !xen_initial_domain())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 		add_preferred_console("hvc", 0, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) static void __init xen_acpi_guest_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) #ifdef CONFIG_ACPI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	struct xen_hvm_param a;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	int interrupt, trigger, polarity;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	a.domid = DOMID_SELF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	a.index = HVM_PARAM_CALLBACK_IRQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	if (HYPERVISOR_hvm_op(HVMOP_get_param, &a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	    || (a.value >> 56) != HVM_PARAM_CALLBACK_TYPE_PPI) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 		xen_events_irq = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	interrupt = a.value & 0xff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 	trigger = ((a.value >> 8) & 0x1) ? ACPI_EDGE_SENSITIVE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 					 : ACPI_LEVEL_SENSITIVE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	polarity = ((a.value >> 8) & 0x2) ? ACPI_ACTIVE_LOW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 					  : ACPI_ACTIVE_HIGH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	xen_events_irq = acpi_register_gsi(NULL, interrupt, trigger, polarity);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) static void __init xen_dt_guest_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	struct device_node *xen_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	xen_node = of_find_compatible_node(NULL, NULL, "xen,xen");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 	if (!xen_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 		pr_err("Xen support was detected before, but it has disappeared\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	xen_events_irq = irq_of_parse_and_map(xen_node, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) static int __init xen_guest_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	struct xen_add_to_physmap xatp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	struct shared_info *shared_info_page = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	int cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	if (!xen_domain())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	if (!acpi_disabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 		xen_acpi_guest_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 		xen_dt_guest_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	if (!xen_events_irq) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 		pr_err("Xen event channel interrupt not found\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	 * The fdt parsing codes have set EFI_RUNTIME_SERVICES if Xen EFI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	 * parameters are found. Force enable runtime services.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	if (efi_enabled(EFI_RUNTIME_SERVICES))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 		xen_efi_runtime_setup();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	shared_info_page = (struct shared_info *)get_zeroed_page(GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	if (!shared_info_page) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 		pr_err("not enough memory\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	xatp.domid = DOMID_SELF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	xatp.idx = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	xatp.space = XENMAPSPACE_shared_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	xatp.gpfn = virt_to_gfn(shared_info_page);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 		BUG();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	HYPERVISOR_shared_info = (struct shared_info *)shared_info_page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 	/* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	 * page, we use it in the event channel upcall and in some pvclock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 	 * related functions. 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 	 * The shared info contains exactly 1 CPU (the boot CPU). The guest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	 * is required to use VCPUOP_register_vcpu_info to place vcpu info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 	 * for secondary CPUs as they are brought up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	 * For uniformity we use VCPUOP_register_vcpu_info even on cpu0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	xen_vcpu_info = alloc_percpu(struct vcpu_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	if (xen_vcpu_info == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	/* Direct vCPU id mapping for ARM guests. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 	for_each_possible_cpu(cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		per_cpu(xen_vcpu_id, cpu) = cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 	xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	if (xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 					  &xen_auto_xlat_grant_frames.vaddr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 					  xen_auto_xlat_grant_frames.count)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 		free_percpu(xen_vcpu_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	gnttab_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	 * Making sure board specific code will not set up ops for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	 * cpu idle and cpu freq.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	disable_cpuidle();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 	disable_cpufreq();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	xen_init_IRQ();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	if (request_percpu_irq(xen_events_irq, xen_arm_callback,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 			       "events", &xen_vcpu)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		pr_err("Error request IRQ %d\n", xen_events_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	if (!xen_kernel_unmapped_at_usr())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		xen_time_setup_guest();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	if (xen_initial_domain())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	return cpuhp_setup_state(CPUHP_AP_ARM_XEN_STARTING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 				 "arm/xen:starting", xen_starting_cpu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 				 xen_dying_cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) early_initcall(xen_guest_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) static int __init xen_pm_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	if (!xen_domain())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	pm_power_off = xen_power_off;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	register_restart_handler(&xen_restart_nb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	if (!xen_initial_domain()) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 		struct timespec64 ts;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 		xen_read_wallclock(&ts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 		do_settimeofday64(&ts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) late_initcall(xen_pm_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) /* empty stubs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) void xen_arch_pre_suspend(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) void xen_arch_post_suspend(int suspend_cancelled) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) void xen_timer_resume(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) void xen_arch_resume(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) void xen_arch_suspend(void) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) /* In the hypercall.S file. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) EXPORT_SYMBOL_GPL(HYPERVISOR_console_io);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) EXPORT_SYMBOL_GPL(HYPERVISOR_platform_op_raw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) EXPORT_SYMBOL_GPL(HYPERVISOR_vm_assist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) EXPORT_SYMBOL_GPL(HYPERVISOR_dm_op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) EXPORT_SYMBOL_GPL(privcmd_call);