Received: by 10.223.185.116 with SMTP id b49csp1089200wrg; Fri, 23 Feb 2018 11:44:29 -0800 (PST) X-Google-Smtp-Source: AH8x225NZWFbAT0MEJt1SClWpvKGfWrcvZh+VhfTORcHvyc7EFuGyaCoxFrbpIzdu4+g4A3HHNyU X-Received: by 10.99.113.9 with SMTP id m9mr2315857pgc.164.1519415069843; Fri, 23 Feb 2018 11:44:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415069; cv=none; d=google.com; s=arc-20160816; b=OkaXVGCv5TP9twvD7YYT34plzHCNdlkcfQ8o+syr62AOuTKIcC4yiriDeGrLyldyXT 4hZsqqLhwCwB9tfu71agkRSf0J5+VwykvmPIxBTnRVYV1AKNSctNR8TLqyOKMpvH4nfb PSmoOTMKGeXgJ7i2OkTRMs9KZ4YoPp/VkOM/VTMrY5xLAmtv6Nz/5Fr4gDhoU46m4OGO CrEZrBr459rZD4vCqlFyWvXi6pwMobqWYln1+co8SZsTE/HMASaEkGS4Qiz8eFFmNHQd B0jjgjXoKVLs50WWqiVeLJZi1S3QErtWW89+KxAzcCNQzxcABufgnIjOUAJRWlgebkpW Bfmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=lIvgqgx976PuBQ3a1RX6Qio6rnoWjzJzAANQ6/4/Y0w=; b=HeUdxkhNMJRDujFauVgDtz0n3OQlxLsbX3otTb6Z4CsQLDPAL1cKtLrzkdZL0i9Tw2 kOIYVUzAYNAZ18NA5nhl2MiibDsVMy8A2X7cBPU/wXSTkITqMR4KPkSazb6oXRO33H/u iLcSfBBnZVDAhFh62Xw4KzIORE9XR7CoGKy9Xzb9leUdEUwrlhRaMb1u9/UxqWs7mJma HZNyeOHs3RC1UIvletSsOVNZIRQAjuLpVSM+Pcxya0nN+KMOymb0isytiVfBhgO3jANR Z+25bQ0iPLbzIW1cm7uGZPdPNESsLU4qs+yvBwXCKIbtrHJJsKOGv9IcVTEF+YUgZC8j NSxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=O/A2aJk/; dkim=pass header.i=@codeaurora.org header.s=default header.b=cWDa8c0i; 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 w8si1848863pgt.182.2018.02.23.11.44.15; Fri, 23 Feb 2018 11:44:29 -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=O/A2aJk/; dkim=pass header.i=@codeaurora.org header.s=default header.b=cWDa8c0i; 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 S934091AbeBWTmk (ORCPT + 99 others); Fri, 23 Feb 2018 14:42:40 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57336 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754691AbeBWTmh (ORCPT ); Fri, 23 Feb 2018 14:42:37 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3E6DF6079B; Fri, 23 Feb 2018 19:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519414957; bh=CggJNd5T6dk8l7vU51Gd0QBAqwuJuawctw0Ll2/THe0=; h=From:To:Cc:Subject:Date:From; b=O/A2aJk/PIud9Dx9HCduXBHTEjsmTgcywfxUiX3/3kRd+Vrqd4rabZaDMIFAX+JYi cSR15vhmdUT+mjVjqCtu59wuzhBIzryU6knL2iAgpa9E3gfymodzmTMFXCikXwIHFP +W098Bm1AjOcpG335oHqgrt/h5fzNEPjCYH3hj2Y= 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 06D2C6079B; Fri, 23 Feb 2018 19:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519414956; bh=CggJNd5T6dk8l7vU51Gd0QBAqwuJuawctw0Ll2/THe0=; h=From:To:Cc:Subject:Date:From; b=cWDa8c0iuihW7HTaVHBeho1lasnoVRaB4zkZObbECU2hOjlnF2MrwJGjxzbGc83el o2p35YVpW26NAbjQCvfQNnlplDwZZnjpJIS9Xqoc72go5iuHGvMSS3SFKQHLenoh/H owLEGaixVODF3i6Zzw4H0M4LPN0G2YYJy81r1aCA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 06D2C6079B 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 0/2] ESRT fixes for relocatable kexec'd kernel Date: Fri, 23 Feb 2018 12:42:31 -0700 Message-Id: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently on arm64 ESRT memory does not appear to be properly blocked off. Upon successful initialization, ESRT prints out the memory region that it exists in like: esrt: Reserving ESRT space from 0x000000000a4c1c18 to 0x000000000a4c1cf0. But then by dumping /proc/iomem this region appears as part of System RAM rather than being reserved: 08f10000-0deeffff : System RAM This causes issues when trying to kexec if the kernel is relocatable. When kexec tries to execute, this memory can be selected to relocate the kernel to which then overwrites all the ESRT information. Then when the kexec'd kernel tries to initialize ESRT, it doesn't recognize the ESRT version number and just returns from efi_esrt_init(). This causes an early ioremap leak because the memory allocated for 'va' is never unmapped. So first fix that error case to properly unmap 'va' before returning. This still leaves ESRT unable to initialize in the kexec'd kernel, so now mark the ESRT memory block as nomap so that this memory is not treated as System RAM. With this change I'm able to see that the ESRT data is not overwritten when running a kexec'd kernel. Tyler Baicar (2): efi/esrt: fix unsupported version initialization failure efi/esrt: mark ESRT memory region as nomap drivers/firmware/efi/esrt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 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.