xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xen-apic: Enable on domU as well
       [not found] <1438878579-26856-1-git-send-email-Jason@zx2c4.com>
@ 2015-08-06 16:37 ` Jason A. Donenfeld
       [not found] ` <1438879025-27362-1-git-send-email-Jason@zx2c4.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Jason A. Donenfeld @ 2015-08-06 16:37 UTC (permalink / raw)
  To: David Vrabel, Ian Campbell, netdev, linux-kernel, xen-devel
  Cc: Jason A. Donenfeld, stable

It turns out that domU also requires the Xen APIC driver. Otherwise we
get stuck in busy loops that never exit, such as in this stack trace:

(gdb) target remote localhost:9999
Remote debugging using localhost:9999
__xapic_wait_icr_idle () at ./arch/x86/include/asm/ipi.h:56
56              while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
(gdb) bt
 #0  __xapic_wait_icr_idle () at ./arch/x86/include/asm/ipi.h:56
 #1  __default_send_IPI_shortcut (shortcut=<optimized out>,
dest=<optimized out>, vector=<optimized out>) at
./arch/x86/include/asm/ipi.h:75
 #2  apic_send_IPI_self (vector=246) at arch/x86/kernel/apic/probe_64.c:54
 #3  0xffffffff81011336 in arch_irq_work_raise () at
arch/x86/kernel/irq_work.c:47
 #4  0xffffffff8114990c in irq_work_queue (work=0xffff88000fc0e400) at
kernel/irq_work.c:100
 #5  0xffffffff8110c29d in wake_up_klogd () at kernel/printk/printk.c:2633
 #6  0xffffffff8110ca60 in vprintk_emit (facility=0, level=<optimized
out>, dict=0x0 <irq_stack_union>, dictlen=<optimized out>,
fmt=<optimized out>, args=<optimized out>)
    at kernel/printk/printk.c:1778
 #7  0xffffffff816010c8 in printk (fmt=<optimized out>) at
kernel/printk/printk.c:1868
 #8  0xffffffffc00013ea in ?? ()
 #9  0x0000000000000000 in ?? ()

Mailing-list-thread: https://lkml.org/lkml/2015/8/4/755
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: <stable@vger.kernel.org>
---
 arch/x86/xen/Makefile  |  4 ++--
 arch/x86/xen/xen-ops.h | 11 ++++-------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 7322755..4b6e29a 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -13,13 +13,13 @@ CFLAGS_mmu.o			:= $(nostackp)
 obj-y		:= enlighten.o setup.o multicalls.o mmu.o irq.o \
 			time.o xen-asm.o xen-asm_$(BITS).o \
 			grant-table.o suspend.o platform-pci-unplug.o \
-			p2m.o
+			p2m.o apic.o
 
 obj-$(CONFIG_EVENT_TRACING) += trace.o
 
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
 obj-$(CONFIG_XEN_DEBUG_FS)	+= debugfs.o
-obj-$(CONFIG_XEN_DOM0)		+= apic.o vga.o
+obj-$(CONFIG_XEN_DOM0)		+= vga.o
 obj-$(CONFIG_SWIOTLB_XEN)	+= pci-swiotlb-xen.o
 obj-$(CONFIG_XEN_EFI)		+= efi.o
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index c20fe29..cd248ff 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -98,20 +98,17 @@ static inline void xen_uninit_lock_cpu(int cpu)
 #endif
 
 struct dom0_vga_console_info;
-
 #ifdef CONFIG_XEN_DOM0
 void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size);
-void __init xen_init_apic(void);
 #else
-static inline void __init xen_init_vga(const struct dom0_vga_console_info *info,
-				       size_t size)
-{
-}
-static inline void __init xen_init_apic(void)
+void __init xen_init_vga(const struct dom0_vga_console_info *info,
+			size_t size);
 {
 }
 #endif
 
