All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
@ 2016-10-02 22:45 Boris Ostrovsky
  2016-10-03  8:43 ` Sander Eikelenboom
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2016-10-02 22:45 UTC (permalink / raw)
  To: david.vrabel, jgross; +Cc: xen-devel, linux-kernel, linux, Boris Ostrovsky

xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES
is defined, ends up calling xen_save_fl(). That routine expects
per_cpu(xen_vcpu, 0) to be already initialized.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
---
Sander, please see if this fixes the problem. Thanks.


 arch/x86/xen/enlighten.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 366b6ae..96c2dea 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1644,7 +1644,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	xen_initial_gdt = &per_cpu(gdt_page, 0);
 
 	xen_smp_init();
-	WARN_ON(xen_cpuhp_setup());
 
 #ifdef CONFIG_ACPI_NUMA
 	/*
@@ -1658,6 +1657,8 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	   possible map and a non-dummy shared_info. */
 	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
 
+	WARN_ON(xen_cpuhp_setup());
+
 	local_irq_disable();
 	early_boot_irqs_disabled = true;
 
-- 
1.8.3.1

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

* Re: [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
  2016-10-02 22:45 [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier Boris Ostrovsky
@ 2016-10-03  8:43 ` Sander Eikelenboom
  2016-10-03  8:43 ` Sander Eikelenboom
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sander Eikelenboom @ 2016-10-03  8:43 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: david.vrabel, jgross, xen-devel, linux-kernel

On 2016-10-03 00:45, Boris Ostrovsky wrote:
> xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES
> is defined, ends up calling xen_save_fl(). That routine expects
> per_cpu(xen_vcpu, 0) to be already initialized.
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> ---
> Sander, please see if this fixes the problem. Thanks.

Hi Boris,

I have tested it and it fixes the dom0 crash in early boot for me.
Thanks again for investigating and the swift fix !

--
Sander


>  arch/x86/xen/enlighten.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 366b6ae..96c2dea 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1644,7 +1644,6 @@ asmlinkage __visible void __init 
> xen_start_kernel(void)
>  	xen_initial_gdt = &per_cpu(gdt_page, 0);
> 
>  	xen_smp_init();
> -	WARN_ON(xen_cpuhp_setup());
> 
>  #ifdef CONFIG_ACPI_NUMA
>  	/*
> @@ -1658,6 +1657,8 @@ asmlinkage __visible void __init 
> xen_start_kernel(void)
>  	   possible map and a non-dummy shared_info. */
>  	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
> 
> +	WARN_ON(xen_cpuhp_setup());
> +
>  	local_irq_disable();
>  	early_boot_irqs_disabled = true;

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

* Re: [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
  2016-10-02 22:45 [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier Boris Ostrovsky
  2016-10-03  8:43 ` Sander Eikelenboom
@ 2016-10-03  8:43 ` Sander Eikelenboom
  2016-10-05  9:44 ` David Vrabel
  2016-10-05  9:44 ` [Xen-devel] " David Vrabel
  3 siblings, 0 replies; 6+ messages in thread
From: Sander Eikelenboom @ 2016-10-03  8:43 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: jgross, linux-kernel, david.vrabel, xen-devel

On 2016-10-03 00:45, Boris Ostrovsky wrote:
> xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES
> is defined, ends up calling xen_save_fl(). That routine expects
> per_cpu(xen_vcpu, 0) to be already initialized.
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> ---
> Sander, please see if this fixes the problem. Thanks.

Hi Boris,

I have tested it and it fixes the dom0 crash in early boot for me.
Thanks again for investigating and the swift fix !

--
Sander


>  arch/x86/xen/enlighten.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 366b6ae..96c2dea 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1644,7 +1644,6 @@ asmlinkage __visible void __init 
> xen_start_kernel(void)
>  	xen_initial_gdt = &per_cpu(gdt_page, 0);
> 
>  	xen_smp_init();
> -	WARN_ON(xen_cpuhp_setup());
> 
>  #ifdef CONFIG_ACPI_NUMA
>  	/*
> @@ -1658,6 +1657,8 @@ asmlinkage __visible void __init 
> xen_start_kernel(void)
>  	   possible map and a non-dummy shared_info. */
>  	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
> 
> +	WARN_ON(xen_cpuhp_setup());
> +
>  	local_irq_disable();
>  	early_boot_irqs_disabled = true;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [Xen-devel] [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
  2016-10-02 22:45 [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier Boris Ostrovsky
                   ` (2 preceding siblings ...)
  2016-10-05  9:44 ` David Vrabel
@ 2016-10-05  9:44 ` David Vrabel
  3 siblings, 0 replies; 6+ messages in thread
From: David Vrabel @ 2016-10-05  9:44 UTC (permalink / raw)
  To: Boris Ostrovsky, david.vrabel, jgross; +Cc: linux, linux-kernel, xen-devel

On 02/10/16 23:45, Boris Ostrovsky wrote:
> xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES
> is defined, ends up calling xen_save_fl(). That routine expects
> per_cpu(xen_vcpu, 0) to be already initialized.

Applied to for-linus-4.9, thanks.

David

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

* Re: [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
  2016-10-02 22:45 [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier Boris Ostrovsky
  2016-10-03  8:43 ` Sander Eikelenboom
  2016-10-03  8:43 ` Sander Eikelenboom
@ 2016-10-05  9:44 ` David Vrabel
  2016-10-05  9:44 ` [Xen-devel] " David Vrabel
  3 siblings, 0 replies; 6+ messages in thread
From: David Vrabel @ 2016-10-05  9:44 UTC (permalink / raw)
  To: Boris Ostrovsky, david.vrabel, jgross; +Cc: linux, linux-kernel, xen-devel

On 02/10/16 23:45, Boris Ostrovsky wrote:
> xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES
> is defined, ends up calling xen_save_fl(). That routine expects
> per_cpu(xen_vcpu, 0) to be already initialized.

Applied to for-linus-4.9, thanks.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier
@ 2016-10-02 22:45 Boris Ostrovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2016-10-02 22:45 UTC (permalink / raw)
  To: david.vrabel, jgross; +Cc: linux, Boris Ostrovsky, linux-kernel, xen-devel

xen_cpuhp_setup() calls mutex_lock() which, when CONFIG_DEBUG_MUTEXES
is defined, ends up calling xen_save_fl(). That routine expects
per_cpu(xen_vcpu, 0) to be already initialized.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
---
Sander, please see if this fixes the problem. Thanks.


 arch/x86/xen/enlighten.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 366b6ae..96c2dea 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1644,7 +1644,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	xen_initial_gdt = &per_cpu(gdt_page, 0);
 
 	xen_smp_init();
-	WARN_ON(xen_cpuhp_setup());
 
 #ifdef CONFIG_ACPI_NUMA
 	/*
@@ -1658,6 +1657,8 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	   possible map and a non-dummy shared_info. */
 	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
 
+	WARN_ON(xen_cpuhp_setup());
+
 	local_irq_disable();
 	early_boot_irqs_disabled = true;
 
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-10-05  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-02 22:45 [PATCH] xen/x86: Initialize per_cpu(xen_vcpu, 0) a little earlier Boris Ostrovsky
2016-10-03  8:43 ` Sander Eikelenboom
2016-10-03  8:43 ` Sander Eikelenboom
2016-10-05  9:44 ` David Vrabel
2016-10-05  9:44 ` [Xen-devel] " David Vrabel
2016-10-02 22:45 Boris Ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.