Am 20.11.2023 um 14:47 hat BALATON Zoltan geschrieben:
> On Mon, 20 Nov 2023, Kevin Wolf wrote:
> > Am 20.11.2023 um 14:09 hat BALATON Zoltan geschrieben:
> > > On Mon, 20 Nov 2023, Mark Cave-Ayland wrote:
> > > > The only difference I can think of regarding the BAR zeroing is that the
> > > > BMDMA BAR is zeroed here. Does the following diff fix things?
> > > 
> > > This helps, with this the latest driver does not crash but still reads 
> > > BAR4
> > > as 0 instead of 0xcc00 so UDMA won't work but at least it boots.
> > 
> > And disabling only the first four BARs is actually what the spec says,
> > too. So I'll make this change to the queued patches.
> > 
> > If I understand correctly, UDMA didn't work before this series either,
> > so it's a separate goal and doing it in its own patch is best anyway.
> 
> UDMA works with my original series, did not work with earlier versions of
> this alternative from Mark but could be fixed up on top unless Mark can send
> a v4 now.
> 
> > As we don't seem to have a good place to set a default, maybe just
> > overriding it in via_ide_cfg_read(), too, and making it return 0xcc01 in
> > compatibility mode is enough?
> 
> I could give that a try and see if that helps but all this
> via_ide_cfg_read() seems like an unnecessary complication to me. Why can't
> we just set the BARs (o for BAR1-3 and default for BAR4) then we don't need
> to override config read?

I would be fine with setting 0xcc00 as the default value for BAR 4, but
as you said yourself, we can't do that in reset because it will be
overwritten by the PCI core code. Where else could we meaningfully do
that? As far as I understand, we don't have any hint that the
native/compatibility mode switch resets it on real hardware, so I'm
hesitant to do it there (and if the guest OS doesn't even switch, it
would never get set).

As for BAR 0-3, didn't we conclude that the via device still accepts I/O
to the configured addresses even though they read as zeros? Having
inconsistent config space and PCIIORegion seems like a bad idea, the
next call to pci_update_mappings() would break it.

Kevin


Reply via email to