All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: initialize xen panic handler for PVHVM
@ 2013-08-16  8:10 Vaughan Cao
  2013-08-16 12:43   ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 10+ messages in thread
From: Vaughan Cao @ 2013-08-16  8:10 UTC (permalink / raw)
  To: konrad.wilk, jeremy, tglx, mingo, hpa, x86, xen-devel,
	virtualization, linux-kernel
  Cc: vaughan.cao

kernel use callback linked in panic_notifier_list to notice others when panic
happens.
NORET_TYPE void panic(const char * fmt, ...){
    ...
    atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
}
When xen aware this, it will call xen_reboot(SHUTDOWN_crash) to send out an
event with reason code - SHUTDOWN_crash.
xen_panic_handler_init() is defined to register on panic_notifier_list but
we only call it in xen_arch_setup which only be called by pvm, this patch is
 necessary for pvhvm.

Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
---
 arch/x86/xen/enlighten.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 4aec5ed..53e5726 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1713,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)
 
 	xen_hvm_init_shared_info();
 
+	xen_panic_handler_init();
+
 	if (xen_feature(XENFEAT_hvm_callback_vector))
 		xen_have_vector_callback = 1;
 	xen_hvm_smp_init();
-- 
1.7.11.7


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

* Re: [PATCH] xen: initialize xen panic handler for PVHVM
  2013-08-16  8:10 [PATCH] xen: initialize xen panic handler for PVHVM Vaughan Cao
@ 2013-08-16 12:43   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-08-16 12:43 UTC (permalink / raw)
  To: Vaughan Cao
  Cc: jeremy, tglx, mingo, hpa, x86, xen-devel, virtualization, linux-kernel

On Fri, Aug 16, 2013 at 04:10:56PM +0800, Vaughan Cao wrote:
> kernel use callback linked in panic_notifier_list to notice others when panic
> happens.
> NORET_TYPE void panic(const char * fmt, ...){
>     ...
>     atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
> }
> When xen aware this, it will call xen_reboot(SHUTDOWN_crash) to send out an
  ^^^^^^^^^^^^^^^^^^^-> "When Xen becomes aware of this"

> event with reason code - SHUTDOWN_crash.
> xen_panic_handler_init() is defined to register on panic_notifier_list but
> we only call it in xen_arch_setup which only be called by pvm, this patch is
                                          ^^^^^^^-> "is only"
>  necessary for pvhvm.

Could you tell me what has been happening without this patch?

Thank you.

> 
> Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
> ---
>  arch/x86/xen/enlighten.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 4aec5ed..53e5726 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1713,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)
>  
>  	xen_hvm_init_shared_info();
>  
> +	xen_panic_handler_init();
> +
>  	if (xen_feature(XENFEAT_hvm_callback_vector))
>  		xen_have_vector_callback = 1;
>  	xen_hvm_smp_init();
> -- 
> 1.7.11.7
> 

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

* Re: [PATCH] xen: initialize xen panic handler for PVHVM
@ 2013-08-16 12:43   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-08-16 12:43 UTC (permalink / raw)
  To: Vaughan Cao
  Cc: jeremy, xen-devel, x86, linux-kernel, virtualization, mingo, hpa, tglx

On Fri, Aug 16, 2013 at 04:10:56PM +0800, Vaughan Cao wrote:
> kernel use callback linked in panic_notifier_list to notice others when panic
> happens.
> NORET_TYPE void panic(const char * fmt, ...){
>     ...
>     atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
> }
> When xen aware this, it will call xen_reboot(SHUTDOWN_crash) to send out an
  ^^^^^^^^^^^^^^^^^^^-> "When Xen becomes aware of this"

> event with reason code - SHUTDOWN_crash.
> xen_panic_handler_init() is defined to register on panic_notifier_list but
> we only call it in xen_arch_setup which only be called by pvm, this patch is
                                          ^^^^^^^-> "is only"
>  necessary for pvhvm.

