From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753897AbbERLL4 (ORCPT ); Mon, 18 May 2015 07:11:56 -0400 Received: from foss.arm.com ([217.140.101.70]:59431 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbbERLLs (ORCPT ); Mon, 18 May 2015 07:11:48 -0400 Date: Mon, 18 May 2015 12:11:44 +0100 From: Catalin Marinas To: Mark Salter Cc: Will Deacon , Matt Fleming , Ard Biesheuvel , linux-kernel@vger.kernel.org, Hanjun Guo , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: support ACPI tables outside of kernel RAM Message-ID: <20150518111143.GC21251@e104818-lin.cambridge.arm.com> References: <1431613373-10928-1-git-send-email-msalter@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431613373-10928-1-git-send-email-msalter@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2015 at 10:22:53AM -0400, Mark Salter wrote: > There is no guarantee that ACPI tables will be located in RAM linearly > mapped by the kernel. This could be because UEFI placed them below the > kernel image or because mem= places them beyond the reach of the linear > kernel mapping. Even though these tables are outside the linear mapped > RAM, they still need to be accessed as normal memory in order to support > unaligned accesses from ACPI code. In this case, the page_is_ram() test > in acpi_os_ioremap() is not sufficient. And can we not simply add the rest of the RAM to the resource list as "System RAM" without being part of memblock? > Additionally, if the table spans multiple pages, it may fall partially > within the linear map and partially without. If the table overlaps the > end of the linear map, the test for whether or not to use the existing > mapping in ioremap_cache() could lead to a panic when ACPI code tries > to access the part beyond the end of the linear map. This patch > attempts to address these problems. That's a problem with ioremap_cache() that should be fixed independently. Ideally, I'd like to see the ACPI code use different APIs to distinguish between table access in RAM and device access, so that we don't have to guess whether the page is RAM or not. -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas@arm.com (Catalin Marinas) Date: Mon, 18 May 2015 12:11:44 +0100 Subject: [PATCH] arm64: support ACPI tables outside of kernel RAM In-Reply-To: <1431613373-10928-1-git-send-email-msalter@redhat.com> References: <1431613373-10928-1-git-send-email-msalter@redhat.com> Message-ID: <20150518111143.GC21251@e104818-lin.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, May 14, 2015 at 10:22:53AM -0400, Mark Salter wrote: > There is no guarantee that ACPI tables will be located in RAM linearly > mapped by the kernel. This could be because UEFI placed them below the > kernel image or because mem= places them beyond the reach of the linear > kernel mapping. Even though these tables are outside the linear mapped > RAM, they still need to be accessed as normal memory in order to support > unaligned accesses from ACPI code. In this case, the page_is_ram() test > in acpi_os_ioremap() is not sufficient. And can we not simply add the rest of the RAM to the resource list as "System RAM" without being part of memblock? > Additionally, if the table spans multiple pages, it may fall partially > within the linear map and partially without. If the table overlaps the > end of the linear map, the test for whether or not to use the existing > mapping in ioremap_cache() could lead to a panic when ACPI code tries > to access the part beyond the end of the linear map. This patch > attempts to address these problems. That's a problem with ioremap_cache() that should be fixed independently. Ideally, I'd like to see the ACPI code use different APIs to distinguish between table access in RAM and device access, so that we don't have to guess whether the page is RAM or not. -- Catalin