[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c45cce8ceb98b178976751a1d7db8be.squirrel@www.skyhub.de>
Date: Wed, 25 Sep 2013 11:24:54 +0200 (CEST)
From: "Borislav Petkov" <bp@...en8.de>
To: "Borislav Petkov" <bp@...en8.de>
Cc: "X86 ML" <x86@...nel.org>, "LKML" <linux-kernel@...r.kernel.org>,
"Borislav Petkov" <bp@...e.de>,
"Matt Fleming" <matt@...sole-pimps.org>,
"Matthew Garrett" <mjg59@...f.ucam.org>,
"H. Peter Anvin" <hpa@...or.com>,
"James Bottomley" <james.bottomley@...senpartnership.com>,
"Vivek Goyal" <vgoyal@...hat.com>,
"Dave Young" <dyoung@...hat.com>, linux-efi@...r.kernel.org
Subject: Re: [PATCH -v2] EFI: Runtime services virtual mapping
On Sat, September 21, 2013 1:39 pm, Borislav Petkov wrote:
> diff --git a/arch/x86/platform/efi/efi_32.c
> b/arch/x86/platform/efi/efi_32.c
> index 40e446941dd7..661663b08eaf 100644
> --- a/arch/x86/platform/efi/efi_32.c
> +++ b/arch/x86/platform/efi/efi_32.c
> @@ -37,9 +37,36 @@
> * claim EFI runtime service handler exclusively and to duplicate a
> memory in
> * low memory space say 0 - 3G.
> */
> -
> static unsigned long efi_rt_eflags;
>
> +void efi_sync_low_kernel_mappings(void) {}
> +
> +void __init efi_map_region(efi_memory_desc_t *md)
> +{
> + u64 start_pfn, end_pfn, end;
> + unsigned long size;
> + void *va;
> +
> + start_pfn = PFN_DOWN(md->phys_addr);
> + size = md->num_pages << PAGE_SHIFT;
> + end = md->phys_addr + size;
> + end_pfn = PFN_UP(end);
> +
> + if (pfn_range_is_mapped(start_pfn, end_pfn)) {
> + va = __va(md->phys_addr);
> +
> + if (!(md->attribute & EFI_MEMORY_WB))
> + efi_memory_uc((u64)(unsigned long)va, size);
> + } else
> + va = efi_ioremap(md->phys_addr, size,
> + md->type, md->attribute);
> +
> + md->virt_addr = (u64) (unsigned long) va;
> + if (!va)
> + pr_err("ioremap of 0x%llX failed!\n",
> + (unsigned long long)md->phys_addr);
> +}
> +
Another note-to-self, while I'm here: it is probably prudent to
be conservative here and keep the old runtime mapping method
in generic EFI code and behind a chicken bit, something like
"efi.use_old_runtime_mapping" or shorter so that people whose systems
break from the new mapping can fall back to the old, well-tested method.
Thanks.
--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists