public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
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 1/6] Add function efi_remap_region for remapping to saved virt address
Date: Sun, 27 Oct 2013 12:50:39 +0100	[thread overview]
Message-ID: <20131027115038.GB21868@pd.tnic> (raw)
In-Reply-To: <20131027035922.776610726-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>

On Sun, Oct 27, 2013 at 11:47:14AM +0800, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
> Kexec kernel will use saved runtime virtual mapping, so add a
> new function efi_remap_region to remapping it directly without
> calculate the virt addr from efi_va.
> 
> The md is passed in from 1st kernel, the virtual addr is
> saved in md->virt_addr.
> 
> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  arch/x86/include/asm/efi.h     |    1 +
>  arch/x86/platform/efi/efi_32.c |    4 ++++
>  arch/x86/platform/efi/efi_64.c |   13 +++++++++++++
>  3 files changed, 18 insertions(+)
> 
> --- linux-2.6.orig/arch/x86/include/asm/efi.h
> +++ linux-2.6/arch/x86/include/asm/efi.h
> @@ -112,6 +112,7 @@ extern void efi_call_phys_epilog(void);
>  extern void efi_unmap_memmap(void);
>  extern void efi_memory_uc(u64 addr, unsigned long size);
>  extern void __init efi_map_region(efi_memory_desc_t *md);
> +extern void __init efi_remap_region(efi_memory_desc_t *md);
>  extern void efi_sync_low_kernel_mappings(void);
>  extern void __init old_map_region(efi_memory_desc_t *md);
>  
> --- linux-2.6.orig/arch/x86/platform/efi/efi_64.c
> +++ linux-2.6/arch/x86/platform/efi/efi_64.c
> @@ -177,6 +177,19 @@ void __init efi_map_region(efi_memory_de
>  	md->virt_addr = efi_va;
>  }
>  
> +void __init efi_remap_region(efi_memory_desc_t *md)

remap? Why?

You did have efi_map_region_fixed() which made more sense.

> +{
> +	pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
> +	unsigned long pf = 0;
> +
> +	if (!(md->attribute & EFI_MEMORY_WB))
> +		pf |= _PAGE_PCD;
> +
> +	if(kernel_map_pages_in_pgd(pgd, md->phys_addr, md->virt_addr, md->num_pages, pf))

ERROR: space required before the open parenthesis '('
#59: FILE: arch/x86/platform/efi/efi_64.c:188:
+       if(kernel_map_pages_in_pgd(pgd, md->phys_addr, md->virt_addr, md->num_pages, pf))


Please run them all through checkpatch.pl - better yet, integrate
checkpatch into your workflow like using git hooks, for example.

> +		pr_warning("Error mapping PA 0x%llx -> VA 0x%llx!\n",

WARNING: Prefer pr_warn(... to pr_warning(...
#60: FILE: arch/x86/platform/efi/efi_64.c:189:
+               pr_warning("Error mapping PA 0x%llx -> VA 0x%llx!\n",

> +			   md->phys_addr, md->virt_addr);
> +}
> +
>  void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
>  				 u32 type, u64 attribute)
>  {
> --- linux-2.6.orig/arch/x86/platform/efi/efi_32.c
> +++ linux-2.6/arch/x86/platform/efi/efi_32.c
> @@ -46,6 +46,10 @@ void __init efi_map_region(efi_memory_de
>  	old_map_region(md);
>  }
>  
> +void __init efi_remap_region(efi_memory_desc_t *md)
> +{
> +}

Let's keep braces on the same line as the function to save space:

void __init efi_remap_region(efi_memory_desc_t *md) {}

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  parent reply	other threads:[~2013-10-27 11:50 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 [this message]
     [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
     [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=20131027115038.GB21868@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