From: Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
To: dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org,
hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org,
James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org,
vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org,
horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org,
kexec-TuqUDEhatI4ANWPb/1PvSmm0pvjS0E/A@public.gmane.org,
kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [patch 3/6] Cleanup efi_enter_virtual_mode function
Date: Mon, 28 Oct 2013 10:32:06 +0100 [thread overview]
Message-ID: <20131028093206.GB4314@pd.tnic> (raw)
In-Reply-To: <20131027035923.081819853-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
On Sun, Oct 27, 2013 at 11:47:16AM +0800, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
> Add two small functions:
> efi_merge_regions and efi_map_regions, efi_enter_virtual_mode
> calls them instead of embedding two long for loop.
>
> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> arch/x86/platform/efi/efi.c | 83 +++++++++++++++++++++++++++-----------------
> 1 file changed, 52 insertions(+), 31 deletions(-)
>
> --- efi.orig/arch/x86/platform/efi/efi.c
> +++ efi/arch/x86/platform/efi/efi.c
> @@ -789,35 +789,13 @@ void __init old_map_region(efi_memory_de
> pr_err("ioremap of 0x%llX failed!\n",
> (unsigned long long)md->phys_addr);
> }
> -/*
> - * This function will switch the EFI runtime services to virtual mode.
> - * Essentially, look through the EFI memmap and map every region that
> - * has the runtime attribute bit set in its memory descriptor and update
> - * that memory descriptor with the virtual address obtained from ioremap().
> - * This enables the runtime services to be called without having to
> - * thunk back into physical mode for every invocation.
> - */
> -void __init efi_enter_virtual_mode(void)
> -{
> - efi_memory_desc_t *md, *prev_md = NULL;
> - void *p, *new_memmap = NULL;
> - unsigned long size;
> - efi_status_t status;
> - u64 end, systab;
> - int count = 0;
>
> - efi.systab = NULL;
> -
> - /*
> - * We don't do virtual mode, since we don't do runtime services, on
> - * non-native EFI
> - */
> - if (!efi_is_native()) {
> - efi_unmap_memmap();
> - return;
> - }
> +/* Merge contiguous regions of the same type and attribute */
> +static void efi_merge_regions(void)
> +{
> + void *p;
> + efi_memory_desc_t *md, *prev_md = NULL;
>
> - /* Merge contiguous regions of the same type and attribute */
> for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
> u64 prev_size;
> md = p;
> @@ -844,6 +822,19 @@ void __init efi_enter_virtual_mode(void)
> prev_md = md;
>
> }
> +}
> +
> +/*
> + * Map efi memory ranges for runtime serivce
> + * Return the new memmap with updated virtual addrresses.
> + */
> +void efi_map_regions(void **new_memmap, int *count)
> +{
> + efi_memory_desc_t *md, *prev_md = NULL;
Applying: Cleanup efi_enter_virtual_mode function
/home/boris/kernel/linux-2.6/.git/rebase-apply/patch:42: space before tab in indent.
efi_memory_desc_t *md, *prev_md = NULL;
error: patch failed: arch/x86/platform/efi/efi.c:862
error: arch/x86/platform/efi/efi.c: patch does not apply
Patch failed at 0001 Cleanup efi_enter_virtual_mode function
And I know git can be a bit pickier than patch but it doesn't apply with patch
either:
$ patch -p1 --dry-run -i .git/rebase-apply/patch
checking file arch/x86/platform/efi/efi.c
Hunk #3 FAILED at 853.
1 out of 3 hunks FAILED
For some reason, this patch doesn't apply and the .rej looks funny.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
next prev parent reply other threads:[~2013-10-28 9:32 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-27 3:47 [patch 0/6] kexec kernel efi runtime support dyoung-H+wXaHxf7aLQT0dZR+AlfA
2013-10-27 3:47 ` [patch 1/6] Add function efi_remap_region for remapping to saved virt address dyoung-H+wXaHxf7aLQT0dZR+AlfA
[not found] ` <20131027035922.776610726-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-27 11:50 ` Borislav Petkov
[not found] ` <20131027115038.GB21868-fF5Pk5pvG8Y@public.gmane.org>
2013-10-28 1:25 ` Dave Young
2013-10-27 3:47 ` [patch 2/6] x86 efi: reserve boot service fix dyoung-H+wXaHxf7aLQT0dZR+AlfA
[not found] ` <20131027035922.924386710-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-27 10:50 ` Borislav Petkov
[not found] ` <20131027105009.GA21868-fF5Pk5pvG8Y@public.gmane.org>
2013-10-27 20:30 ` Matt Fleming
[not found] ` <20131027203058.GE1982-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-10-28 1:18 ` Dave Young
[not found] ` <20131028011824.GD4397-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-28 8:44 ` Borislav Petkov
[not found] ` <20131028084440.GA4314-fF5Pk5pvG8Y@public.gmane.org>
2013-10-28 10:27 ` Matt Fleming
2013-10-27 3:47 ` [patch 3/6] Cleanup efi_enter_virtual_mode function dyoung-H+wXaHxf7aLQT0dZR+AlfA
[not found] ` <20131027035923.081819853-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-28 9:32 ` Borislav Petkov [this message]
[not found] ` <20131028093206.GB4314-fF5Pk5pvG8Y@public.gmane.org>
2013-10-28 9:40 ` Dave Young
[not found] ` <20131028094049.GC25527-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-28 9:51 ` Dave Young
2013-10-28 10:04 ` Borislav Petkov
[not found] ` <20131028100402.GC4314-fF5Pk5pvG8Y@public.gmane.org>
2013-10-28 10:10 ` Dave Young
[not found] ` <20131028101011.GF25527-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-28 10:39 ` Dave Young
2013-10-28 11:20 ` Borislav Petkov
[not found] ` <20131028112045.GH4314-fF5Pk5pvG8Y@public.gmane.org>
2013-10-28 11:24 ` Dave Young
2013-10-28 14:58 ` Borislav Petkov
[not found] ` <20131028145801.GM4314-fF5Pk5pvG8Y@public.gmane.org>
2013-10-28 15:10 ` Dave Young
[not found] ` <20131028151048.GA14984-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-29 2:32 ` Dave Young
2013-10-29 13:43 ` Borislav Petkov
[not found] ` <20131029134302.GI10972-fF5Pk5pvG8Y@public.gmane.org>
2013-10-30 2:03 ` Dave Young
[not found] ` <20131030020348.GA4332-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-30 10:47 ` Borislav Petkov
[not found] ` <20131030104718.GB13290-fF5Pk5pvG8Y@public.gmane.org>
2013-10-31 2:04 ` Dave Young
[not found] ` <20131031020405.GA4377-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-31 2:07 ` Dave Young
[not found] ` <20131031020714.GB4377-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-31 3:07 ` H. Peter Anvin
[not found] ` <5271C981.2050705-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-10-31 10:45 ` Borislav Petkov
[not found] ` <20131031104535.GB10544-fF5Pk5pvG8Y@public.gmane.org>
2013-11-01 1:15 ` Dave Young
2013-10-31 10:44 ` Borislav Petkov
[not found] ` <20131031104426.GA10544-fF5Pk5pvG8Y@public.gmane.org>
2013-11-01 1:18 ` Dave Young
[not found] ` <20131101011825.GB4378-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-11-01 11:32 ` Borislav Petkov
2013-10-27 3:47 ` [patch 4/6] export more efi table variable to sysfs dyoung-H+wXaHxf7aLQT0dZR+AlfA
2013-10-27 3:47 ` [patch 5/6] export efi runtime memory mapping " dyoung-H+wXaHxf7aLQT0dZR+AlfA
[not found] ` <20131027035923.442470867-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-29 5:34 ` Dave Young
2013-10-27 3:47 ` [patch 6/6] passing kexec necessary efi data via setup_data dyoung-H+wXaHxf7aLQT0dZR+AlfA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131028093206.GB4314@pd.tnic \
--to=bp-gina5biwoiwzqb+pc5nmwq@public.gmane.org \
--cc=James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org \
--cc=dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
--cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
--cc=kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=kexec-TuqUDEhatI4ANWPb/1PvSmm0pvjS0E/A@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org \
--cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox