Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbbGOAcp (ORCPT ); Tue, 14 Jul 2015 20:32:45 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53520 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbbGOAcL (ORCPT ); Tue, 14 Jul 2015 20:32:11 -0400 From: "Jonathan (Zhixiong) Zhang" To: catalin.marinas@arm.com, will.deacon@arm.com, fu.wei@linaro.org, al.stone@linaro.org, "bp @ alien8 . de Matt Fleming" , rjw@rjwysocki.net Cc: "Jonathan (Zhixiong) Zhang" , linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org Subject: [PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes() Date: Tue, 14 Jul 2015 17:31:55 -0700 Message-Id: <1436920316-18127-4-git-send-email-zjzhang@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1436920316-18127-1-git-send-email-zjzhang@codeaurora.org> References: <1436920316-18127-1-git-send-email-zjzhang@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2348 Lines: 68 From: "Jonathan (Zhixiong) Zhang" If the physical address has memory attributes defined by EFI memmap as EFI_MEMORY_UC, the page protection type is PROT_DEVICE_nGnRE. Otherwise, the page protection type is PAGE_KERNEL. Signed-off-by: Jonathan (Zhixiong) Zhang --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/apei.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 arch/arm64/kernel/apei.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 426d0763c81b..c135f1e4e3b8 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -36,6 +36,7 @@ arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI_APEI) += apei.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) diff --git a/arch/arm64/kernel/apei.c b/arch/arm64/kernel/apei.c new file mode 100644 index 000000000000..9c6b62f40ad7 --- /dev/null +++ b/arch/arm64/kernel/apei.c @@ -0,0 +1,27 @@ +/* + * Arch-specific APEI-related functions. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include + +#include + +#include + +pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr) +{ + if (efi_mem_attributes(addr) & EFI_MEMORY_UC) + return PROT_DEVICE_nGnRE; + else + return PAGE_KERNEL; +} -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/