qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] QEMU pci mach-virt: setting PCI_INTERRUPT_LINE?
@ 2015-02-24 14:34 Claudio Fontana
  2015-02-25 12:07 ` Claudio Fontana
  0 siblings, 1 reply; 4+ messages in thread
From: Claudio Fontana @ 2015-02-24 14:34 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel@nongnu.org, Alexander Graf

Hello,

I am trying to set the pci interrupt line field in the configuration space
(offset 0x3c), since it is initialized as zero.

I would like to set it to the right value as read from the device tree,
in order for other existing software which relies on it to be able to work unmodified..

but it does not seem to work (I seem to read back zero even after setting the PCI_INTERRUPT_LINE field).

I am also reading the interrupt pin, but that one instead seems to work out of the box..

Thank you for any suggestion,

Claudio

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

* Re: [Qemu-devel] QEMU pci mach-virt: setting PCI_INTERRUPT_LINE?
  2015-02-24 14:34 [Qemu-devel] QEMU pci mach-virt: setting PCI_INTERRUPT_LINE? Claudio Fontana
@ 2015-02-25 12:07 ` Claudio Fontana
  2015-02-25 12:08   ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Claudio Fontana @ 2015-02-25 12:07 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel@nongnu.org, Alexander Graf



On 24.02.2015 15:34, Claudio Fontana wrote:
> Hello,
> 
> I am trying to set the pci interrupt line field in the configuration space
> (offset 0x3c), since it is initialized as zero.
> 
> I would like to set it to the right value as read from the device tree,
> in order for other existing software which relies on it to be able to work unmodified..
> 
> but it does not seem to work (I seem to read back zero even after setting the PCI_INTERRUPT_LINE field).
> 
> I am also reading the interrupt pin, but that one instead seems to work out of the box..
> 
> Thank you for any suggestion,
> 
> Claudio

By the way, I am currently just avoiding to rely on PCI_INTERRUPT_LINE for AArch64,
but shouldn't the register be programmable?

Ciao,

Claudio

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

* Re: [Qemu-devel] QEMU pci mach-virt: setting PCI_INTERRUPT_LINE?
  2015-02-25 12:07 ` Claudio Fontana
@ 2015-02-25 12:08   ` Alexander Graf
  2015-02-25 12:16     ` Claudio Fontana
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2015-02-25 12:08 UTC (permalink / raw)
  To: Claudio Fontana, Peter Maydell; +Cc: qemu-devel@nongnu.org



On 25.02.15 13:07, Claudio Fontana wrote:
> 
> 
> On 24.02.2015 15:34, Claudio Fontana wrote:
>> Hello,
>>
>> I am trying to set the pci interrupt line field in the configuration space
>> (offset 0x3c), since it is initialized as zero.
>>
>> I would like to set it to the right value as read from the device tree,
>> in order for other existing software which relies on it to be able to work unmodified..
>>
>> but it does not seem to work (I seem to read back zero even after setting the PCI_INTERRUPT_LINE field).
>>
>> I am also reading the interrupt pin, but that one instead seems to work out of the box..
>>
>> Thank you for any suggestion,
>>
>> Claudio
> 
> By the way, I am currently just avoiding to rely on PCI_INTERRUPT_LINE for AArch64,
> but shouldn't the register be programmable?

As far as I understand the register should really just be a scratch r/w
register, yeah. Are you sure you're writing in byte granularity?


Alex

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

* Re: [Qemu-devel] QEMU pci mach-virt: setting PCI_INTERRUPT_LINE?
  2015-02-25 12:08   ` Alexander Graf
@ 2015-02-25 12:16     ` Claudio Fontana
  0 siblings, 0 replies; 4+ messages in thread
From: Claudio Fontana @ 2015-02-25 12:16 UTC (permalink / raw)
  To: Alexander Graf, Peter Maydell; +Cc: qemu-devel@nongnu.org

On 25.02.2015 13:08, Alexander Graf wrote:
> 
> 
> On 25.02.15 13:07, Claudio Fontana wrote:
>>
>>
>> On 24.02.2015 15:34, Claudio Fontana wrote:
>>> Hello,
>>>
>>> I am trying to set the pci interrupt line field in the configuration space
>>> (offset 0x3c), since it is initialized as zero.
>>>
>>> I would like to set it to the right value as read from the device tree,
>>> in order for other existing software which relies on it to be able to work unmodified..
>>>
>>> but it does not seem to work (I seem to read back zero even after setting the PCI_INTERRUPT_LINE field).
>>>
>>> I am also reading the interrupt pin, but that one instead seems to work out of the box..
>>>
>>> Thank you for any suggestion,
>>>
>>> Claudio
>>
>> By the way, I am currently just avoiding to rely on PCI_INTERRUPT_LINE for AArch64,
>> but shouldn't the register be programmable?
> 
> As far as I understand the register should really just be a scratch r/w
> register, yeah. Are you sure you're writing in byte granularity?
> 
> 
> Alex

Relatively sure, yeah.. I'll check again, but at least for x86_64 the get function works.
It's OSv's pci-function.cc

u8 function::get_interrupt_line()
{
    return pci_readb(PCI_CFG_INTERRUPT_LINE);
}

void function::set_interrupt_line(u8 irq)
{
    pci_writeb(PCI_CFG_INTERRUPT_LINE, irq);
}

I'll try to debug with PCI_DEBUG and such things, see if I find out something...

Ciao,

Claudio





-- 
Claudio Fontana
Server Virtualization Architect
Huawei Technologies Duesseldorf GmbH
Riesstraße 25 - 80992 München

office: +49 89 158834 4135
mobile: +49 15253060158

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

end of thread, other threads:[~2015-02-25 12:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 14:34 [Qemu-devel] QEMU pci mach-virt: setting PCI_INTERRUPT_LINE? Claudio Fontana
2015-02-25 12:07 ` Claudio Fontana
2015-02-25 12:08   ` Alexander Graf
2015-02-25 12:16     ` Claudio Fontana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).