On 02/23/18 09:53, Heyi Guo wrote:
> According to UEFI spec 2.7, PciIo->GetBarAttributes should return host
> address (CPU view ddress) rather than device address (PCI view
> address), and
> device address = host address + address translation offset,
> so we subtract translation from device address before returning.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Heyi Guo <[email protected]>
> Cc: Ruiyu Ni <[email protected]>
> Cc: Ard Biesheuvel <[email protected]>
> Cc: Star Zeng <[email protected]>
> Cc: Eric Dong <[email protected]>
> Cc: Laszlo Ersek <[email protected]>
> Cc: Michael D Kinney <[email protected]>
> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c 
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
> index fef3ece..62179eb 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
> @@ -1972,6 +1972,10 @@ PciIoGetBarAttributes (
>          return EFI_UNSUPPORTED;
>        }
>      }
> +
> +    // According to UEFI spec 2.7, we need return host address for
> +    // PciIo->GetBarAttributes, and host address = device address - 
> translation.
> +    Descriptor->AddrRangeMin -= Descriptor->AddrTranslationOffset;
>    }
>  
>    return EFI_SUCCESS;
> 

Patches #2 and #3 look OK to me, but I feel I don't know enough to give
an R-b with a good conscience.

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to