Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> writes:
On 11/18/2015 06:16 AM, Vitaly Kuznetsov wrote:Yes, so the condition will always be false for PV and it equals to
Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> writes:Right. David, can you fix this before committing?
After commit 8c058b0b9c34 ("x86/irq: Probe for PIC presence beforePIC?
allocating descs for legacy IRQs") early_irq_init() will no longer
preallocate descriptors for legacy interrupts if PIT does not
exist.
I don't think so: on PV we end up setting legacy_pic toTherefore we need to allocate those descriptors for PV guestsWouldn't it be better to write it as
ourselves.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Suggested-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
drivers/xen/events/events_base.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 849500e..a2bb333 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -419,8 +419,8 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi)
if (xen_pv_domain() && !xen_initial_domain())
return xen_allocate_irq_dynamic();
- /* Legacy IRQ descriptors are already allocated by the arch. */
- if (gsi < NR_IRQS_LEGACY)
+ /* On HVM legacy IRQ descriptors are already allocated by the arch. */
+ if (xen_hvm_domain() && gsi < NR_IRQS_LEGACY)
irq = gsi;
if (gsi < nr_legacy_irqs()) ?
null_legacy_pic in probe_8259A() and that will make nr_legacy_irqs()
return 0.
xen_hvm_domain() or am I missng something?
I think it's possible to have PIC-less HVM guests in future (btw, what
about HVMlite?). I see nr_legacy_irqs() is x86-only but it can easily be
defined to NR_IRQS_LEGACY on other arches.