Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423068AbbFEQne (ORCPT ); Fri, 5 Jun 2015 12:43:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53682 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422982AbbFEQn3 (ORCPT ); Fri, 5 Jun 2015 12:43:29 -0400 Message-ID: <5571D1AE.4050605@codeaurora.org> Date: Fri, 05 Jun 2015 09:43:26 -0700 From: "Zhang, Jonathan Zhixiong" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Matt Fleming CC: rjw@rjwysocki.net, lenb@kernel.org, ying.huang@intel.com, leif.lindholm@linaro.org, al.stone@linaro.org, fu.wei@linaro.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linaro-acpi@lists.linaro.org, vgandhi@codeaurora.org, Tony Luck , Borislav Petkov Subject: Re: [PATCH V2 3/3] acpi, apei: use EFI memmap to map GHES memory References: <1433185940-24770-1-git-send-email-zjzhang@codeaurora.org> <1433185940-24770-4-git-send-email-zjzhang@codeaurora.org> <20150605095701.GA20042@codeblueprint.co.uk> In-Reply-To: <20150605095701.GA20042@codeblueprint.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2694 Lines: 68 Thanks Matt for the review. Yes, you are right on, I am following this: > modify ghes_ioremap_* to query the EFI memmap (if > it's available at runtime) to lookup the correct mapping attributes. Jonathan On 6/5/2015 2:57 AM, Matt Fleming wrote: > [ Cc'ing Boris and Tony. Folks original patch is here, > https://lkml.kernel.org/r/1433185940-24770-4-git-send-email-zjzhang@codeaurora.org ] > > On Mon, 01 Jun, at 12:12:20PM, Jonathan (Zhixiong) Zhang wrote: >> From: "Jonathan (Zhixiong) Zhang" >> >> With ACPI APEI firmware first handling, generic hardware error >> record is updated by firmware in GHES memory region. When firmware >> updated GHES memory region in DDR without going through cache, >> Linux reads stale data from cache. >> >> GHES memory region should be mapped with cache attributes >> according to EFI memory map when applicable. If firmware updates >> DDR directly, EFI memory map has GHES memory region defined as >> uncached; If firmware updates cache, EFI memory map has GHES >> memory region defined as cached. >> >> When EFI is configued, map IRQ page using efi_remap() provided by >> EFI subsystem. > > [...] > >> @@ -159,6 +160,7 @@ static void __iomem *ghes_ioremap_pfn_nmi(u64 pfn) >> return (void __iomem *)vaddr; >> } >> >> +#ifndef CONFIG_EFI >> static void __iomem *ghes_ioremap_pfn_irq(u64 pfn) >> { >> unsigned long vaddr; > > Sprinkling CONFIG_EFI like this is wrong. On x86 we run kernels built > with CONFIG_EFI on machines with BIOS - you can't make the EFI vs. > non-EFI decision at compile-time. > > So this patch looks like a potential regression to me since on x86 > ghes_ioremap_pfn_irq() would not be used anymore and instead we'd be > using efi_remap() which will perform an ioremap_nocache() if it gets > called after efi_free_boot_services(). > > And based on the comments in the apei code, that's going to cause issues > because ioremap() does not work in atomic context, not to mention the > fact that we've gone from a cached mapping to an uncached one. > > Instead, I suggest you modify ghes_ioremap_* to query the EFI memmap (if > it's available at runtime) to lookup the correct mapping attributes. > > But I've Cc'd some more people who have actually worked on this code, > since I'm not one of them. > -- Jonathan (Zhixiong) Zhang 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/