Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76ca0783 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm:
  xen: suspend: remove xen_hvm_suspend
  xen: suspend: pull pre/post suspend hooks out into suspend_info
  xen: suspend: move arch specific pre/post suspend hooks into generic hooks
  xen: suspend: refactor non-arch specific pre/post suspend hooks
  xen: suspend: add "arch" to pre/post suspend hooks
  xen: suspend: pass extra hypercall argument via suspend_info struct
  xen: suspend: refactor cancellation flag into a structure
  xen: suspend: use HYPERVISOR_suspend for PVHVM case instead of open coding
  xen: switch to new schedop hypercall by default.
  xen: use new schedop interface for suspend
  xen: do not respond to unknown xenstore control requests
  xen: fix compile issue if XEN is enabled but XEN_PVHVM is disabled
  xen: PV on HVM: support PV spinlocks and IPIs
  xen: make the ballon driver work for hvm domains
  xen-blkfront: handle Xen major numbers other than XENVBD
  xen: do not use xen_info on HVM, set pv_info name to "Xen HVM"
  xen: no need to delay xen_setup_shutdown_event for hvm guests anymore
parents 27d2a8b9 b056b6a0
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -37,19 +37,14 @@ xen_mm_unpin_all(void)
	/* nothing */
}

void xen_pre_device_suspend(void)
{
	/* nothing */
}

void
xen_pre_suspend()
xen_arch_pre_suspend()
{
	/* nothing */
}

void
xen_post_suspend(int suspend_cancelled)
xen_arch_post_suspend(int suspend_cancelled)
{
	if (suspend_cancelled)
		return;
+11 −4
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ HYPERVISOR_fpu_taskswitch(int set)
static inline int
HYPERVISOR_sched_op(int cmd, void *arg)
{
	return _hypercall2(int, sched_op_new, cmd, arg);
	return _hypercall2(int, sched_op, cmd, arg);
}

static inline long
@@ -422,10 +422,17 @@ HYPERVISOR_set_segment_base(int reg, unsigned long value)
#endif

static inline int
HYPERVISOR_suspend(unsigned long srec)
HYPERVISOR_suspend(unsigned long start_info_mfn)
{
	return _hypercall3(int, sched_op, SCHEDOP_shutdown,
			   SHUTDOWN_suspend, srec);
	struct sched_shutdown r = { .reason = SHUTDOWN_suspend };

	/*
	 * For a PV guest the tools require that the start_info mfn be
	 * present in rdx/edx when the hypercall is made. Per the
	 * hypercall calling convention this is the third hypercall
	 * argument, which is start_info_mfn here.
	 */
	return _hypercall3(int, sched_op, SCHEDOP_shutdown, &r, start_info_mfn);
}

static inline int
+4 −2
Original line number Diff line number Diff line
@@ -1284,8 +1284,7 @@ static int init_hvm_pv_info(int *major, int *minor)

	xen_setup_features();

	pv_info = xen_info;
	pv_info.kernel_rpl = 0;
	pv_info.name = "Xen HVM";

	xen_domain_type = XEN_HVM_DOMAIN;

@@ -1331,6 +1330,8 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
	switch (action) {
	case CPU_UP_PREPARE:
		per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
		if (xen_have_vector_callback)
			xen_init_lock_cpu(cpu);
		break;
	default:
		break;
@@ -1355,6 +1356,7 @@ static void __init xen_hvm_guest_init(void)

	if (xen_feature(XENFEAT_hvm_callback_vector))
		xen_have_vector_callback = 1;
	xen_hvm_smp_init();
	register_cpu_notifier(&xen_hvm_cpu_notifier);
	xen_unplug_emulated_devices();
	have_vcpu_info_placement = 0;
+38 −0
Original line number Diff line number Diff line
@@ -509,3 +509,41 @@ void __init xen_smp_init(void)
	xen_fill_possible_map();
	xen_init_spinlocks();
}

static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus)
{
	native_smp_prepare_cpus(max_cpus);
	WARN_ON(xen_smp_intr_init(0));

	if (!xen_have_vector_callback)
		return;
	xen_init_lock_cpu(0);
	xen_init_spinlocks();
}

static int __cpuinit xen_hvm_cpu_up(unsigned int cpu)
{
	int rc;
	rc = native_cpu_up(cpu);
	WARN_ON (xen_smp_intr_init(cpu));
	return rc;
}

static void xen_hvm_cpu_die(unsigned int cpu)
{
	unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL);
	unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
	unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
	unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);
	native_cpu_die(cpu);
}

void __init xen_hvm_smp_init(void)
{
	smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
	smp_ops.smp_send_reschedule = xen_smp_send_reschedule;
	smp_ops.cpu_up = xen_hvm_cpu_up;
	smp_ops.cpu_die = xen_hvm_cpu_die;
	smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
	smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
}
+5 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include "xen-ops.h"
#include "mmu.h"

void xen_pre_suspend(void)
void xen_arch_pre_suspend(void)
{
	xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
	xen_start_info->console.domU.mfn =
@@ -26,8 +26,9 @@ void xen_pre_suspend(void)
		BUG();
}

void xen_hvm_post_suspend(int suspend_cancelled)
void xen_arch_hvm_post_suspend(int suspend_cancelled)
{
#ifdef CONFIG_XEN_PVHVM
	int cpu;
	xen_hvm_init_shared_info();
	xen_callback_vector();
@@ -37,9 +38,10 @@ void xen_hvm_post_suspend(int suspend_cancelled)
			xen_setup_runstate_info(cpu);
		}
	}
#endif
}

void xen_post_suspend(int suspend_cancelled)
void xen_arch_post_suspend(int suspend_cancelled)
{
	xen_build_mfn_list_list();

Loading