+void __init xen_init_apic(void);
+
 #ifdef CONFIG_XEN_EFI
 extern void xen_efi_init(void);
 #else
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] xen-apic: Enable on domU as well
       [not found] ` <1438879025-27362-1-git-send-email-Jason@zx2c4.com>
@ 2015-08-07 14:23   ` Konrad Rzeszutek Wilk
       [not found]   ` <20150807142329.GC29527@l.oracle.com>
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-08-07 14:23 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: Ian Campbell, netdev, linux-kernel, stable, xen-devel, David Vrabel

On Thu, Aug 06, 2015 at 06:37:05PM +0200, Jason A. Donenfeld wrote:
> It turns out that domU also requires the Xen APIC driver. Otherwise we
> get stuck in busy loops that never exit, such as in this stack trace:
> 
> (gdb) target remote localhost:9999
> Remote debugging using localhost:9999
> __xapic_wait_icr_idle () at ./arch/x86/include/asm/ipi.h:56
> 56              while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
> (gdb) bt
>  #0  __xapic_wait_icr_idle () at ./arch/x86/include/asm/ipi.h:56
>  #1  __default_send_IPI_shortcut (shortcut=<optimized out>,
> dest=<optimized out>, vector=<optimized out>) at
> ./arch/x86/include/asm/ipi.h:75
>  #2  apic_send_IPI_self (vector=246) at arch/x86/kernel/apic/probe_64.c:54
>  #3  0xffffffff81011336 in arch_irq_work_raise () at
> arch/x86/kernel/irq_work.c:47
>  #4  0xffffffff8114990c in irq_work_queue (work=0xffff88000fc0e400) at
> kernel/irq_work.c:100
>  #5  0xffffffff8110c29d in wake_up_klogd () at kernel/printk/printk.c:2633
>  #6  0xffffffff8110ca60 in vprintk_emit (facility=0, level=<optimized
> out>, dict=0x0 <irq_stack_union>, dictlen=<optimized out>,
> fmt=<optimized out>, args=<optimized out>)
>     at kernel/printk/printk.c:1778
>  #7  0xffffffff816010c8 in printk (fmt=<optimized out>) at
> kernel/printk/printk.c:1868
>  #8  0xffffffffc00013ea in ?? ()
>  #9  0x0000000000000000 in ?? ()
> 
> Mailing-list-thread: https://lkml.org/lkml/2015/8/4/755
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: <stable@vger.kernel.org>

While this patch is OK for the trees that implement the PV APIC
driver it won't apply to older ones (and it does not need to).

In the older ones this was working with f447d56d36af18c5104ff29dcb1327c0c0ac3634
"xen: implement apic ipi interface", which should have worked for
your case.

And would have made the arch_irq_work_raise and such use the 
Xen code paths:
 952                                                                                 
 953 #ifdef CONFIG_SMP                                                               
 954     apic->send_IPI_allbutself = xen_send_IPI_allbutself;                        
 955     apic->send_IPI_mask_allbutself = xen_send_IPI_mask_allbutself;              
 956     apic->send_IPI_mask = xen_send_IPI_mask;                                    
 957     apic->send_IPI_all = xen_send_IPI_all;                                      
 958     apic->send_IPI_self = xen_send_IPI_self;                                    
 959 #endif        

Anyhow, your patch seems to fix a regression my patch 
feb44f1f7a4ac299d1ab1c3606860e70b9b89d69
"x86/xen: Provide a "Xen PV" APIC driver to support >255 VCPUs"
introduced.

I would to the stable.vger.kernel.org:
# apply only to v4.1

As the earlier ones will work fine.

Thank you!

Oh, and Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>


> ---
>  arch/x86/xen/Makefile  |  4 ++--
>  arch/x86/xen/xen-ops.h | 11 ++++-------
>  2 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
> index 7322755..4b6e29a 100644
> --- a/arch/x86/xen/Makefile
> +++ b/arch/x86/xen/Makefile
> @@ -13,13 +13,13 @@ CFLAGS_mmu.o			:= $(nostackp)
>  obj-y		:= enlighten.o setup.o multicalls.o mmu.o irq.o \
>  			time.o xen-asm.o xen-asm_$(BITS).o \
>  			grant-table.o suspend.o platform-pci-unplug.o \
> -			p2m.o
> +			p2m.o apic.o
>  
>  obj-$(CONFIG_EVENT_TRACING) += trace.o
>  
>  obj-$(CONFIG_SMP)		+= smp.o
>  obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
>  obj-$(CONFIG_XEN_DEBUG_FS)	+= debugfs.o
> -obj-$(CONFIG_XEN_DOM0)		+= apic.o vga.o
> +obj-$(CONFIG_XEN_DOM0)		+= vga.o
>  obj-$(CONFIG_SWIOTLB_XEN)	+= pci-swiotlb-xen.o
>  obj-$(CONFIG_XEN_EFI)		+= efi.o
> diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
> index c20fe29..cd248ff 100644
> --- a/arch/x86/xen/xen-ops.h
> +++ b/arch/x86/xen/xen-ops.h
> @@ -98,20 +98,17 @@ static inline void xen_uninit_lock_cpu(int cpu)
>  #endif
>  
>  struct dom0_vga_console_info;
> -
>  #ifdef CONFIG_XEN_DOM0
>  void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size);
> -void __init xen_init_apic(void);
>  #else
> -static inline void __init xen_init_vga(const struct dom0_vga_console_info *info,
> -				       size_t size)
> -{
> -}
> -static inline void __init xen_init_apic(void)
> +void __init xen_init_vga(const struct dom0_vga_console_info *info,
> +			size_t size);
>  {
>  }
>  #endif
>  
> +void __init xen_init_apic(void);
> +
>  #ifdef CONFIG_XEN_EFI
>  extern void xen_efi_init(void);
>  #else
> -- 
> 2.5.0
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] xen-apic: Enable on domU as well
       [not found]   ` <20150807142329.GC29527@l.oracle.com>
