From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgLw8-0008WM-J4 for qemu-devel@nongnu.org; Thu, 09 Apr 2015 19:32:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgLw3-0001Tk-Je for qemu-devel@nongnu.org; Thu, 09 Apr 2015 19:32:40 -0400 Received: from mail-pd0-x232.google.com ([2607:f8b0:400e:c02::232]:36492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgLw3-0001TO-CI for qemu-devel@nongnu.org; Thu, 09 Apr 2015 19:32:35 -0400 Received: by pdea3 with SMTP id a3so2982287pde.3 for ; Thu, 09 Apr 2015 16:32:34 -0700 (PDT) Date: Fri, 10 Apr 2015 09:30:15 +1000 From: "Edgar E. Iglesias" Message-ID: <20150409233015.GA28944@toto> References: <1428582043-19080-1-git-send-email-pbonzini@redhat.com> <5526795F.1020802@redhat.com> <20150409135828.GO30629@toto> <5526901D.4000208@redhat.com> <5526A469.9060502@redhat.com> <5526A87E.3000407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5526A87E.3000407@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 0/3] pflash_cfi01: allow reading/writing it only in secure mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , Peter Crosthwaite , Laszlo Ersek , QEMU Developers , Gerd Hoffmann On Thu, Apr 09, 2015 at 06:27:42PM +0200, Paolo Bonzini wrote: > > > On 09/04/2015 18:10, Laszlo Ersek wrote: > > In OVMF, the reset vector and the SEC phase code run from (read-only) > > flash. SEC decompresses everything else to RAM. Also, SEC does not > > access read-write flash (the varstore) at all. > > > > The above is a specialty of OVMF. In ArmVirtualizationQemu (aka AAVMF), > > two further module types run from flash, after SEC: PEI_CORE, and some > > PEIMs (ie. the PEI phase comes into the picture). During PEI, read-only > > access to the varstore should be supported. > > Read-only access should always be fine (though with a tweak to these > patches, and slower---because it exits to QEMU---if another CPU is > looking at the flash in MMIO mode). The problem is execution. > > But on x86 flash should never be accessed by multiple CPUs at the same > time, unless all of them know that the flash is in ROM mode. > > As I understand it, on ARM secure (EL3) and non-secure (EL<3) modes have > effectively different address spaces. Therefore, one EL3 CPU could put > the flash in MMIO mode for programming, while another EL1 CPU could be > reading from the flash in ROM mode. In QEMU, this could be implemented > with two memory regions and per-CPU address spaces. These patches > should not get in the way, but they would not be useful. Right, that matches my understanding. Thanks, Edgar