xen_hvm_callback_vector
Subsystems (2)
Should entry_64.S's xen_hvm_callback_vector be callingxen_evtchn_do_upcall or xen_hvm_evtchn_do_upcall? If not the hvm version, when does that get used?
J
Quoted 3 lines · Jeremy Fitzhardinge
Should entry_64.S's
xen_hvm_callback_vectorbe callingxen_evtchn_do_upcallorxen_hvm_evtchn_do_upcall? If not the hvm version, when does that get used?
xen_evtchn_do_upcall is used for the callback vector interrupt injection (and regular PV obviously).
xen_hvm_evtchn_do_upcall is used by the old-style PCI IRQ injection route in platform-pci.c if the callback vector is not available.
So entry_64.S should be using xen_evtchn_do_upcall.
Also, I think smp_xen_hvm_callback_vector is simply a redundant duplicate of xen_evtchn_do_upcall which could be removed.
Ian.
Quoted 10 lines · Ian Campbell
xen_evtchn_do_upcallis used for the callback vector interrupt injection (and regular PV obviously).
xen_hvm_evtchn_do_upcallis used by the old-style PCI IRQ injection route inplatform-pci.cif the callback vector is not available.So
entry_64.Sshould be usingxen_evtchn_do_upcall.Also, I think
smp_xen_hvm_callback_vectoris simply a redundant duplicate ofxen_evtchn_do_upcallwhich could be removed.
smp_xen_hvm_callback_vector is just missing, so I think it should be using BUILD_INTERRUPT3 with the third arg being xen_evtchn_do_upcall.
J
Quoted 7 lines · Jeremy Fitzhardinge
Quoted 6 lines · Ian Campbell
xen_evtchn_do_upcallis used for the callback vector interrupt injection (and regular PV obviously).
xen_hvm_evtchn_do_upcallis used by the old-style PCI IRQ injection route inplatform-pci.cif the callback vector is not available.
Quoted 6 lines
Quoted 4 lines
So
entry_64.Sshould be usingxen_evtchn_do_upcall.Also, I think
smp_xen_hvm_callback_vectoris simply a redundant duplicate ofxen_evtchn_do_upcallwhich could be removed.
smp_xen_hvm_callback_vectoris just missing,
It's in drivers/xen/events.c, in the stable-2.6.32.x branch at least.
Quoted 2 lines
so I think it should be
usingBUILD_INTERRUPT3with the third arg beingxen_evtchn_do_upcall.
I agree.
Ian.
Quoted 11 lines · Jeremy Fitzhardinge
Quoted 10 lines · Ian Campbell
xen_evtchn_do_upcallis used for the callback vector interrupt injection (and regular PV obviously).
xen_hvm_evtchn_do_upcallis used by the old-style PCI IRQ injection route inplatform-pci.cif the callback vector is not available.So
entry_64.Sshould be usingxen_evtchn_do_upcall.Also, I think
smp_xen_hvm_callback_vectoris simply a redundant duplicate ofxen_evtchn_do_upcallwhich could be removed.
That's true, in fact I removed it in my tree.
It should be removed in the upstream version too, I just forgot to send an update to Jeremy for the stable tree.
In my tree in entry_64 I have
apicinterrupt XEN_HVM_EVTCHN_CALLBACK \
xen_hvm_callback_vector xen_evtchn_do_upcall
where xen_evtchn_do_upcall is the same callback that PV guests use and smp_xen_hvm_callback_vector has been removed from drivers/xen/events.c too.
Quoted 3 lines
smp_xen_hvm_callback_vectoris just missing, so I think it should be usingBUILD_INTERRUPT3with the third arg beingxen_evtchn_do_upcall.
BUILD_INTERRUPT3 is an x86_32 only MACRO, that's why I am using apicinterrupt instead.
Quoted 4 lines · Stefano Stabellini
Quoted 2 lines
smp_xen_hvm_callback_vectoris just missing, so I think it should be usingBUILD_INTERRUPT3with the third arg beingxen_evtchn_do_upcall.
BUILD_INTERRUPT3is anx86_32only MACRO, that's why I am using apicinterrupt instead.
My original problem was that my 32-bit builds were failing because smp_xen_hvm_callback_vector was missing. I wonder if its the collision of two sets of patches.
J
Quoted 9 lines · Jeremy Fitzhardinge
Quoted 4 lines · Stefano Stabellini
Quoted 2 lines
smp_xen_hvm_callback_vectoris just missing, so I think it should be usingBUILD_INTERRUPT3with the third arg beingxen_evtchn_do_upcall.
BUILD_INTERRUPT3is anx86_32only MACRO, that's why I am using apicinterrupt instead.My original problem was that my 32-bit builds were failing because
smp_xen_hvm_callback_vectorwas missing. I wonder if its the collision of two sets of patches.
I think you are just missing a patch like this one:
---
arch/x86/kernel/entry_64.S +1 -1
@@ -1365,7 +1365,7 @@ ENTRY(xen_failsafe_callback) END(xen_failsafe_callback) apicinterrupt XEN_HVM_EVTCHN_CALLBACK \ - xen_hvm_callback_vector smp_xen_hvm_callback_vector + xen_hvm_callback_vector xen_evtchn_do_upcall #endif /* CONFIG_XEN */
drivers/xen/events.c +0 -15
@@ -1414,21 +1414,6 @@ int xen_set_callback_via(uint64_t via) }EXPORT_SYMBOL_GPL (xen_set_callback_via); -void smp_xen_hvm_callback_vector (struct pt_regs *regs) -{ -struct pt_regs *old_regs =set_irq_regs (regs); - -exit_idle (); - -irq_enter (); - -__xen_evtchn_do_upcall (regs); - -irq_exit (); - -set_irq_regs (old_regs); -} -/* Vector callbacks are better than PCI interrupts to receive event * channel notifications because we can receive vector callbacks on any * vcpu and we don't need PCI support or APIC interactions. */
Quoted 4 lines · Stefano Stabellini
Quoted 3 lines · Jeremy Fitzhardinge
Quoted 2 lines · Stefano Stabellini
Quoted 2 lines
smp_xen_hvm_callback_vectoris just missing, so I think it should be usingBUILD_INTERRUPT3with the third arg beingxen_evtchn_do_upcall.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
BUILD_INTERRUPT3is anx86_32only MACRO, that's why I am using apicinterrupt instead.My original problem was that my 32-bit builds were failing because
smp_xen_hvm_callback_vectorwas missing. I wonder if its the collision of two sets of patches.I think you are just missing a patch like this one:
sorry I missed a very import chunk of the patch, appending again:
arch/x86/kernel/entry_32.S +2 -1
@@ -1088,7 +1088,8 @@ ENTRY(xen_failsafe_callback) .previous ENDPROC(xen_failsafe_callback) -BUILD_INTERRUPT(xen_hvm_callback_vector, XEN_HVM_EVTCHN_CALLBACK) +BUILD_INTERRUPT3(xen_hvm_callback_vector, XEN_HVM_EVTCHN_CALLBACK, + xen_evtchn_do_upcall) #endif /* CONFIG_XEN */
arch/x86/kernel/entry_64.S +1 -1
@@ -1365,7 +1365,7 @@ ENTRY(xen_failsafe_callback) END(xen_failsafe_callback) apicinterrupt XEN_HVM_EVTCHN_CALLBACK \ - xen_hvm_callback_vector smp_xen_hvm_callback_vector + xen_hvm_callback_vector xen_evtchn_do_upcall #endif /* CONFIG_XEN */
drivers/xen/events.c +0 -15
@@ -1414,21 +1414,6 @@ int xen_set_callback_via(uint64_t via) }EXPORT_SYMBOL_GPL (xen_set_callback_via); -void smp_xen_hvm_callback_vector (struct pt_regs *regs) -{ -struct pt_regs *old_regs =set_irq_regs (regs); - -exit_idle (); - -irq_enter (); - -__xen_evtchn_do_upcall (regs); - -irq_exit (); - -set_irq_regs (old_regs); -} -/* Vector callbacks are better than PCI interrupts to receive event * channel notifications because we can receive vector callbacks on any * vcpu and we don't need PCI support or APIC interactions. */