public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2.6.19-rc6-git2] EFI: mapping memory region of runtime services when using memmap kernel parameter
       [not found] <C1467C8B168BCF40ACEC2324C1A2B074A6A6A1@hasmsx411.ger.corp.intel.com>
@ 2006-11-19 18:32 ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2006-11-19 18:32 UTC (permalink / raw)
  To: Myaskouvskey, Artiom; +Cc: davej, hpa, linux-kernel, Satt, Shai

Myaskouvskey, Artiom wrote:
> From: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
> 
> When using memmap kernel parameter in EFI boot we should also add to memory map 
> memory regions of runtime services to enable their mapping later.
> 
> Signed-off-by: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
> ---

The double linefeeds are gone. which is Good.
It looks like you ignored the rest of my comments.  :(

and for some reason, when I save this from tbird or sylpheed,
all I get is base64 mess.  Can anyone tell me how to convert
that to something that is usable?

(I wonder why I didn't see this patch version on lkml...)

> diff -uprN linux-2.6.19-rc6-git2.original/include/linux/efi.h linux-2.6.19-rc6-git2/include/linux/efi.h
> --- linux-2.6.19-rc6-git2.original/include/linux/efi.h	2006-11-19 10:47:41.000000000 +0200
> +++ linux-2.6.19-rc6-git2/include/linux/efi.h	2006-11-19 11:06:35.000000000 +0200
> @@ -302,6 +302,7 @@ extern void efi_initialize_iomem_resourc
>  					struct resource *data_resource);
>  extern unsigned long __init efi_get_time(void);
>  extern int __init efi_set_rtc_mmss(unsigned long nowtime);
> +extern int is_available_memory(efi_memory_desc_t * md);
>  extern struct efi_memory_map memmap;
>  
>  /**
> diff -uprN linux-2.6.19-rc6-git2.original/arch/i386/kernel/setup.c linux-2.6.19-rc6-git2/arch/i386/kernel/setup.c
> --- linux-2.6.19-rc6-git2.original/arch/i386/kernel/setup.c	2006-11-19 10:48:20.000000000 +0200
> +++ linux-2.6.19-rc6-git2/arch/i386/kernel/setup.c	2006-11-19 11:23:27.000000000 +0200
> @@ -349,25 +349,44 @@ static void __init probe_roms(void)
>  static void __init limit_regions(unsigned long long size)
>  {
>  	unsigned long long current_addr = 0;
> -	int i;
> +	int i , j;
>  
>  	if (efi_enabled) {
> -		efi_memory_desc_t *md;
> -		void *p;
> +		efi_memory_desc_t *md, *next_md = 0;
> +		void *p, *p1;
>  
> -		for (p = memmap.map, i = 0; p < memmap.map_end;
> -			p += memmap.desc_size, i++) {
> +		for (p = memmap.map, i = 0,j = 0, p1 = memmap.map;
> +			p < memmap.map_end; p += memmap.desc_size, i++) {
>  			md = p;
> -			current_addr = md->phys_addr + (md->num_pages << 12);
> -			if (md->type == EFI_CONVENTIONAL_MEMORY) {
> +			next_md = p1;
> +			current_addr = md->phys_addr + 
> +				PFN_PHYS(md->num_pages);
> +			if (is_available_memory(md)) {
> +				if (md->phys_addr >= size) continue;
> +				memcpy(next_md, md, memmap.desc_size);
>  				if (current_addr >= size) {
> -					md->num_pages -=
> -						(((current_addr-size) + PAGE_SIZE-1) >> PAGE_SHIFT);
> -					memmap.nr_map = i + 1;
> -					return;
> +					next_md->num_pages -=
> +						PFN_UP(current_addr-size);
>  				}
> +				p1 += memmap.desc_size;
> +				next_md = p1;
> +				j++;
> +			}
> +			else if ((md->attribute & EFI_MEMORY_RUNTIME) ==
> +						EFI_MEMORY_RUNTIME) {
> +				/* In order to make runtime services 
> +				 * available we have to include runtime
> +				 * memory regions in memory map */
> +				memcpy(next_md, md, memmap.desc_size);
> +				p1 += memmap.desc_size;
> +				next_md = p1;
> +				j++;
>  			}
>  		}
> +		memmap.nr_map = j;
> +		memmap.map_end = memmap.map + 
> +			(memmap.nr_map * memmap.desc_size);
> +		return;
>  	}
>  	for (i = 0; i < e820.nr_map; i++) {
>  		current_addr = e820.map[i].addr + e820.map[i].size;


-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2.6.19-rc6-git2] EFI: mapping memory region of runtime services when using memmap kernel parameter
@ 2006-11-21  9:09 Myaskouvskey, Artiom
  2006-11-21 16:22 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Myaskouvskey, Artiom @ 2006-11-21  9:09 UTC (permalink / raw)
  To: randy.dunlap; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

From: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>

When using memmap kernel parameter in EFI boot we should also add to memory map 
memory regions of runtime services to enable their mapping later.

Signed-off-by: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
---



[-- Attachment #2: efi-memmap.patch.gz --]
[-- Type: application/x-gtar, Size: 1093 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.6.19-rc6-git2] EFI: mapping memory region of runtime services when using memmap kernel parameter
  2006-11-21  9:09 Myaskouvskey, Artiom
@ 2006-11-21 16:22 ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2006-11-21 16:22 UTC (permalink / raw)
  To: Myaskouvskey, Artiom; +Cc: linux-kernel

Myaskouvskey, Artiom wrote:
> From: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
> 
> When using memmap kernel parameter in EFI boot we should also add to memory map 
> memory regions of runtime services to enable their mapping later.
> 
> Signed-off-by: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
> ---

Thanks, I can actually apply the patch now, as opposed to the apparently
base64-encoded version that was just junk to me.

Of course, we can't review it easily when it's an attachment.
It would be a Good Thing for you to experiment with some email clients
that can send patches inline (not as attachments, not as base64) and
which do not mangle the whitespace and do not encode the text.

Back to the patch:  it's only for i386.  Does x86_64 need
similar treatment?

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-21 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <C1467C8B168BCF40ACEC2324C1A2B074A6A6A1@hasmsx411.ger.corp.intel.com>
2006-11-19 18:32 ` [PATCH 2.6.19-rc6-git2] EFI: mapping memory region of runtime services when using memmap kernel parameter Randy Dunlap
2006-11-21  9:09 Myaskouvskey, Artiom
2006-11-21 16:22 ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox