qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 02/11] pci: clean up pci_bar_address()


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 02/11] pci: clean up pci_bar_address()
Date: Mon, 14 Dec 2009 15:36:10 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

On Mon, Dec 14, 2009 at 09:48:17PM +0900, Isaku Yamahata wrote:
> make pci_bar_address independent of PCI_BAR_UNMAPPED value.
> PCI_BAR_UNMAPPED could be arbitrary value which doesn't match
> possible pci bar. So == PCI_BAR_UNMAPPED check is not good.
> This patch cleans it up.
> 
> Signed-off-by: Isaku Yamahata <address@hidden>

I would rather we removed this hack altogether.
I guess proper fix requires Avi's patch to do BAR mapping
from pci.c, and I think we should do just this.

There are no special values in bar
assignment, and guests are free to perform sizing any way they want.
Especially for 64 bit BARs, sizing for high bits is
done separately from low bits.

Also - I think this in fact changes logic.
On 64 bit qemu, we used to compare to 0xffffffff
and now we compare to 0xffffffffffffffff.

> ---
>  hw/pci.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index aed3a24..344d72b 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -857,8 +857,7 @@ static pcibus_t pci_bar_address(PCIDevice *d,
>      /* XXX: as we cannot support really dynamic
>         mappings, we handle specific values as invalid
>         mappings. */
> -    if (last_addr <= new_addr || new_addr == 0 ||
> -        last_addr == PCI_BAR_UNMAPPED) {
> +    if (last_addr <= new_addr || new_addr == 0 || last_addr == ~(pcibus_t)0) 
> {
>          return PCI_BAR_UNMAPPED;
>      }
>  
> -- 
> 1.6.5.4




reply via email to

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