Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbbGOAcN (ORCPT ); Tue, 14 Jul 2015 20:32:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53509 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbbGOAcJ (ORCPT ); Tue, 14 Jul 2015 20:32:09 -0400 From: "Jonathan (Zhixiong) Zhang" To: Matt Fleming , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, ying.huang@intel.com, fu.wei@linaro.org, al.stone@linaro.org, bp@alien8.de, rjw@rjwysocki.net, lenb@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com Cc: "Jonathan (Zhixiong) Zhang" , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org Subject: [PATCH V5 2/4] x86: acpi: implement arch_apei_get_mem_attributes() Date: Tue, 14 Jul 2015 17:31:54 -0700 Message-Id: <1436920316-18127-3-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: 2014 Lines: 63 From: "Jonathan (Zhixiong) Zhang" ... to allow arch specific implementation of getting page protection type associated with a physical address. If the physical address has memory attributes defined by EFI memmap as EFI_MEMORY_UC, the page protection type is PAGE_KENERL_NOCACHE. Otherwise, the page protection type is PAGE_KERNEL. Change-Id: Ia06d809c4dca05b68cbc9a94eea00c3f549a92e5 Signed-off-by: Jonathan (Zhixiong) Zhang --- arch/x86/kernel/acpi/apei.c | 10 ++++++++++ include/acpi/apei.h | 1 + 2 files changed, 11 insertions(+) diff --git a/arch/x86/kernel/acpi/apei.c b/arch/x86/kernel/acpi/apei.c index c280df6b2aa2..cfcde9142b94 100644 --- a/arch/x86/kernel/acpi/apei.c +++ b/arch/x86/kernel/acpi/apei.c @@ -14,6 +14,8 @@ #include +#include + #include #include @@ -60,3 +62,11 @@ void arch_apei_flush_tlb_one(unsigned long addr) { __flush_tlb_one(addr); } + +pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr) +{ + if (efi_mem_attributes(addr) & EFI_MEMORY_UC) + return PAGE_KERNEL_NOCACHE; + else + return PAGE_KERNEL; +} diff --git a/include/acpi/apei.h b/include/acpi/apei.h index 284801ac7042..64a12ce9880b 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h @@ -46,6 +46,7 @@ int erst_clear(u64 record_id); int arch_apei_enable_cmcff(struct acpi_hest_header *hest_hdr, void *data); void arch_apei_report_mem_error(int sev, struct cper_sec_mem_err *mem_err); void arch_apei_flush_tlb_one(unsigned long addr); +pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr); #endif #endif -- 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/