qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 5/8] Fix incorrect initialization of PCI BARs.


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 5/8] Fix incorrect initialization of PCI BARs.
Date: Thu, 3 Jun 2021 11:24:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Hi Jason,

On 6/3/21 5:53 AM, Jason Thorpe wrote:
> Only program a BAR as a 64-bit MEM BAR if it really is a 64-bit MEM BAR.
> Fixes an issue with the CMD646 IDE controller under NetBSD.

OK for this fix,

> 
> Improve some debug/info messages.

but I'm not sure why you changed the format.
Better split in 2 patches.

> 
> Signed-off-by: Jason Thorpe <thorpej@me.com>
> ---
>  pci.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/pci.c b/pci.c
> index ba05adb..5e9c906 100644
> --- a/pci.c
> +++ b/pci.c
> @@ -84,7 +84,7 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t 
> *p_mem_base)
>    device_id = pci_config_readw(bdf, PCI_DEVICE_ID);
>    class_id = pci_config_readw(bdf, PCI_CLASS_DEVICE);
>  
> -  printf("PCI: %02x:%02x:%x class %04x id %04x:%04x\r\n",
> +  printf("PCI: %d:%d:%d class %04x id %04x:%04x\r\n",
>        PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf),
>           class_id, vendor_id, device_id);
>  
> @@ -118,9 +118,10 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t 
> *p_mem_base)
>         *p_base = addr + size;
>         pci_config_writel(bdf, ofs, addr);
>  
> -       printf("PCI:   region %d: %08x\r\n", region, addr);
> +       printf("PCI:   region %d (BAR %02x): %08x\r\n", region, ofs, addr);
>  
> -       if ((val & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
> +       if ((old & PCI_BASE_ADDRESS_SPACE_IO) == 0 &&
> +           (old & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
>             == PCI_BASE_ADDRESS_MEM_TYPE_64)
>           {
>             pci_config_writel(bdf, ofs + 4, 0);
> 




reply via email to

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