Could you tell me what has been happening without this patch?

Thank you.

> 
> Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
> ---
>  arch/x86/xen/enlighten.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 4aec5ed..53e5726 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1713,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)
>  
>  	xen_hvm_init_shared_info();
>  
> +	xen_panic_handler_init();
> +
>  	if (xen_feature(XENFEAT_hvm_callback_vector))
>  		xen_have_vector_callback = 1;
>  	xen_hvm_smp_init();
> -- 
> 1.7.11.7
> 

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

* Re: [PATCH] xen: initialize xen panic handler for PVHVM
  2013-08-16 12:43   ` Konrad Rzeszutek Wilk
  (?)
@ 2013-08-19  2:38     ` vaughan
  -1 siblings, 0 replies; 10+ messages in thread
From: vaughan @ 2013-08-19  2:38 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: jeremy, tglx, mingo, hpa, x86, xen-devel, virtualization, linux-kernel

On 08/16/2013 08:43 PM, Konrad Rzeszutek Wilk wrote:
> On Fri, Aug 16, 2013 at 04:10:56PM +0800, Vaughan Cao wrote:
>> kernel use callback linked in panic_notifier_list to notice others when panic
>> happens.
>> NORET_TYPE void panic(const char * fmt, ...){
>>     ...
>>     atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
>> }
>> When xen aware this, it will call xen_reboot(SHUTDOWN_crash) to send out an
>   ^^^^^^^^^^^^^^^^^^^-> "When Xen becomes aware of this"
>
>> event with reason code - SHUTDOWN_crash.
>> xen_panic_handler_init() is defined to register on panic_notifier_list but
>> we only call it in xen_arch_setup which only be called by pvm, this patch is
>                                           ^^^^^^^-> "is only"
>>  necessary for pvhvm.
> Could you tell me what has been happening without this patch?
Setting 'on_crash=coredump-restart' in PVHVM guest config file can't
lead a vmcore to be generate when the guest panics. It can be reproduced
with 'echo c > /proc/sysrq-trigger'.
>From the xend.log, we find the reason code gotten by dominfo is not as
expected:
  [2013-07-29 08:55:37 19378] INFO (XendDomainInfo:2148) Domain has
shutdown: name=oakDom1 id=15 reason=reboot.
While log from a guest who can capture the crash is as below:   
  [2013-07-29 08:13:42 19378] WARNING (XendDomainInfo:2131) Domain has
crashed: name=oakDom1 id=14.

Thanks,
Vaughan
>
> Thank you.
>
>> Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
>> ---
>>  arch/x86/xen/enlighten.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
>> index 4aec5ed..53e5726 100644
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -1713,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)
>>  
>>  	xen_hvm_init_shared_info();
>>  
>> +	xen_panic_handler_init();
>> +
>>  	if (xen_feature(XENFEAT_hvm_callback_vector))
>>  		xen_have_vector_callback = 1;
>>  	xen_hvm_smp_init();
>> -- 
>> 1.7.11.7
>>


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

