Skip to contentSkip to conversation

Xen: do hv callback accounting only on x86

PATCH In review Arnd Bergmann 3 participants 9 messages Mar 25, 2014 – Apr 4, 2014 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Xen: do hv callback accounting only on x86

Patch 99c8b79d3c1 "xen: Add proper irq accounting for HYPERCALL vector" added a call to inc_irq_stat(irq_hv_callback_count) in common Xen code, however both the inc_irq_stat function and the irq_hv_callback_count counter are architecture specific.

This makes the code build again on ARM by moving the call into the existing #ifdef CONFIG_X86. We may want to later do the same implementation on ARM that x86 has though.

Cc Thomas Gleixner <[email protected]>
Cc David Vrabel <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
drivers/xen/events/events_base.c +1 -0
index 5dd2ddf..8b91c256 100644
@@ -1235,6 +1235,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 #ifdef CONFIG_X86
        exit_idle();
 #endif
+       inc_irq_stat(irq_hv_callback_count);
 
        __xen_evtchn_do_upcall();
 
drivers/xen/events/events_base.c +1 -1
index d5a3de8..dfa12a4 100644
@@ -1248,8 +1248,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 	irq_enter();
 #ifdef CONFIG_X86
 	exit_idle();
-#endif
 	inc_irq_stat(irq_hv_callback_count);
+#endif
 
 	__xen_evtchn_do_upcall();
 
#1 lore raw
Quoted 17 lines · On Tuesday 25 March 2014 16:52:25 Arnd Bergmann wrote:
drivers/xen/events/events_base.c +1 -0
index 5dd2ddf..8b91c256 100644
@@ -1235,6 +1235,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 #ifdef CONFIG_X86
        exit_idle();
 #endif
+       inc_irq_stat(irq_hv_callback_count);
 
        __xen_evtchn_do_upcall();
 
drivers/xen/events/events_base.c +0 -0
index d5a3de8..dfa12a4 100644

drivers/xen/events/events_base.c void xen_evtchn_do_upcall(struct pt_regs *regs) · line 1254

Quoted 8 lines
drivers/xen/events/events_base.c +1 -1
@@ -1248,8 +1248,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
        irq_enter();
 #ifdef CONFIG_X86
        exit_idle();
-#endif
        inc_irq_stat(irq_hv_callback_count);
+#endif
 
        __xen_evtchn_do_upcall();

That was unintended: the first half of this email is actually the patch that introduced the bug, while the second half is my workaround. The way it's formatted, you won't be able to apply it without removing the first half again. I'll wait if the approach is ok first and then resend it properly if needed.

Arnd

#2 lore raw

Hi,

(Adding Ian and Stefano).

Quoted 25 lines · Arnd Bergmann
Quoted 24 lines · On Tuesday 25 March 2014 16:52:25 Arnd Bergmann wrote:
drivers/xen/events/events_base.c +1 -0
index 5dd2ddf..8b91c256 100644
@@ -1235,6 +1235,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 #ifdef CONFIG_X86
        exit_idle();
 #endif
+       inc_irq_stat(irq_hv_callback_count);
 
        __xen_evtchn_do_upcall();
 
drivers/xen/events/events_base.c +1 -1
index d5a3de8..dfa12a4 100644
@@ -1248,8 +1248,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
        irq_enter();
 #ifdef CONFIG_X86
        exit_idle();
-#endif
        inc_irq_stat(irq_hv_callback_count);
+#endif
 
Quoted 7 lines

drivers/xen/events/events_base.c void xen_evtchn_do_upcall(struct pt_regs *regs) · line 1254

Quoted 1 line
drivers/xen/events/events_base.c +0 -0
        __xen_evtchn_do_upcall();

That was unintended: the first half of this email is actually the patch that introduced the bug, while the second half is my workaround. The way it's formatted, you won't be able to apply it without removing the first half again. I'll wait if the approach is ok first and then resend it properly if needed.

Linus has merged xen/tip yesterday and building ARM with CONFIG_XEN=y is now broken.

Is there any plan to push this patch (without the first half of course :)) or reverting the following commit:
commit 99c8b79d3c165f8e2a6247c14bfa1429e7efe51f

Author: Thomas Gleixner <[email protected]>
Date:   Sun Feb 23 21:40:21 2014 +0000

xen: Add proper irq accounting for HYPERCALL vector

Sincerely yours,

