qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Why my interrupt is not connected? qemu_irq_is_connected( ) returns


From: Chan Kim
Subject: RE: Why my interrupt is not connected? qemu_irq_is_connected( ) returns false.
Date: Fri, 1 Apr 2022 22:18:57 +0900

Hi, Peter Maydell
Thank you for the kind reply.

> ...and connect its IRQ here, so of course the check in the device realize
> method says "not connected". That isn't telling you anything useful.
> 
So I added some prints. This is the result.
 
create_uart called!
pl011_init called!
pl011_realize called!
pl011 irq not connected!
now calling sysbus_connect_irq for pl011..
now passed sysbus_connect_irq for pl011..
pl011 irq connected!
create_ab21q_axpu_device called!
ab21q_axpu_init called!
ab21q_axpu_realize called!
axpu irq not connected!
now calling sysbus_connect_irq for ab21q_axpu..
now passed sysbus_connect_irq for ab21q_axpu..
ab21q_axpu irq connected!

So irq connection-wise speaking, pl011 and ab21q_axpu is the same!
(for pl011, the irq was not connected either before the sysbus_connect_irq, 
But I used qemu_irq_is_connected(s->irq)) by mistake and it gave me true.
I fixed it to qemu_irq_is_connected(s->irq[0])) because it had 6 irq outputs.
And of course I used qemu_irq_is_connected(AB21Q_AXPU(dev)->irq) or 
qemu_irq_is_connected(PL011(dev)->irq[0])
To check the irq connection inside the xxx_create functions.)

So I'm relieved now at least the basic connection seems to have no problem.

> To debug this kind of problem, you need to narrow it down.
> Is the guest code doing any writes to the device registers?
> If not, maybe the ACPI table stuff is wrong and it doesn't realize there's
> a device there at all. If it does try to program the device, then the ACPI
> table/probing stuff is probably OK.

Strange, even before this interrupt test, I was able to write or read the 
device registers.
I added ab21q_axpu device information in the ACPI table entry today. But I'm 
100% sure the content is right.

> Is the device code trying to raise its interrupt at all?
> If not, then either the guest driver isn't programming it right or else
> your device model has a bug that means it's not doing the right thing when
> the guest is programming it.
> If the device does try to raise its interrupt, then either you've wired
> the interrupt wrongly or else perhaps the guest never unmasked the
> interrupt in the GIC. You can singlestep into the qemu_raise_irq()
> function to see where it takes you.
> 
> Look for tests you can do that cut the space where the problem might be
> into two pieces and tell you which side of the cut you should be looking.
> 
> -- PMM

Yes, I had made qemu code raise the interrupt by triggering some register but 
the linux program panicked at some point,
So I thought there was something wrong with the interrupt. But now seems to be 
the time for investigation in the S/W and qemu signal path.

Thanks for the helps many times. 
Best regards,

Chan Kim







reply via email to

[Prev in Thread] Current Thread [Next in Thread]