From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::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 56EE721E79036 for ; Fri, 18 Aug 2017 11:05:59 -0700 (PDT) Received: by mail-wr0-x22e.google.com with SMTP id y96so70275985wrc.1 for ; Fri, 18 Aug 2017 11:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AAMljRCV2v5SpbwPXSzk8V0xQ/Bx1ODO2RXr59in7yw=; b=G6K7qO/KKhAWAqGScLEScT5kG5DQ7P7Vxoi2o5qhyR55ESlouS+XKQHtVLelUKx7Tk j0KKSLu8K4eMIFU7i/yuzMhlQF5Jstspu39CE08SPB4jYUDA2dYE2hVn7YflBjxl47qS WsL5ExFG3+61l68akR8W7RDKBDfyk7MwZXSfw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AAMljRCV2v5SpbwPXSzk8V0xQ/Bx1ODO2RXr59in7yw=; b=WCsoisXME8jp8flgPXBn0uBGFCgDfhO9Q/lsQvNwixS9yULurggvGzbsttQEJxpn8r O4UMLDbeILV7xfFaYUwsF7zldKCrx4LvH9GSfTJuqErfGW9MVsAozVofWWjYeJLfKwaF Q/VN4mMQHQglvzI5R2LrN4Q3zVVA/3xrlyXXgznvIU6eiwRmVOUxyxLvd9vN4K5tgqVm lhQd4DPKT7hhQiRCdc4DQniD40qlngi46DsF1gyV/9ZSF2hBSvxOHvYjsO6g51tz+txY i5BC8a44NHK7iIFbEHmUtTUvbU2ISVRgfK5VbZyXo8zrnd0jVFv7DJEnknK9XHTdExo7 Rp8Q== X-Gm-Message-State: AHYfb5jw3fbakQ5pQLc29f/Hbjj5eJbxxkl6+L2S92yIg+3jhCa0zj8x vdykdGDwnJeRNhRj X-Received: by 10.223.178.85 with SMTP id y21mr5817859wra.92.1503079706121; Fri, 18 Aug 2017 11:08:26 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id y36sm8246609wrb.53.2017.08.18.11.08.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Aug 2017 11:08:25 -0700 (PDT) Date: Fri, 18 Aug 2017 19:08:23 +0100 From: Leif Lindholm To: Jordan Justen Cc: Ard Biesheuvel , "edk2-devel@lists.01.org" , Laszlo Ersek Message-ID: <20170818180823.b24fsxtcy63zndq2@bivouac.eciton.net> References: <20170818130243.4645-1-ard.biesheuvel@linaro.org> <150307684325.17751.1587324408306927566@jljusten-skl> <150307857518.18247.16857169627688155787@jljusten-skl> MIME-Version: 1.0 In-Reply-To: <150307857518.18247.16857169627688155787@jljusten-skl> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH] OvmfPkg/QemuVideoDxe: map framebuffer as write-combining/non-executable 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: Fri, 18 Aug 2017 18:05:59 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 18, 2017 at 10:49:35AM -0700, Jordan Justen wrote: > On 2017-08-18 10:25:14, Ard Biesheuvel wrote: > > On 18 August 2017 at 18:20, Jordan Justen wrote: > > > On 2017-08-18 06:04:01, Ard Biesheuvel wrote: > > >> On 18 August 2017 at 14:02, Ard Biesheuvel wrote: > > >> > When QemuVideoDxe takes control of the framebuffer, it is already > > >> > mapped EFI_MEMORY_UC by core code, and QemuVideoDxe simply records > > >> > the base and size from the PCI BAR. > > >> > > > >> > On x86 systems, this is sufficient, but on ARM systems, the semantics > > >> > of EFI_MEMORY_UC regions are quite different from EFI_MEMORY_WC regions, > > >> > and treating a region like memory (i.e., dereferencing pointers into it > > >> > or using ordinary CopyMem()/SetMem() functions on it) requires that it > > >> > be mapped with memory semantics, i.e., EFI_MEMORY_WC, EFI_MEMORY_WT or > > >> > EFI_MEMORY_WB. > > >> > > > >> > Since caching is not appropriate for regions where we rely on side > > >> > effects, remap the frame buffer EFI_MEMORY_WT. > > >> > > >> EFI_MEMORY_WC not WT > > > > > > If a single pixel is written, then WC may not write it through > > > immediately. Would WT be more appropriate? > > > > For ARM, that applies equally to WT AFAIK. > > Write-through will not actually write-*through*? Not immediately, no. Conversely, does IA32/X64 WC not guarantee writing out within a finite period? / Leif > I'm not sure how well QEMU/KVM models this for x86 or ARM. > > > >> > > > >> > [Protocols] > > >> > + gEfiCpuArchProtocolGuid # PROTOCOL ALWAYS_CONSUMED > > > > > > I don't think a 'Driver Model' driver needs to add arch protocols into > > > the depex. > > > > > > > To be pedantic: this is not the depex. You can't rely on the protocol > > header to declare gEfiCpuArchProtocolGuid, and declaring it here makes > > the build tools add its declaration to AutoGen.h (I think this has to > > do with the exact .dsc version. Perhaps Laszlo has a better > > recollection of the details.) > > Whoops. You are correct. We want this change... > > -Jordan