All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Question about piix3's PIRQC register set
@ 2018-12-05 15:13 Li Qiang
  2018-12-05 21:18 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Li Qiang @ 2018-12-05 15:13 UTC (permalink / raw)
  To: pbonzini, Alex Williamson; +Cc: qemu-devel

Hello Paolo Alex, and all,

I have a question when reading the ‘vfio_intx_enable’ function.

There calls ‘pci_device_route_intx_to_irq’ to get the ‘irq number’ from 
a device intx info.

It is read from ‘piix3->dev.config[PIIX_PIRQC + pin];’ in ‘piix3_route_intx_pin_to_irq’.

Here my question when the piix3’s PIRQx route control registers is set and by who?
I mean when this ‘‘piix3->dev.config[PIIX_PIRQC + pin];’’ is set?

Once I think this is set by seabios. 
But seems it is not as this function is called in vfio_realize, the guest dones’t begin.

Thanks,
Li Qiang 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Question about piix3's PIRQC register set
  2018-12-05 15:13 [Qemu-devel] Question about piix3's PIRQC register set Li Qiang
@ 2018-12-05 21:18 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2018-12-05 21:18 UTC (permalink / raw)
  To: Li Qiang, Alex Williamson; +Cc: qemu-devel

On 05/12/18 16:13, Li Qiang wrote:
> Here my question when the piix3’s PIRQx route control registers is set
> and by who?
> 
> I mean when this ‘‘piix3->dev.config[PIIX_PIRQC + pin];’’ is set?
>  
> Once I think this is set by seabios.

Hi,

it's set by the operating system via ACPI.  Search for define_link in
SeaBIOS's src/fw/acpi-dsdt.dsl, it refers to fields called PRQ0-PRQ3
which in turn are defined like this:

            /* PIIX PCI to ISA irq remapping */
            OperationRegion(P40C, PCI_Config, 0x60, 0x04)

	...
        Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
            PRQ0,   8,
            PRQ1,   8,
            PRQ2,   8,
            PRQ3,   8
        }

Current QEMU doesn't use anymore the SeaBIOS copy of the DSDT, but the
same thing can be found in build_piix4_isa_bridge and
build_piix4_pci0_int, in hw/i386/acpi-build.c.

> But seems it is not as this function is called in vfio_realize, the
> guest dones’t begin.

vfio also calls it (from vfio_intx_update) every time the routing
registers are updated.  The ISA bridge calls
pci_bus_fire_intx_routing_notifier, and then that function calls
vfio_intx_update, because it was registered with
pci_device_set_intx_routing_notifier.

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-05 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 15:13 [Qemu-devel] Question about piix3's PIRQC register set Li Qiang
2018-12-05 21:18 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.