qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/6] pci: implement power state


From: Gerd Hoffmann
Subject: Re: [PATCH v2 1/6] pci: implement power state
Date: Tue, 16 Nov 2021 08:16:01 +0100

  Hi,

> >          new_addr = pci_bar_address(d, i, r->type, r->size);
> > +        if (!d->has_power) {
> > +            new_addr = PCI_BAR_UNMAPPED;
> > +        }
> >  
> >          /* This bar isn't changed */
> >          if (new_addr == r->addr)
> 
> I am a bit confused about why this is necessary.
> When power is removed device is reset, does not
> this disable device memory automatically?

Hmm.   While it clearly doesn't hurt it might not be needed indeed.  The
reset-on-poweroff should make sure both bars and dma are off, and due to
config space access being blocked the guest shouldn't be able to turn
them on while device power is off.

So, yes, in theory we should be able to drop this.  Assuming nothing in
qemu ever touches the bar mappings (host access to config space is not
blocked).

I'll have a look.

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]