From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 05/41] acpi : add helper function for mapping memory Date: Wed, 20 May 2015 18:06:35 +0100 Message-ID: <555CBF1B.1030408@citrix.com> References: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> <1431893048-5214-6-git-send-email-parth.dixit@linaro.org> <555CCC70020000780007C5C7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <555CCC70020000780007C5C7@mail.emea.novell.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: Jan Beulich , Parth Dixit Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, tim@xen.org, xen-devel@lists.xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, christoffer.dall@linaro.org List-Id: xen-devel@lists.xenproject.org On 20/05/15 17:03, Jan Beulich wrote: >>>> On 17.05.15 at 22:03, wrote: >> --- a/xen/drivers/acpi/osl.c >> +++ b/xen/drivers/acpi/osl.c >> @@ -87,16 +87,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) >> void __iomem * >> acpi_os_map_memory(acpi_physical_address phys, acpi_size size) >> { >> - if (system_state >= SYS_STATE_active) { >> - unsigned long pfn = PFN_DOWN(phys); >> - unsigned int offs = phys & (PAGE_SIZE - 1); >> - >> - /* The low first Mb is always mapped. */ >> - if ( !((phys + size - 1) >> 20) ) >> - return __va(phys); >> - return __vmap(&pfn, PFN_UP(offs + size), 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs; >> - } >> - return __acpi_map_table(phys, size); >> + return acpi_os_map_iomem(phys, size); >> } > > I think ioremap() (or maybe ioremap_cache()) should be used here, > and tweaked suitably on x86 if need be. ioremap_cache is most suitable for ARM. ioremap (i.e ioremap_nocache) is mapping the region with device attribute. Any unaligned access will result to a data abort. Regards, -- Julien Grall