From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CFE2921E3EA8B for ; Mon, 4 Sep 2017 04:40:42 -0700 (PDT) Received: by mail-it0-x22e.google.com with SMTP id t134so9037929ita.0 for ; Mon, 04 Sep 2017 04:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to:cc; bh=M0EK3gm7g2EkN6XXrpb2ssk6naQKhjS0U2k3PFYEomQ=; b=ydCSNnYjpm3H5Prs0kN4pPp5rnsN7zg3EtkFLGtMnkw9kre0zPUbLThFEMIMw47WII CzOqyQIPd9L8xz1jCXL3NrctiyUGw2Itr0Q90kcavk7+EDJupgUyA8oNXKMN+PmgDAJk JF4NRYIN+1JTD3dzannAq8XF5Elb6GZJBHJ3QT7qQ2oLD7dMLND3PyVBKGbiVArI9z5J P4h//XOMw9iy9kek3ZShfMpvt9E2fhHR1Ie6Km4Hfb/8/+RTyF+igQbpIUaKxT0fCHrA IVLucKL5lsU+gfRMq/MlKbsCQFeDcMt8VhKBe7gtnJT/PrcotZtPbFYmOxfztG9g4CCE +3Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=M0EK3gm7g2EkN6XXrpb2ssk6naQKhjS0U2k3PFYEomQ=; b=H2TEzkRuPnURoGYeZQE8WH0NPiBCT0fKsWFp52/XbyMDqkUEAmq80Wpd7kYo1X/MbN d8wOULdvfExixmD4Q0riBmZ8uNMnJpwN6SZPiDopIZ78UsOlSdmIUSZ6ZePc8YSJM7ir sPkQD5JrIDmbwzM7ivWWD989PfynonaZZNt82K61SRCd2vS6JlCn9jrTQalWuH0ulGg+ 0E7e4W15Ohf9axS5JCw4a2nnCVNb5F2umTWvCxoMPpLztz5dKf6wZdRs7NmrS6MZSNt3 eTS48ZoRtboSOCuqdICwEZleoXTap9wNSZtpfNWlWD2BzmIoxVk2DCOqRYnOdfUWVAdn uGXQ== X-Gm-Message-State: AHPjjUhMfwVkI2QAGB0M+gzC36ByaypnCBDCkcwX20vfRgLBKM5Uy7SO /oZppzbno+LnPA4g0zd0Ivw6AUlf7Of3vv4MRw== X-Google-Smtp-Source: ADKCNb6eWqSaiCY7I75CL2EMXH4LKtjxo8R4C/zy7GC/uWM42Rq5DTtrg0YaUJ2wW0a9fkOtQmiSpOd89JHg139vsGc= X-Received: by 10.36.139.3 with SMTP id g3mr190667ite.32.1504525409930; Mon, 04 Sep 2017 04:43:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.0.150 with HTTP; Mon, 4 Sep 2017 04:43:29 -0700 (PDT) From: Bartosz Szczepanek Date: Mon, 4 Sep 2017 13:43:29 +0200 Message-ID: To: edk2-devel@lists.01.org Cc: ruiyu.ni@intel.com X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: CPU/PCI addressing in PciIoGetAttributes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 11:40:43 -0000 Content-Type: text/plain; charset="UTF-8" Hi guys, I have some doubt about PciIoGetAttributes behaviour on aarch64 platform with non-uniform CPU:PCI address space mapping. I'll be grateful if you verify my understanding. According to UEFI specification, AddrRangeMin in QWORD Address Space Descriptor returned by PciIoGetAttributes() should be a CPU address, at least that's what I conclude from: > Address Translation Offset. Offset to apply to the Starting address of a > BAR *to convert it to a PCI address*. This value is zero unless the > HostAddress and DeviceAddress for the BAR are different. This mentions "Starting address", which I suppose refers to AddrRangeMin. It needs to be converted to PCI address, so as-is it should be in CPU address space. On the other hand, the AddrRangeMin is assigned BaseAddress value obtained directly from PciBar: > Descriptor->AddrRangeMin = PciIoDevice->PciBar[BarIndex].BaseAddress; PciBar is filled in PciParseBar() using original BAR content (thus BaseAddress is not translated, PCI address). This way value that refers to PCI space is returned from PciIoGetBarAttributes as CPU address. Shouldn't there be translation of it somewhere on the way? Or is my understanding flawed? Either way, please let me know. Best regards, Bartosz