From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v5 04/10] xen/arm: Store p2m type in each page of the guest Date: Mon, 16 Dec 2013 22:54:40 +0000 Message-ID: <52AF84B0.5080807@linaro.org> References: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> <1387215452-10951-5-git-send-email-julien.grall@linaro.org> <1387216172.21086.57.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vsh3k-0001ka-BV for xen-devel@lists.xenproject.org; Mon, 16 Dec 2013 22:54:44 +0000 Received: by mail-we0-f178.google.com with SMTP id u57so5284143wes.37 for ; Mon, 16 Dec 2013 14:54:42 -0800 (PST) In-Reply-To: <1387216172.21086.57.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On 12/16/2013 05:49 PM, Ian Campbell wrote: > On Mon, 2013-12-16 at 17:37 +0000, Julien Grall wrote: >> Use the field 'avail' to store the type of the page. Rename it to 'type' for >> convenience. >> The information stored in this field will be retrieved in a future patch to >> change the behaviour when the page is removed. >> >> Also introduce guest_physmap_add_entry to map and set a specific p2m type for >> a page. >> >> Signed-off-by: Julien Grall >> >> --- >> Changes in v5: >> - Foreign mapping doesn't need to have execution right > > Neither does MMIO for that matter... > >> >> + switch (t) >> + { >> + case p2m_map_foreign: >> + case p2m_grant_map_rw: >> + e.p2m.xn = 1; >> + /* Fallthrough */ >> + case p2m_ram_rw: >> + case p2m_mmio_direct: > > ... so move this up. Right. > >> + e.p2m.write = 1; >> + break; >> + >> + case p2m_grant_map_ro: >> + e.p2m.xn = 1; >> + /* Fallthrough */ >> + case p2m_invalid: >> + case p2m_ram_ro: >> + default: > > You were going to remove the default case IIRC to let the compiler catch > new type additions. Sorry, I completely forgot. I will do it for the next version. -- Julien Grall