From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 298181A1E68 for ; Sun, 28 Aug 2016 03:40:58 -0700 (PDT) Received: by mail-it0-x234.google.com with SMTP id g62so59240861ith.1 for ; Sun, 28 Aug 2016 03:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YqsT2F3WVa2yapIed/6XM1Ywg7ROHFXupwYDzZwLJQw=; b=BGQieWONj0iH+xCPFuCTDixSaeoHzhXnhj15v05+YoPtBP/jtfb5nrJAfXE8FhtT4Y JLXPPHz1Sj+Eyqu/gcH9h/ngf2I9oMDMz04t7n4xdnjiwfHDbs0l4GYpOPj6sIANBywc oqDA1WbZWAqTEDJjKG3RuxEj6qJFd8GGO7s5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YqsT2F3WVa2yapIed/6XM1Ywg7ROHFXupwYDzZwLJQw=; b=Fz/3lNLtwT46GILMUAwyvwv9dY/QxgWMFhUyJOkW7l1twzMQh07C0Y7J+yb6xQpsGW qz1j11KmNqhzIeP/smDHFp9WNfCzSytKf6PZbgpPRu2eIh84AgE39JfFUPKtm2Im4XYq 5Sv9Jp52xEy+QfY4dTqti4d1+uAESMs9vxXoXZH1HpVacSSbo1YiNMl2Cos+g8GwMOOP 66MYzQanPnlYmsPb6kIAa/WXhbuhNdYRWo30kpBenZQ+4X+6cMG3k5KkkWuZpEh4LTvC lKICsmMXFpsWBQN9+8dpVbdsicD1xPeiWJXS7Rir+yl9uH5n2rLmrN+2rpXdl24PcIEV OWmQ== X-Gm-Message-State: AE9vXwNtNxcc2Lh3QjXgrCn6yHcaee5SSCYX4RFPCFcIz7sAKljkPJOs6eLHvb16Ophkp+7jyYH4OVaDffcAsbH3 X-Received: by 10.36.214.193 with SMTP id o184mr8365967itg.5.1472380857311; Sun, 28 Aug 2016 03:40:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Sun, 28 Aug 2016 03:40:56 -0700 (PDT) In-Reply-To: References: From: Ard Biesheuvel Date: Sun, 28 Aug 2016 11:40:56 +0100 Message-ID: To: edk2-devel-01 , "afish@apple.com" , "Kinney, Michael D" , "Gao, Liming" Cc: Leif Lindholm , Alan Ott , Daniil Egranov Subject: Re: use of EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 10:40:58 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Please ignore -- as Alan pointed out off list, I had EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL and EFI_PCI_IO_PROTOCOL mixed up. On 27 August 2016 at 17:37, Ard Biesheuvel wrot= e: > The UEFI spec describes the EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE > attribute as follows: > > """ > EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE=EF=80=A0 > This bit may only be used in the Attributes parameter to > AllocateBuffer(). If this bit is set, then the PCI controller > that is requesting a buffer through AllocateBuffer() is > capable of producing PCI Dual Address Cycles, so it is able to > access a 64-bit address space. If this bit is not set, then the PCI > controller that is requesting a buffer through > AllocateBuffer() is not capable of producing PCI Dual > Address Cycles, so it is only able to access a 32-bit address space. > """ > > However, both the UEFI driver writer's guide, and the de facto use in > Tianocore violate this, i.e., it use the pattern > > """ > // > // Enable Command register and Dual Address Cycle > // > Status =3D PciIo->Attributes ( > PciIo, > EfiPciIoAttributeOperationEnable, > (PciSupports & EFI_PCI_DEVICE_ENABLE) | > EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, > NULL > ); > """ > > to enable it in the PCI I/O layer, and the Map/Unmap implementations > will switch to 64-bit flavors of the map operation, by the likes of > > """ > if ((PciIoDevice->Attributes & > EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) !=3D 0) { > Operation =3D (EFI_PCI_IO_PROTOCOL_OPERATION) (Operation + > EfiPciOperationBusMasterRead64); > } > """ > > So what should we be doing in new code that needs to support 64-bit DMA? > > -- > Ard.