lkml.org 
[lkml]   [2018]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] efi/esrt: mark ESRT memory region as nomap
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 <tbaicar@codeaurora.org>
> Tested-by: Jeffrey Hugo <jhugo@codeaurora.org>
> ---
> 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

\
 
 \ /
  Last update: 2018-02-24 08:23    [W:0.125 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site