On 12 September 2017 at 06:01, Ni, Ruiyu <[email protected]> wrote: > Laszlo, > Your understanding is: DeviceAddress = HostAddress + AddressTranslationOffset > But my patch assumes: HostAddress = DeviceAddress + AddressTranslationOffset > > They are totally different. If I follow your understanding, the patch is > wrong! > Since UEFI spec doesn't describe "apply to" in sentence " Offset to apply to > the > Starting address of a BAR to convert it to a PCI address" very clearly, I > quoted > the statement from ACPI spec. > Your understanding to "apply to" is "add", my understanding is "minus". >
Even though we are stretching the ACPI definition of a QWord descriptor beyond its original meaning, I don't think there is a lot of ambiguity here, to be honest. The AddrRangeMin field contains the address on the secondary side of a bridge, and the primary value can be obtained by 'applying' the ATO. In my opinion, applying a (positive or negative) offset implies addition, not subtraction, as subtraction involves negating the second addend before applying it. And the secondary side of the host bridge is clearly the PCI side. It does mean the offset field is signed, though. So I don't agree with the conclusion that no clarification is required. We need to make sure the spec is crystal clear in this regard. But I do agree with the change, I think it is the only solution that makes sense. _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