Signature · 1 line
Julien Grall
#3 lore raw
Quoted 2 lines · Julien Grall

Linus has merged xen/tip yesterday and building ARM with CONFIG_XEN=y is now broken.

My mistake, it's not because of xen/tip, but some other branches.

Signature · 1 line
Julien Grall
#4 lore raw
In reply to Julien Grall
Quoted 2 lines · Julien Grall

Linus has merged xen/tip yesterday and building ARM with CONFIG_XEN=y is now broken.

My mistake, it's not because of xen/tip, but some other branches.

Signature · 1 line
Julien Grall
#5 lore raw
In reply to Julien Grall
Quoted 3 lines · Julien Grall

Linus has merged xen/tip yesterday and building ARM with CONFIG_XEN=y is now broken.

Sorry, I couldn't add this patch to the xen tree at the time since the change was on a different tree and then I forgot about it.

Now applied to devel/for-linus-3.15.

David

#6 lore raw
In reply to Julien Grall
Quoted 3 lines · Julien Grall

Linus has merged xen/tip yesterday and building ARM with CONFIG_XEN=y is now broken.

Sorry, I couldn't add this patch to the xen tree at the time since the change was on a different tree and then I forgot about it.

Now applied to devel/for-linus-3.15.

David

#7 lore raw
In reply to Arnd Bergmann

Hi,

(Adding Ian and Stefano).

Quoted 25 lines · Arnd Bergmann
Quoted 24 lines · On Tuesday 25 March 2014 16:52:25 Arnd Bergmann wrote:
drivers/xen/events/events_base.c +1 -0
index 5dd2ddf..8b91c256 100644
@@ -1235,6 +1235,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 #ifdef CONFIG_X86
        exit_idle();
 #endif
+       inc_irq_stat(irq_hv_callback_count);
 
        __xen_evtchn_do_upcall();
 
drivers/xen/events/events_base.c +1 -1
index d5a3de8..dfa12a4 100644
@@ -1248,8 +1248,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
        irq_enter();
 #ifdef CONFIG_X86
        exit_idle();
-#endif
        inc_irq_stat(irq_hv_callback_count);
+#endif
 
Quoted 7 lines

drivers/xen/events/events_base.c void xen_evtchn_do_upcall(struct pt_regs *regs) · line 1254

Quoted 1 line
drivers/xen/events/events_base.c +0 -0
        __xen_evtchn_do_upcall();

That was unintended: the first half of this email is actually the patch that introduced the bug, while the second half is my workaround. The way it's formatted, you won't be able to apply it without removing the first half again. I'll wait if the approach is ok first and then resend it properly if needed.

Linus has merged xen/tip yesterday and building ARM with CONFIG_XEN=y is now broken.

Is there any plan to push this patch (without the first half of course :)) or reverting the following commit:
commit 99c8b79d3c165f8e2a6247c14bfa1429e7efe51f

Author: Thomas Gleixner <[email protected]>
Date:   Sun Feb 23 21:40:21 2014 +0000

xen: Add proper irq accounting for HYPERCALL vector

Sincerely yours,

Signature · 1 line
Julien Grall
#8 lore raw
In reply to Arnd Bergmann
Quoted 17 lines · On Tuesday 25 March 2014 16:52:25 Arnd Bergmann wrote:
drivers/xen/events/events_base.c +1 -0
index 5dd2ddf..8b91c256 100644
@@ -1235,6 +1235,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 #ifdef CONFIG_X86
        exit_idle();
 #endif
+       inc_irq_stat(irq_hv_callback_count);
 
        __xen_evtchn_do_upcall();
 
drivers/xen/events/events_base.c +0 -0
index d5a3de8..dfa12a4 100644

drivers/xen/events/events_base.c void xen_evtchn_do_upcall(struct pt_regs *regs) · line 1254

Quoted 8 lines
drivers/xen/events/events_base.c +1 -1
@@ -1248,8 +1248,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
        irq_enter();
 #ifdef CONFIG_X86
        exit_idle();
-#endif
        inc_irq_stat(irq_hv_callback_count);
+#endif
 
        __xen_evtchn_do_upcall();

That was unintended: the first half of this email is actually the patch that introduced the bug, while the second half is my workaround. The way it's formatted, you won't be able to apply it without removing the first half again. I'll wait if the approach is ok first and then resend it properly if needed.

Arnd