Received: by 10.223.185.116 with SMTP id b49csp1584377wrg; Fri, 23 Feb 2018 23:24:25 -0800 (PST) X-Google-Smtp-Source: AH8x2247zUUcw11SNSJ4SrsnvgwchwP5/a8zEW5E2rpGojspUmpOUOcyoZW0LKBSHScyfZHI51cH X-Received: by 2002:a17:902:7808:: with SMTP id p8-v6mr4247428pll.161.1519457065167; Fri, 23 Feb 2018 23:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519457065; cv=none; d=google.com; s=arc-20160816; b=l46SAVAWZyVFlM7rdS6YdDXefY/0ho+GzIQb3jVx1vJ2qOOcV66RLQ/fl1/AMwGAM7 ODTfADXqy2I1+vuFmqND2SOCDdFzcqTjOxVi2Rwpi0qIdWiclsXggLnRo+18setDkKVl 0pfs/aHACWZwLfy6volF1BbO/KCH22Ynur300D1Pe3EHxfF4wKbo5c5P7XOfFvuT/PVd U6hiE/By5C1FDaWniSfilwo347SGps5SgIQYxcwl4zaHxz844VWk6h7qLf+8Lw7cRSkb luYUrrEzA/j52U7e7dUOYOoNRDjAIO4Xl1Lsn4/iPfuQsS9xJab3cP20zBsfqZVpI1fY YZFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zGBkqUICtz1M3PPkgzYYTJLfNypgyC2KsGWJOE8TCC8=; b=ATNn6CdgfD7OFRYXCz4x97Y8B5sx5fivjeFhZ9kEZQW0WWIoJO2jGnzeK+DWwhVXyb dG3vas752tZ5TpANvoOdk4inj49H4wgb209C6/VWGhIbCfaFfTON2xOL0b8PPVOe2pJ6 pKkw/jBa7CI/8OfMniZEu1SQfpB6IncG3FjMVoi5A90k+6NERSUcRFXwGZYzGJLbNm2U RavDQ4LINL80Jk2EdRWoDu0KvyWverfE9a2iZFKA8vtToDBTFL34TbklULjrSocmBiE/ s8cESZMrxcjqf3ikBCFoz09YhL0JbNrTsYx4kGdQ530SMHBUvS9BH9hSFRul+cM0VZyJ QKtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si2595319pgt.198.2018.02.23.23.24.10; Fri, 23 Feb 2018 23:24:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbeBXHXG (ORCPT + 99 others); Sat, 24 Feb 2018 02:23:06 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750844AbeBXHXF (ORCPT ); Sat, 24 Feb 2018 02:23:05 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E0798182D33; Sat, 24 Feb 2018 07:23:04 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (unknown [10.66.129.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 497E210AF9FD; Sat, 24 Feb 2018 07:23:00 +0000 (UTC) Date: Sat, 24 Feb 2018 15:22:57 +0800 From: Dave Young To: Tyler Baicar Cc: ard.biesheuvel@linaro.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, jhugo@codeaurora.org, sgoel@codeaurora.org, takahiro.akashi@linaro.org, timur@codeaurora.org Subject: Re: [PATCH 2/2] efi/esrt: mark ESRT memory region as nomap Message-ID: <20180224072257.GB3264@dhcp-128-65.nay.redhat.com> References: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> <1519414953-5478-3-git-send-email-tbaicar@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519414953-5478-3-git-send-email-tbaicar@codeaurora.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 24 Feb 2018 07:23:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 24 Feb 2018 07:23:04 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dyoung@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/18 at 12:42pm, Tyler Baicar wrote: > The ESRT memory region is being exposed as System RAM in /proc/iomem > which is wrong because it cannot be overwritten. This memory is needed > for kexec kernels in order to properly initialize ESRT, so if it is > overwritten it will cause ESRT failures in the kexec kernel. Mark this > region as nomap so that it is not overwritten. > > Signed-off-by: Tyler Baicar > Tested-by: Jeffrey Hugo > --- > drivers/firmware/efi/esrt.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c > index 504f3c3..f5f79c7 100644 > --- a/drivers/firmware/efi/esrt.c > +++ b/drivers/firmware/efi/esrt.c > @@ -335,6 +335,14 @@ void __init efi_esrt_init(void) > pr_info("Reserving ESRT space from %pa to %pa.\n", &esrt_data, &end); > efi_mem_reserve(esrt_data, esrt_data_size); > > + /* > + * Mark the ESRT memory region as nomap to avoid it being exposed as > + * System RAM in /proc/iomem. Otherwise this block can be overwritten > + * which will then cause failures in kexec'd kernels since the ESRT > + * information is no longer there. > + */ > + memblock_mark_nomap(esrt_data, esrt_data_size); > + On my X86 machine, esrt region was marked as reserved /proc/iomem, this issue could be a arm64 only problem, it is better to handle this in arm init code. > pr_debug("esrt-init: loaded.\n"); > err_memunmap: > early_memunmap(va, size); > -- > Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. > Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project. > > -- > To unsubscribe from this list: send the line "unsubscribe linux-efi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks Dave