Received: by 10.223.185.116 with SMTP id b49csp1088458wrg; Fri, 23 Feb 2018 11:43:32 -0800 (PST) X-Google-Smtp-Source: AH8x224B7mPtbovwvY9V2w+56Ag7X6tAr+Y7OA4mafxefGsOZkcIslQKq7F+SwuvujQmmzHagYxi X-Received: by 10.98.98.194 with SMTP id w185mr2816514pfb.9.1519415012686; Fri, 23 Feb 2018 11:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415012; cv=none; d=google.com; s=arc-20160816; b=g3/u+SoeCrPbsimcIJBhex5cr88KuQL69GIAtnp0sIywItQ4t13u1KLLWhzepNU1bc +HrSb2/4hK+TtCK5SvguYlmszHJK8kT0kUFpEjMonr33Mqj0e8CJ8nfsmB0myGLqvZVf L7I+iacG5uVCYxlRhcjDX3jE/MGbJGjEvDotWOYlVjwEw5W+CUu9p8nbxKvWDSRFb79A 6syxlTuyCFq/KmVL6IDUECjKYTU2f3o5yc7MmFTEx4Q3c8781Omtq2QaE/Y7dAVwtcNS BmFMX/EzRms3+u5Y0aIzOT7JHXHCdovKeNs1XbxTtsj3kYPejkDDrRuter13lgScTo/u 0cwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=WMA/63rDBtc1llcZw0TFo7vhj8V6CsLV9kIjhpRF0Ww=; b=VLQmquGUenwbjbcfKkTAk661C1awEs+ChyICDy8s4SVNskSbR7kKoM+eX7RZcO7sYU qNALxSd1AH/JHRoV82OjBLBhaWKdQbq3TgiUWv86Tajv1/RnCt/JdTMBGlQU6YURvAGp wHdc9B1nVf1NEIU1jGilCRMslyvQ36GXLZV/jwwTgfT1USqkR6U7RQdZ09C8trCp+K1C yN9md1BlSjzsTLcif8ItcMa+5+AYjPrBBr8TBTyfaiwnO2PmgHPeghJL+WxP8sQtYBP1 7S/e4gWxKsnVlLqna8gwCi8Xg99Ep472pBsiCNEBjnLkgDJwvGqUzA1k/qW9wBS/83cV zMuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EZGfXY3x; dkim=pass header.i=@codeaurora.org header.s=default header.b=EZGfXY3x; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si1874762pgq.305.2018.02.23.11.43.18; Fri, 23 Feb 2018 11:43:32 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=EZGfXY3x; dkim=pass header.i=@codeaurora.org header.s=default header.b=EZGfXY3x; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934346AbeBWTmn (ORCPT + 99 others); Fri, 23 Feb 2018 14:42:43 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57432 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754691AbeBWTml (ORCPT ); Fri, 23 Feb 2018 14:42:41 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 966356079B; Fri, 23 Feb 2018 19:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519414960; bh=f28HRkHqqvVJxbTFRwnw5nzHmhItyynKNekvwleBR78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EZGfXY3xJWiaOClKblNLBWc+CJI7rq37CIej95p0MOthjzMnWTL2vUJJHmu3z0Npx obGcn6k55l6DJ+JkBHbNeNikDCNl/2Js5kHoEK96A5WoBzg30QeWPH8rx+hUjNA3Dk ENt+nZa2Twr3pCc2wQqt/6YdjOuYlUhJYzrtRL/c= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from tbaicar-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tbaicar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9451D6084A; Fri, 23 Feb 2018 19:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519414960; bh=f28HRkHqqvVJxbTFRwnw5nzHmhItyynKNekvwleBR78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EZGfXY3xJWiaOClKblNLBWc+CJI7rq37CIej95p0MOthjzMnWTL2vUJJHmu3z0Npx obGcn6k55l6DJ+JkBHbNeNikDCNl/2Js5kHoEK96A5WoBzg30QeWPH8rx+hUjNA3Dk ENt+nZa2Twr3pCc2wQqt/6YdjOuYlUhJYzrtRL/c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9451D6084A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org From: Tyler Baicar To: 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 Cc: Tyler Baicar Subject: [PATCH 2/2] efi/esrt: mark ESRT memory region as nomap Date: Fri, 23 Feb 2018 12:42:33 -0700 Message-Id: <1519414953-5478-3-git-send-email-tbaicar@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> References: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + 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.