[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1444249310-23433-2-git-send-email-konrad.wilk@oracle.com>
Date: Wed, 7 Oct 2015 16:21:49 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: boris.ostrovsky@...cle.com, joao.m.martins@...cle.com,
david.vrabel@...rix.com, jgross@...e.com,
dario.faggioli@...rix.com, xen-devel@...ts.xenproject.org,
linux-kernel@...r.kernel.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: [RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it.
Instead of using the event channels.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
---
arch/x86/xen/smp.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 3f4ebf0..d4f4560 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -793,15 +793,33 @@ static int xen_hvm_cpu_up(unsigned int cpu, struct task_struct *tidle)
return rc;
}
+static bool __init xen_use_vapic(void)
+{
+ uint32_t eax = cpuid_eax(xen_cpuid_base() + 4);
+
+ if (((eax & XEN_HVM_CPUID_X2APIC_VIRT) && x2apic_mode) ||
+ ((eax & XEN_HVM_CPUID_APIC_ACCESS_VIRT) && cpu_has_apic))
+ return true;
+
+ return false;
+}
void __init xen_hvm_smp_init(void)
{
+ bool vapic;
+
if (!xen_have_vector_callback)
return;
+
+ vapic = xen_use_vapic();
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_cpu_die;
+ smp_ops.smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu;
+
+ printk("Using %s IPI mode\n", vapic ? "vAPIC" : "event channel");
+ if (vapic)
+ return;
+ smp_ops.smp_send_reschedule = xen_smp_send_reschedule;
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;
- smp_ops.smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu;
}
--
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists