Re: [PATCH v2] xen/pv: Fix a boot up hang revealed by int3 self test

2019-07-12 Thread Zhenzhong Duan

On 2019/7/12 21:09, Peter Zijlstra wrote:

On Fri, Jul 12, 2019 at 09:04:22PM +0800, Zhenzhong Duan wrote:

On 2019/7/12 20:06, Peter Zijlstra wrote:

On Thu, Jul 11, 2019 at 04:15:21PM +0800, Zhenzhong Duan wrote:

diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 4722ba2..2138d69 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -596,7 +596,7 @@ struct trap_array_entry {
   static struct trap_array_entry trap_array[] = {
{ debug,   xen_xendebug,true },
-   { int3,xen_xenint3, true },
+   { int3,xen_int3,true },
{ double_fault,xen_double_fault,true },
   #ifdef CONFIG_X86_MCE
{ machine_check,   xen_machine_check,   true },

I'm confused on the purpose of trap_array[], could you elucidate me?

Used to replace trap handler addresses by Xen specific ones and sanity check

if there's an unexpected IST-using fault handler.

git grep xen_int3, failed me. Where does that symbol come from?


Generated by "xen_pv_trap int3" in arch/x86/xen/xen-asm_64.S

Zhenzhong



Re: [PATCH v2] xen/pv: Fix a boot up hang revealed by int3 self test

2019-07-12 Thread Peter Zijlstra
On Fri, Jul 12, 2019 at 03:09:16PM +0200, Peter Zijlstra wrote:
> On Fri, Jul 12, 2019 at 09:04:22PM +0800, Zhenzhong Duan wrote:
> > 
> > On 2019/7/12 20:06, Peter Zijlstra wrote:
> > > On Thu, Jul 11, 2019 at 04:15:21PM +0800, Zhenzhong Duan wrote:
> > > > diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
> > > > index 4722ba2..2138d69 100644
> > > > --- a/arch/x86/xen/enlighten_pv.c
> > > > +++ b/arch/x86/xen/enlighten_pv.c
> > > > @@ -596,7 +596,7 @@ struct trap_array_entry {
> > > >   static struct trap_array_entry trap_array[] = {
> > > > { debug,   xen_xendebug,
> > > > true },
> > > > -   { int3,xen_xenint3, 
> > > > true },
> > > > +   { int3,xen_int3,
> > > > true },
> > > > { double_fault,xen_double_fault,
> > > > true },
> > > >   #ifdef CONFIG_X86_MCE
> > > > { machine_check,   xen_machine_check,   
> > > > true },
> > > I'm confused on the purpose of trap_array[], could you elucidate me?
> > 
> > Used to replace trap handler addresses by Xen specific ones and sanity check
> > 
> > if there's an unexpected IST-using fault handler.
> 
> git grep xen_int3, failed me. Where does that symbol come from?

N/m I found it... must be blind today.


Re: [PATCH v2] xen/pv: Fix a boot up hang revealed by int3 self test

2019-07-12 Thread Peter Zijlstra
On Fri, Jul 12, 2019 at 09:04:22PM +0800, Zhenzhong Duan wrote:
> 
> On 2019/7/12 20:06, Peter Zijlstra wrote:
> > On Thu, Jul 11, 2019 at 04:15:21PM +0800, Zhenzhong Duan wrote:
> > > diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
> > > index 4722ba2..2138d69 100644
> > > --- a/arch/x86/xen/enlighten_pv.c
> > > +++ b/arch/x86/xen/enlighten_pv.c
> > > @@ -596,7 +596,7 @@ struct trap_array_entry {
> > >   static struct trap_array_entry trap_array[] = {
> > >   { debug,   xen_xendebug,
> > > true },
> > > - { int3,xen_xenint3, true },
> > > + { int3,xen_int3,true },
> > >   { double_fault,xen_double_fault,
> > > true },
> > >   #ifdef CONFIG_X86_MCE
> > >   { machine_check,   xen_machine_check,   
> > > true },
> > I'm confused on the purpose of trap_array[], could you elucidate me?
> 
> Used to replace trap handler addresses by Xen specific ones and sanity check
> 
> if there's an unexpected IST-using fault handler.

git grep xen_int3, failed me. Where does that symbol come from?

> > The sole user seems to be get_trap_addr() and that talks about ISTs, but
> > #BP isn't an IST anymore, so why does it have ist_okay=true?
> 
> Oh, yes, I missed that boolean, thanks. I'll try ist_okey=false for int3 and
> test it tomorrow.

Thanks!


Re: [PATCH v2] xen/pv: Fix a boot up hang revealed by int3 self test

2019-07-12 Thread Zhenzhong Duan



On 2019/7/12 20:06, Peter Zijlstra wrote:

On Thu, Jul 11, 2019 at 04:15:21PM +0800, Zhenzhong Duan wrote:

diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 4722ba2..2138d69 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -596,7 +596,7 @@ struct trap_array_entry {
  
  static struct trap_array_entry trap_array[] = {

{ debug,   xen_xendebug,true },
-   { int3,xen_xenint3, true },
+   { int3,xen_int3,true },
{ double_fault,xen_double_fault,true },
  #ifdef CONFIG_X86_MCE
{ machine_check,   xen_machine_check,   true },

I'm confused on the purpose of trap_array[], could you elucidate me?


Used to replace trap handler addresses by Xen specific ones and sanity check

if there's an unexpected IST-using fault handler.



The sole user seems to be get_trap_addr() and that talks about ISTs, but
#BP isn't an IST anymore, so why does it have ist_okay=true?


Oh, yes, I missed that boolean, thanks. I'll try ist_okey=false for int3 
and test it tomorrow.


Zhenzhong



Re: [PATCH v2] xen/pv: Fix a boot up hang revealed by int3 self test

2019-07-12 Thread Peter Zijlstra
On Thu, Jul 11, 2019 at 04:15:21PM +0800, Zhenzhong Duan wrote:
> diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
> index 4722ba2..2138d69 100644
> --- a/arch/x86/xen/enlighten_pv.c
> +++ b/arch/x86/xen/enlighten_pv.c
> @@ -596,7 +596,7 @@ struct trap_array_entry {
>  
>  static struct trap_array_entry trap_array[] = {
>   { debug,   xen_xendebug,true },
> - { int3,xen_xenint3, true },
> + { int3,xen_int3,true },
>   { double_fault,xen_double_fault,true },
>  #ifdef CONFIG_X86_MCE
>   { machine_check,   xen_machine_check,   true },

I'm confused on the purpose of trap_array[], could you elucidate me?

The sole user seems to be get_trap_addr() and that talks about ISTs, but
#BP isn't an IST anymore, so why does it have ist_okay=true?