From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (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 ADFB721E95E0F for ; Wed, 30 Aug 2017 03:51:24 -0700 (PDT) Received: by mail-io0-x231.google.com with SMTP id s101so3932809ioe.0 for ; Wed, 30 Aug 2017 03:54:06 -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; bh=lHD8WxthUT3eP+EnvvzdbT5AExRRMoSSxQ0VEJZI+Nc=; b=TrcI2mdwheDYhch1HuBO3PJuLK5YfEUNGtBtLQrjhSpy0/V3zJ+vCiaWuduCgH0Ay+ 2FX0Yl0YDaK1vbbHMkLHzCvUmzgIXKFmtTmmcmIye++z/eyunQMGynMIWl2vrdv6OuX/ BfoJsAwXZW3xu5VlLWwH1UYw44/u8hOJwekLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lHD8WxthUT3eP+EnvvzdbT5AExRRMoSSxQ0VEJZI+Nc=; b=tlhUNhELOv/xNUpf5aYFzGmAdvJdzprUtYQv17G3ehJMPChYwDZiuBk1mihlkifsUU zN7949uBU0tqfY39/BA0OAPntOKG3A1S+KUlmrtipYDeg1GnA91ncPRwJKgtCu1NSLt4 o+q2fBfuUlYZnre72KrzNZ5KYzjdjGfF4yW6EUYVpT95dvvfXx8/NEHmn+gFLn8XlU4Q BtxIXe+MbgofY5/KHODgLRmVQYx7rQ0EUM9SgXN4rzsU8+0nFu3kR4A5MpXkPra6q/rI EzYPwh5/QFjaK/TwrkJl/zvsokrDG0SjzuIoNnWVzUyNmhku9Mx5FNZEPrA1IytVlhW0 2Fkw== X-Gm-Message-State: AHPjjUj+DTFCdblNvbCuNuJ5eR3R+fMBfaoVu7R3T/pA3aoFm/b3ZTsb A8rTrrC/mfxGandBJPGqjD01GCJDPSIq X-Received: by 10.107.131.153 with SMTP id n25mr1022111ioi.263.1504090445706; Wed, 30 Aug 2017 03:54:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.162.1 with HTTP; Wed, 30 Aug 2017 03:54:05 -0700 (PDT) In-Reply-To: <20170830105140.5gglqu3ftedfbu2y@bivouac.eciton.net> References: <20170830082108.7470-1-ard.biesheuvel@linaro.org> <20170830082108.7470-3-ard.biesheuvel@linaro.org> <20170830105140.5gglqu3ftedfbu2y@bivouac.eciton.net> From: Ard Biesheuvel Date: Wed, 30 Aug 2017 11:54:05 +0100 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" Subject: Re: [PATCH 2/6] EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translation 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: Wed, 30 Aug 2017 10:51:25 -0000 Content-Type: text/plain; charset="UTF-8" On 30 August 2017 at 11:51, Leif Lindholm wrote: > On Wed, Aug 30, 2017 at 09:21:04AM +0100, Ard Biesheuvel wrote: >> Bring CoherentDmaLib in line with ArmDmaLib, and add support for >> defining a static offset between the host's and the bus master's >> view of memory. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ard Biesheuvel >> --- >> EmbeddedPkg/EmbeddedPkg.dec | 7 +++++++ >> EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c | 10 +++++++++- >> EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf | 3 +++ >> 3 files changed, 19 insertions(+), 1 deletion(-) >> >> diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec >> index 8ad2a84c045c..ccdf38e36a8c 100644 >> --- a/EmbeddedPkg/EmbeddedPkg.dec >> +++ b/EmbeddedPkg/EmbeddedPkg.dec >> @@ -208,3 +208,10 @@ [PcdsFixedAtBuild.X64] >> >> [PcdsFixedAtBuild.common, PcdsDynamic.common] >> gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L""|VOID*|0x00000055 >> + >> + # >> + # Value to add to a host address to obtain a device address, using >> + # unsigned 64-bit integer arithmetic. This means we can rely on >> + # truncation on overflow to specify negative offsets. > > Is that promotion-safe on 32-bit archs? > Yes. EFI_PHYSICAL_ADDRESS is always 64-bits, and so is this PCD, so whether it is a 32-bit platform or not should not make any difference.