* [Qemu-devel] pci: is reset incomplete?
@ 2009-09-14 15:48 Michael S. Tsirkin
2009-09-14 17:15 ` [Qemu-devel] " Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-14 15:48 UTC (permalink / raw)
To: Paul Brook
Cc: Carsten Otte, kvm, Rusty Russell, qemu-devel, virtualization,
Christian Borntraeger, Avi Kivity
Hi!
pci bus reset does not seem to clear pci config registers, such as BAR
registers, or memory space enable, of the attached devices: it only
clears the interrupt state.
This seems wrong, but easy to fix.
Comments?
--
MST
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: pci: is reset incomplete?
2009-09-14 15:48 [Qemu-devel] pci: is reset incomplete? Michael S. Tsirkin
@ 2009-09-14 17:15 ` Anthony Liguori
2009-09-14 17:36 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2009-09-14 17:15 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Carsten Otte, Gerd Hoffmann, kvm, Rusty Russell, qemu-devel,
virtualization, Christian Borntraeger, Paul Brook, Avi Kivity
Michael S. Tsirkin wrote:
> Hi!
> pci bus reset does not seem to clear pci config registers, such as BAR
> registers, or memory space enable, of the attached devices: it only
> clears the interrupt state.
>
> This seems wrong, but easy to fix.
>
I don't think most pci devices reset their config space in their reset
callbacks.
I would think that making most of the config space (if not the entire)
qdev properties would make sense. You can then get reset for free and
it's possible for users to tweak things like class codes universally.
Regards,
Anthony Liguori
> Comments?
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: pci: is reset incomplete?
2009-09-14 17:15 ` [Qemu-devel] " Anthony Liguori
@ 2009-09-14 17:36 ` Michael S. Tsirkin
2009-09-14 22:54 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-14 17:36 UTC (permalink / raw)
To: Anthony Liguori
Cc: Carsten Otte, Gerd Hoffmann, kvm, Rusty Russell, qemu-devel,
virtualization, Christian Borntraeger, Paul Brook, Avi Kivity
On Mon, Sep 14, 2009 at 12:15:29PM -0500, Anthony Liguori wrote:
> Michael S. Tsirkin wrote:
>> Hi!
>> pci bus reset does not seem to clear pci config registers, such as BAR
>> registers, or memory space enable, of the attached devices: it only
>> clears the interrupt state.
>>
>> This seems wrong, but easy to fix.
>>
>
> I don't think most pci devices reset their config space in their reset
> callbacks.
For things like BAR registers, they really must.
The PCI spec is quite specific on this point.
> I would think that making most of the config space (if not the entire)
> qdev properties would make sense. You can then get reset for free and
> it's possible for users to tweak things like class codes universally.
class codes are read only registers. Your proposal might be correct for
some of these. But PCI registers that are reset, change as a result of
guest activity, and reset values are typically specified by guest spec.
So I don't think we should let users tweak these.
> Regards,
>
> Anthony Liguori
>
>> Comments?
>>
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: pci: is reset incomplete?
2009-09-14 17:36 ` Michael S. Tsirkin
@ 2009-09-14 22:54 ` Anthony Liguori
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2009-09-14 22:54 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Carsten Otte, Gerd Hoffmann, kvm, Rusty Russell, qemu-devel,
virtualization, Christian Borntraeger, Paul Brook, Avi Kivity
Michael S. Tsirkin wrote:
> On Mon, Sep 14, 2009 at 12:15:29PM -0500, Anthony Liguori wrote:
>
>> Michael S. Tsirkin wrote:
>>
>>> Hi!
>>> pci bus reset does not seem to clear pci config registers, such as BAR
>>> registers, or memory space enable, of the attached devices: it only
>>> clears the interrupt state.
>>>
>>> This seems wrong, but easy to fix.
>>>
>>>
>> I don't think most pci devices reset their config space in their reset
>> callbacks.
>>
>
> For things like BAR registers, they really must.
>
BARs should be registered via pci_register_bar so you should be able to
centralize their reset.
> class codes are read only registers. Your proposal might be correct for
> some of these. But PCI registers that are reset, change as a result of
> guest activity, and reset values are typically specified by guest spec.
> So I don't think we should let users tweak these.
>
Well, I guess my general point was that it would be good to add more
structure to how config space is initialized. I think a natural
consequence of that is that it becomes easier to automatically fix the
values on reset.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-14 22:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14 15:48 [Qemu-devel] pci: is reset incomplete? Michael S. Tsirkin
2009-09-14 17:15 ` [Qemu-devel] " Anthony Liguori
2009-09-14 17:36 ` Michael S. Tsirkin
2009-09-14 22:54 ` Anthony Liguori
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).