Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Andrew Cooper
On 05/05/2015 07:28, Chen, Tiejun wrote: > On 2015/5/5 14:02, Andrew Cooper wrote: >> On 05/05/2015 05:46, Chen, Tiejun wrote: >>> A better approach might be: printk(KERN_DEBUG "APIC error on CPU%u: %02lx(%02lx)", ...) for ( i = (1<<7); i; i >>= 1 ) if ( v1 & i )

Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Chen, Tiejun
On 2015/5/5 14:02, Andrew Cooper wrote: On 05/05/2015 05:46, Chen, Tiejun wrote: A better approach might be: printk(KERN_DEBUG "APIC error on CPU%u: %02lx(%02lx)", ...) for ( i = (1<<7); i; i >>= 1 ) if ( v1 & i ) printk(", %s", apic_fault_reasons[i]); I guess this should be apic_

Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Andrew Cooper
On 05/05/2015 05:46, Chen, Tiejun wrote: > >> A better approach might be: >> >> printk(KERN_DEBUG "APIC error on CPU%u: %02lx(%02lx)", ...) >> for ( i = (1<<7); i; i >>= 1 ) >>if ( v1 & i ) >> printk(", %s", apic_fault_reasons[i]); > > I guess this should be apic_fault_reasons[ffs(i) - 1].

Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Chen, Tiejun
On 2015/5/4 16:25, Andrew Cooper wrote: On 04/05/2015 03:03, Tiejun Chen wrote: Just make this readable while debug. "debugging" Fixed. Signed-off-by: Tiejun Chen In principle, I fully agree with the change. (I had an item on my todo list to make a change like this anyway). ---

Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Chen, Tiejun
On 2015/5/4 16:07, Jan Beulich wrote: On 04.05.15 at 04:03, wrote: --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -1319,28 +1319,37 @@ out: ; * This interrupt should never happen with our APIC/SMP architecture */ +static const char *apic_fault_reasons[] = If at all, then this s

Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Andrew Cooper
On 04/05/2015 03:03, Tiejun Chen wrote: > Just make this readable while debug. "debugging" > > Signed-off-by: Tiejun Chen In principle, I fully agree with the change. (I had an item on my todo list to make a change like this anyway). > --- > xen/arch/x86/apic.c | 33 +

Re: [Xen-devel] [RFC][PATCH] xen/apic: refactor error_interrupt

2015-05-04 Thread Jan Beulich
>>> On 04.05.15 at 04:03, wrote: > --- a/xen/arch/x86/apic.c > +++ b/xen/arch/x86/apic.c > @@ -1319,28 +1319,37 @@ out: ; > * This interrupt should never happen with our APIC/SMP architecture > */ > > +static const char *apic_fault_reasons[] = If at all, then this should be const. But... >