Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1241785 > unrolled thread

[RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it.

Started byKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
First post2015-10-07 22:30 +0200
Last post2015-10-07 22:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it. Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2015-10-07 22:30 +0200
    Re: [RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware  supports it. kbuild test robot <lkp@intel.com> - 2015-10-07 22:40 +0200

#1241785 — [RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it.

FromKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date2015-10-07 22:30 +0200
Subject[RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it.
Message-ID<qh3vA-78b-17@gated-at.bofh.it>
Instead of using the event channels.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1241794 — Re: [RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it.

Fromkbuild test robot <lkp@intel.com>
Date2015-10-07 22:40 +0200
SubjectRe: [RFC PATCH v1 1/2] xen/apic: Use vAPIC for IPI if the hardware supports it.
Message-ID<qh3Ff-7jt-9@gated-at.bofh.it>
In reply to#1241785

[Multipart message — attachments visible in raw view] — view raw

Hi Konrad,

[auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]

config: x86_64-randconfig-x016-201540 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   arch/x86/xen/smp.c: In function 'xen_use_vapic':
>> arch/x86/xen/smp.c:800:14: error: 'XEN_HVM_CPUID_X2APIC_VIRT' undeclared (first use in this function)
     if (((eax & XEN_HVM_CPUID_X2APIC_VIRT) && x2apic_mode) ||
                 ^
   arch/x86/xen/smp.c:800:14: note: each undeclared identifier is reported only once for each function it appears in
>> arch/x86/xen/smp.c:801:14: error: 'XEN_HVM_CPUID_APIC_ACCESS_VIRT' undeclared (first use in this function)
         ((eax & XEN_HVM_CPUID_APIC_ACCESS_VIRT) && cpu_has_apic))
                 ^

vim +/XEN_HVM_CPUID_X2APIC_VIRT +800 arch/x86/xen/smp.c

   794	}
   795	
   796	static bool __init xen_use_vapic(void)
   797	{
   798		uint32_t eax = cpuid_eax(xen_cpuid_base() + 4);
   799	
 > 800		if (((eax & XEN_HVM_CPUID_X2APIC_VIRT) && x2apic_mode) ||
 > 801		    ((eax & XEN_HVM_CPUID_APIC_ACCESS_VIRT) && cpu_has_apic))
   802			return true;
   803	
   804		return false;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web