* Re: [PATCH] xen: initialize xen panic handler for PVHVM
@ 2013-08-19  2:38     ` vaughan
  0 siblings, 0 replies; 10+ messages in thread
From: vaughan @ 2013-08-19  2:38 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: jeremy, xen-devel, x86, linux-kernel, virtualization, mingo, hpa, tglx

On 08/16/2013 08:43 PM, Konrad Rzeszutek Wilk wrote:
> On Fri, Aug 16, 2013 at 04:10:56PM +0800, Vaughan Cao wrote:
>> kernel use callback linked in panic_notifier_list to notice others when panic
>> happens.
>> NORET_TYPE void panic(const char * fmt, ...){
>>     ...
>>     atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
>> }
>> When xen aware this, it will call xen_reboot(SHUTDOWN_crash) to send out an
>   ^^^^^^^^^^^^^^^^^^^-> "When Xen becomes aware of this"
>
>> event with reason code - SHUTDOWN_crash.
>> xen_panic_handler_init() is defined to register on panic_notifier_list but
>> we only call it in xen_arch_setup which only be called by pvm, this patch is
>                                           ^^^^^^^-> "is only"
>>  necessary for pvhvm.
> Could you tell me what has been happening without this patch?
Setting 'on_crash=coredump-restart' in PVHVM guest config file can't
lead a vmcore to be generate when the guest panics. It can be reproduced
with 'echo c > /proc/sysrq-trigger'.
From the xend.log, we find the reason code gotten by dominfo is not as
expected:
  [2013-07-29 08:55:37 19378] INFO (XendDomainInfo:2148) Domain has
shutdown: name=oakDom1 id=15 reason=reboot.
While log from a guest who can capture the crash is as below:   
  [2013-07-29 08:13:42 19378] WARNING (XendDomainInfo:2131) Domain has
crashed: name=oakDom1 id=14.

Thanks,
Vaughan
>
> Thank you.
>
>> Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
>> ---
>>  arch/x86/xen/enlighten.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
>> index 4aec5ed..53e5726 100644
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -1713,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)
>>  
>>  	xen_hvm_init_shared_info();
>>  
>> +	xen_panic_handler_init();
>> +
>>  	if (xen_feature(XENFEAT_hvm_callback_vector))
>>  		xen_have_vector_callback = 1;
>>  	xen_hvm_smp_init();
>> -- 
>> 1.7.11.7
>>

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

* Re: [PATCH] xen: initialize xen panic handler for PVHVM
@ 2013-08-19  2:38     ` vaughan
  0 siblings, 0 replies; 10+ messages in thread
From: vaughan @ 2013-08-19  2:38 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: jeremy, xen-devel, x86, linux-kernel, virtualization, mingo, hpa, tglx

On 08/16/2013 08:43 PM, Konrad Rzeszutek Wilk wrote:
> On Fri, Aug 16, 2013 at 04:10:56PM +0800, Vaughan Cao wrote:
>> kernel use callback linked in panic_notifier_list to notice others when panic
>> happens.
>> NORET_TYPE void panic(const char * fmt, ...){
>>     ...
>>     atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
>> }
>> When xen aware this, it will call xen_reboot(SHUTDOWN_crash) to send out an
>   ^^^^^^^^^^^^^^^^^^^-> "When Xen becomes aware of this"
>
>> event with reason code - SHUTDOWN_crash.
>> xen_panic_handler_init() is defined to register on panic_notifier_list but
>> we only call it in xen_arch_setup which only be called by pvm, this patch is
>                                           ^^^^^^^-> "is only"
>>  necessary for pvhvm.
> Could you tell me what has been happening without this patch?
Setting 'on_crash=coredump-restart' in PVHVM guest config file can't
lead a vmcore to be generate when the guest panics. It can be reproduced
with 'echo c > /proc/sysrq-trigger'.
>From the xend.log, we find the reason code gotten by dominfo is not as
expected:
  [2013-07-29 08:55:37 19378] INFO (XendDomainInfo:2148) Domain has
shutdown: name=oakDom1 id=15 reason=reboot.
While log from a guest who can capture the crash is as below:   
  [2013-07-29 08:13:42 19378] WARNING (XendDomainInfo:2131) Domain has
crashed: name=oakDom1 id=14.

Thanks,
Vaughan
>
> Thank you.
>
>> Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
>> ---
>>  arch/x86/xen/enlighten.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
>> index 4aec5ed..53e5726 100644
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -1713,6 +1713,8 @@ static void __init xen_hvm_guest_init(void)
>>  
>>  	xen_hvm_init_shared_info();
>>  
>> +	xen_panic_handler_init();
>> +
>>  	if (xen_feature(XENFEAT_hvm_callback_vector))
>>  		xen_have_vector_callback = 1;
>>  	xen_hvm_smp_init();
>> -- 
>> 1.7.11.7
>>

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

