From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH V2 23/33] xen/arm: Allow Xen to run on multiple platform without recompilation Date: Wed, 08 May 2013 17:32:52 +0100 Message-ID: <518A7E34.4000309@linaro.org> References: <1368027124.17285.34.camel@zakaz.uk.xensource.com> <1368027306.17285.36.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1368027306.17285.36.camel@zakaz.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: "patches@linaro.org" , "xen-devel@lists.xen.org" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 05/08/2013 04:35 PM, Ian Campbell wrote: > On Wed, 2013-05-08 at 16:32 +0100, Ian Campbell wrote: >>> +/* Helper to read/write a register */ >>> +static inline uint32_t platform_read_register(uint32_t addr) >>> +{ >>> + volatile const uint32_t *reg; >>> + uint32_t value; >>> + >>> + set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED); >>> + reg = (uint32_t *)(FIXMAP_ADDR(FIXMAP_MISC) + (addr & ~PAGE_MASK)); >>> + value = *reg; >>> + dsb(); isb(); >>> + clear_fixmap(FIXMAP_MISC); >> >> I don't think the fixmap is per-PCPU so you probably want some locking >> here. >> >> FIXMAP_MISC is a bit of an awful thing, but this isn't especially new, >> so OK. > > In fact now I'm wondering if the platform specific code shouldn't > establish its own permanent mapping with ioremap and use that. I will rework this patch with ioremap -- Julien