@ 2015-08-07 14:37     ` Jason A. Donenfeld
  0 siblings, 0 replies; 7+ messages in thread
From: Jason A. Donenfeld @ 2015-08-07 14:37 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Ian Campbell, netdev, linux-kernel, stable, xen-devel, David Vrabel

On Fri, Aug 7, 2015 at 4:23 PM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> Anyhow, your patch seems to fix a regression my patch
> feb44f1f7a4ac299d1ab1c3606860e70b9b89d69
> "x86/xen: Provide a "Xen PV" APIC driver to support >255 VCPUs"
> introduced.

Ahhh, good, okay. That explains why I didn't encounter this with older
kernels. The whole picture makes sense now. Thanks for reviewing this.

David - mergable?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3] xen-apic: Enable on domU as well
       [not found] ` <1438879025-27362-1-git-send-email-Jason@zx2c4.com>
  2015-08-07 14:23   ` Konrad Rzeszutek Wilk
       [not found]   ` <20150807142329.GC29527@l.oracle.com>
@ 2015-08-10 13:40   ` Jason A. Donenfeld
       [not found]   ` <1439214027-13994-1-git-send-email-Jason@zx2c4.com>
  3 siblings, 0 replies; 7+ messages in thread
From: Jason A. Donenfeld @ 2015-08-10 13:40 UTC (permalink / raw)
  To: David Vrabel, Ian Campbell, netdev, linux-kernel, xen-devel
  Cc: Jason A. Donenfeld, stable

It turns out that domU also requires the Xen APIC driver. Otherwise we
get stuck in busy loops that never exit, such as in this stack trace:

(gdb) target remote localhost:9999
Remote debugging using localhost:9999
__xapic_wait_icr_idle () at ./arch/x86/include/asm/ipi.h:56
56              while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
(gdb) bt
 #0  __xapic_wait_icr_idle () at ./arch/x86/include/asm/ipi.h:56
 #1  __default_send_IPI_shortcut (shortcut=<optimized out>,
dest=<optimized out>, vector=<optimized out>) at
./arch/x86/include/asm/ipi.h:75
 #2  apic_send_IPI_self (vector=246) at arch/x86/kernel/apic/probe_64.c:54
 #3  0xffffffff81011336 in arch_irq_work_raise () at
arch/x86/kernel/irq_work.c:47
 #4  0xffffffff8114990c in irq_work_queue (work=0xffff88000fc0e400) at
kernel/irq_work.c:100
 #5  0xffffffff8110c29d in wake_up_klogd () at kernel/printk/printk.c:2633
 #6  0xffffffff8110ca60 in vprintk_emit (facility=0, level=<optimized
out>, dict=0x0 <irq_stack_union>, dictlen=<optimized out>,
fmt=<optimized out>, args=<optimized out>)
    at kernel/printk/printk.c:1778
 #7  0xffffffff816010c8 in printk (fmt=<optimized out>) at
kernel/printk/printk.c:1868
 #8  0xffffffffc00013ea in ?? ()
 #9  0x0000000000000000 in ?? ()

Mailing-list-thread: https://lkml.org/lkml/2015/8/4/755
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: <stable@vger.kernel.org>
---
 arch/x86/xen/Makefile  | 4 ++--
 arch/x86/xen/xen-ops.h | 7 ++-----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 7322755..4b6e29a 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -13,13 +13,13 @@ CFLAGS_mmu.o			:= $(nostackp)
 obj-y		:= enlighten.o setup.o multicalls.o mmu.o irq.o \
 			time.o xen-asm.o xen-asm_$(BITS).o \
 			grant-table.o suspend.o platform-pci-unplug.o \
-			p2m.o
+			p2m.o apic.o
 
 obj-$(CONFIG_EVENT_TRACING) += trace.o
 
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
 obj-$(CONFIG_XEN_DEBUG_FS)	+= debugfs.o