* Re: [Xen-devel] [PATCH] xen: initialize xen panic handler for PVHVM
  2013-08-16 12:43   ` Konrad Rzeszutek Wilk
                     ` (2 preceding siblings ...)
  (?)
@ 2013-08-19  6:18   ` Joe Jin
  2013-08-20 19:39       ` Konrad Rzeszutek Wilk
  -1 siblings, 1 reply; 10+ messages in thread
From: Joe Jin @ 2013-08-19  6:18 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Vaughan Cao, jeremy, xen-devel, x86, linux-kernel,
	virtualization, mingo, hpa, tglx

On 08/16/13 20:43, Konrad Rzeszutek Wilk wrote:
> Could you tell me what has been happening without this patch?

Without this patch, Xen would not get pvhvm crash event, any config for
on_crash in guest configure file will not be triggered.

Thanks,
Joe


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

* Re: [Xen-devel] [PATCH] xen: initialize xen panic handler for PVHVM
  2013-08-16 12:43   ` Konrad Rzeszutek Wilk
  (?)
  (?)
@ 2013-08-19  6:18   ` Joe Jin
  -1 siblings, 0 replies; 10+ messages in thread
From: Joe Jin @ 2013-08-19  6:18 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: jeremy, xen-devel, Vaughan Cao, x86, linux-kernel,
	virtualization, mingo, hpa, tglx

On 08/16/13 20:43, Konrad Rzeszutek Wilk wrote:
> Could you tell me what has been happening without this patch?

Without this patch, Xen would not get pvhvm crash event, any config for
on_crash in guest configure file will not be triggered.

Thanks,
Joe

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

* Re: [Xen-devel] [PATCH] xen: initialize xen panic handler for PVHVM
  2013-08-19  6:18   ` Joe Jin
@ 2013-08-20 19:39       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-08-20 19:39 UTC (permalink / raw)
  To: Joe Jin
  Cc: Vaughan Cao, jeremy, xen-devel, x86, linux-kernel,
	virtualization, mingo, hpa, tglx

On Mon, Aug 19, 2013 at 02:18:42PM +0800, Joe Jin wrote:
> On 08/16/13 20:43, Konrad Rzeszutek Wilk wrote:
> > Could you tell me what has been happening without this patch?
> 
> Without this patch, Xen would not get pvhvm crash event, any config for
> on_crash in guest configure file will not be triggered.

applied for 3.12
> 
> Thanks,
> Joe
> 

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

* Re: [Xen-devel] [PATCH] xen: initialize xen panic handler for PVHVM
@ 2013-08-20 19:39       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-08-20 19:39 UTC (permalink / raw)
  To: Joe Jin
  Cc: jeremy, xen-devel, Vaughan Cao, x86, linux-kernel,
	virtualization, mingo, hpa, tglx

On Mon, Aug 19, 2013 at 02:18:42PM +0800, Joe Jin wrote:
> On 08/16/13 20:43, Konrad Rzeszutek Wilk wrote:
> > Could you tell me what has been happening without this patch?
> 
> Without this patch, Xen would not get pvhvm crash event, any config for
> on_crash in guest configure file will not be triggered.

applied for 3.12
> 
> Thanks,
> Joe
> 

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

end of thread, other threads:[~2013-08-20 19:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-16  8:10 [PATCH] xen: initialize xen panic handler for PVHVM Vaughan Cao
2013-08-16 12:43 ` Konrad Rzeszutek Wilk
2013-08-16 12:43   ` Konrad Rzeszutek Wilk
2013-08-19  2:38   ` vaughan
2013-08-19  2:38     ` vaughan
2013-08-19  2:38     ` vaughan
2013-08-19  6:18   ` [Xen-devel] " Joe Jin
2013-08-19  6:18   ` Joe Jin
2013-08-20 19:39     ` Konrad Rzeszutek Wilk
2013-08-20 19:39       ` Konrad Rzeszutek Wilk

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.