On Sun, Mar 24, 2013 at 08:53:33PM +0000, Peter Maydell wrote: > On 24 March 2013 19:17, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Sun, Mar 24, 2013 at 04:58:37PM +0100, Aurelien Jarno wrote: > >> On Sun, Mar 24, 2013 at 11:32:30AM +0000, Peter Maydell wrote: > >> > I've provided a property for enabling the old broken IRQ mapping; > >> > this can be enabled with the command line option: > >> > -global versatile_pci.broken-irq-mapping=1 > >> > > >> > (If anybody wants to suggest a better way of handling this please do.) > >> > >> Do you have a pointer to the corresponding kernel patch? Is it possible > >> to get the kernel to detect if it should use the correct or the broken > >> IRQ mapping? > > > > Alternatively, or additionally, how about detecting the correct or > > the incorrect kernel and updating the mapping? > > For example, maybe we could do this using the > > IRQ value written into the device pci config register? > > Yeah, ideally being able to detect the buggy kernel would be good; > I can't see anything at the controller level that would do though, > and I don't really know enough about PCI to know about generic > PCI stuff that would work. (Why would the OS need to tell the > device anything about its IRQ if it's hardwired?)
Each pci device has a bit of memory where the OS stores the IRQ#. I think it was invented as a simple way to pass data from BIOS to the OS on a PC. There's no special reason to store it on the device but everyone does it. > > If we can't find anything, maybe add our own register > > so the same qemu config can support old and new kernels? > > Then the new kernel wouldn't work on real hardware... > > -- PMM Not if our register is read-only in real hardware. -- MST