-obj-$(CONFIG_XEN_DOM0)		+= apic.o vga.o
+obj-$(CONFIG_XEN_DOM0)		+= vga.o
 obj-$(CONFIG_SWIOTLB_XEN)	+= pci-swiotlb-xen.o
 obj-$(CONFIG_XEN_EFI)		+= efi.o
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index c20fe29..d0a543b 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -98,20 +98,17 @@ static inline void xen_uninit_lock_cpu(int cpu)
 #endif
 
 struct dom0_vga_console_info;
-
 #ifdef CONFIG_XEN_DOM0
 void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size);
-void __init xen_init_apic(void);
 #else
 static inline void __init xen_init_vga(const struct dom0_vga_console_info *info,
 				       size_t size)
 {
 }
-static inline void __init xen_init_apic(void)
-{
-}
 #endif
 
+void __init xen_init_apic(void);
+
 #ifdef CONFIG_XEN_EFI
 extern void xen_efi_init(void);
 #else
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] xen-apic: Enable on domU as well
       [not found]   ` <1439214027-13994-1-git-send-email-Jason@zx2c4.com>
@ 2015-08-10 13:41     ` David Vrabel
       [not found]     ` <55C8AA27.8090207@citrix.com>
  2015-08-11 10:46     ` David Vrabel
  2 siblings, 0 replies; 7+ messages in thread
From: David Vrabel @ 2015-08-10 13:41 UTC (permalink / raw)
  To: Jason A. Donenfeld, Ian Campbell, netdev, linux-kernel, xen-devel; +Cc: stable

On 10/08/15 14:40, Jason A. Donenfeld wrote:
> It turns out that domU also requires the Xen APIC driver. Otherwise we
> get stuck in busy loops that never exit, such as in this stack trace:

What's the difference between v3 and v2?

David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] xen-apic: Enable on domU as well
       [not found]     ` <55C8AA27.8090207@citrix.com>
@ 2015-08-10 13:44       ` Jason A. Donenfeld
  0 siblings, 0 replies; 7+ messages in thread
From: Jason A. Donenfeld @ 2015-08-10 13:44 UTC (permalink / raw)
  To: David Vrabel; +Cc: netdev, xen-devel, Ian Campbell, stable, linux-kernel

On Mon, Aug 10, 2015 at 3:41 PM, David Vrabel <david.vrabel@citrix.com> wrote:
> On 10/08/15 14:40, Jason A. Donenfeld wrote:
>> It turns out that domU also requires the Xen APIC driver. Otherwise we
>> get stuck in busy loops that never exit, such as in this stack trace:
>
> What's the difference between v3 and v2?

I did some silly things with vim in v2, and there's an extra
semicolon, some other formatting things, and a function is made
unstatic by accident. v3 is what I should have originally sent.
Functionally the same though.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] xen-apic: Enable on domU as well
       [not found]   ` <1439214027-13994-1-git-send-email-Jason@zx2c4.com>
  2015-08-10 13:41     ` David Vrabel
       [not found]     ` <55C8AA27.8090207@citrix.com>
@ 2015-08-11 10:46     ` David Vrabel
  2 siblings, 0 replies; 7+ messages in thread
From: David Vrabel @ 2015-08-11 10:46 UTC (permalink / raw)
  To: Jason A. Donenfeld, David Vrabel, Ian Campbell, netdev,
	linux-kernel, xen-devel
  Cc: stable

On 10/08/15 14:40, Jason A. Donenfeld wrote:
> It turns out that domU also requires the Xen APIC driver. Otherwise we
> get stuck in busy loops that never exit, such as in this stack trace:

Applied to for-linus-4.2 and tagged for stable, thanks.

David

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-11 10:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1438878579-26856-1-git-send-email-Jason@zx2c4.com>
2015-08-06 16:37 ` [PATCH v2] xen-apic: Enable on domU as well Jason A. Donenfeld
     [not found] ` <1438879025-27362-1-git-send-email-Jason@zx2c4.com>
2015-08-07 14:23   ` Konrad Rzeszutek Wilk
     [not found]   ` <20150807142329.GC29527@l.oracle.com>
2015-08-07 14:37     ` Jason A. Donenfeld
2015-08-10 13:40   ` [PATCH v3] " Jason A. Donenfeld
     [not found]   ` <1439214027-13994-1-git-send-email-Jason@zx2c4.com>
2015-08-10 13:41     ` David Vrabel
     [not found]     ` <55C8AA27.8090207@citrix.com>
2015-08-10 13:44       ` Jason A. Donenfeld
2015-08-11 10:46     ` David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).