From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 407FC81EE3 for ; Tue, 15 Nov 2016 05:07:33 -0800 (PST) Received: by mail-it0-x229.google.com with SMTP id c20so147857149itb.0 for ; Tue, 15 Nov 2016 05:07:38 -0800 (PST) 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=CtGSPY4Gl3JV312i7drUen9Pp4kNZG4LFRUPgUELDjc=; b=S6rOdhZ/iAgdJzMxKcekjAnr3b6oQzeO7z2vkcIRSkXQErAI0IpWJrOMd9t0EacNCp WFWAtKPzaYiqa9v17AVeJ0bhH7v4OfieUVOhjbtX+69E2r0l4jV4n7ioK3ufNjL77pfb s+yPv4LFudmdOZRSLKneHbT0RSDIAC5NZyqok= 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; bh=CtGSPY4Gl3JV312i7drUen9Pp4kNZG4LFRUPgUELDjc=; b=eqSEl13ygRJe9h3FK/TfuKyinyAKvVVtQmMpWJpcdw73cb4N5SG+JwOX2TvvMgLQ7c G1YgUiD6hvymjYsAP5xxWqw4T6zhdfC7mpSBbERpwZF1JxWZWSAYmuUnSSWjU1o4JNC0 0qxciCu0FJiIjQm+P9w3HNiuiqQlQC0X+UwlpVlV9iOz+FiNvGiCnM7A/oF1MhMFJlUh Jm3tBa28V40pI5asCduZQdvw+sxbO0pM+PT0HdqX1f53BHjDWgYxtbsiwh+KVjbSttvD BRFgQW5rE/4E3Qzyox/xst/rlfJckWu+tYuhvczf5KOVoQwr1SXlIJ7B6uyxuh5rPiQc ECrg== X-Gm-Message-State: ABUngveAX5MumqsoUNq3zpMuCXLQ4irneu6Een+RkyzygLrOukDdoMJV49a50jw6gUymz2T4bqDg9EWgId2Oatvq X-Received: by 10.107.25.11 with SMTP id 11mr29296850ioz.138.1479215257509; Tue, 15 Nov 2016 05:07:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.147 with HTTP; Tue, 15 Nov 2016 05:07:37 -0800 (PST) In-Reply-To: References: <1478955748-14819-1-git-send-email-ard.biesheuvel@linaro.org> <1478955748-14819-4-git-send-email-ard.biesheuvel@linaro.org> <20161114151614.GR27644@bivouac.eciton.net> From: Ard Biesheuvel Date: Tue, 15 Nov 2016 13:07:37 +0000 Message-ID: To: Ryan Harkin Cc: Leif Lindholm , Jeremy Linton , edk2-devel-01 Subject: Re: [PATCH v2 3/4] ArmPkg/ArmDmaLib: clean up abuse of device address 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: Tue, 15 Nov 2016 13:07:33 -0000 Content-Type: text/plain; charset=UTF-8 On 15 November 2016 at 11:34, Ryan Harkin wrote: > On 15 November 2016 at 09:19, Ard Biesheuvel wrote: >> On 14 November 2016 at 16:16, Leif Lindholm wrote: >>> On Sat, Nov 12, 2016 at 02:02:27PM +0100, Ard Biesheuvel wrote: >>>> In preparation of adding support to ArmDmalib for DMA bus masters whose >>>> view of memory is offset by a constant compared to the CPU's view, clean >>>> up some abuse of the device address. >>>> >>>> The device address is not defined in terms of the CPU's address space, >>>> and so it should not be used in CopyMem () or cache maintenance operations >>>> that require a valid mapping. This not only applies to the above use case, >>>> but also to the DebugUncachedMemoryAllocationLib that unmaps the >>>> primary, cached mapping of an allocation, and returns a host address >>>> which is an uncached alias offset by a constant. >>>> >>>> Since we should never access the device address from the CPU, there is >>>> no need to record it in the MAPINFO struct. Instead, record the buffer >>>> address in case of double buffering, since we do need to copy the contents >>>> (in case of a bus master write) and free the buffer (in all cases) when >>>> DmaUnmap() is called. >>>> >>>> Contributed-under: TianoCore Contribution Agreement 1.0 >>>> Signed-off-by: Ard Biesheuvel >>> >>> For the fix itself: >>> Reviewed-by: Leif Lindholm >>> >>> However, can we wait for a few Tested-by:s to ensure this fix does not >>> reveal any companion bugs? >>> >> >> Perhaps, yes. >> >> In case anyone is up to doing that, please find the branch here >> https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/log/?h=armdmalib-offset >> > > I tested your branch on the usual victims (R0/1/2, FVP Foundation & > AEMv8 and TC2) and they all work fine for me. > > Tested-by: Ryan Harkin > Thanks!