linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs
@ 2015-02-24  9:13 Juergen Gross
  2015-02-24  9:13 ` [PATCH 1/4] x86: use early_memunmap in arch/x86/kernel/devicetree.c Juergen Gross
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Juergen Gross @ 2015-02-24  9:13 UTC (permalink / raw)
  To: linux-kernel, x86, hpa, tglx, mingo, linux-efi, matt.fleming
  Cc: Juergen Gross

Areas mapped via early_memremap() should be unmapped via
early_memunmap(), while I/O-areas should be mapped via early_ioremap()
and unmapped via early_iounmap().

There are multiple spots where an area is mapped via the mem variant
and unmapped via the io variant. This series corrects this by using
the appropriate variants.

Juergen Gross (4):
  x86: use early_memunmap in arch/x86/kernel/devicetree.c
  x86: use early_memunmap in arch/x86/kernel/e820.c
  x86: use early_memunmap in arch/x86/kernel/setup.c
  x86, efi: use early_ioremap in arch/x86/platform/efi/efi-bgrt.c

 arch/x86/kernel/devicetree.c     | 4 ++--
 arch/x86/kernel/e820.c           | 2 +-
 arch/x86/kernel/setup.c          | 8 ++++----
 arch/x86/platform/efi/efi-bgrt.c | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.1.4

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

* [PATCH 1/4] x86: use early_memunmap in arch/x86/kernel/devicetree.c
  2015-02-24  9:13 [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Juergen Gross
@ 2015-02-24  9:13 ` Juergen Gross
  2015-02-24  9:13 ` [PATCH 2/4] x86: use early_memunmap in arch/x86/kernel/e820.c Juergen Gross
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2015-02-24  9:13 UTC (permalink / raw)
  To: linux-kernel, x86, hpa, tglx, mingo, linux-efi, matt.fleming
  Cc: Juergen Gross

Memory mapped via early_memremap() should be unmapped with
early_memunmap() instead of early_iounmap().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/kernel/devicetree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 3d35033..6367a78 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -286,13 +286,13 @@ static void __init x86_flattree_get_config(void)
 	initial_boot_params = dt = early_memremap(initial_dtb, map_len);
 	size = of_get_flat_dt_size();
 	if (map_len < size) {
-		early_iounmap(dt, map_len);
+		early_memunmap(dt, map_len);
 		initial_boot_params = dt = early_memremap(initial_dtb, size);
 		map_len = size;
 	}
 
 	unflatten_and_copy_device_tree();
-	early_iounmap(dt, map_len);
+	early_memunmap(dt, map_len);
 }
 #else
 static inline void x86_flattree_get_config(void) { }
-- 
2.1.4

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

* [PATCH 2/4] x86: use early_memunmap in arch/x86/kernel/e820.c
  2015-02-24  9:13 [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Juergen Gross
  2015-02-24  9:13 ` [PATCH 1/4] x86: use early_memunmap in arch/x86/kernel/devicetree.c Juergen Gross
@ 2015-02-24  9:13 ` Juergen Gross
  2015-02-24  9:13 ` [PATCH 3/4] x86: use early_memunmap in arch/x86/kernel/setup.c Juergen Gross
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2015-02-24  9:13 UTC (permalink / raw)
  To: linux-kernel, x86, hpa, tglx, mingo, linux-efi, matt.fleming
  Cc: Juergen Gross

Memory mapped via early_memremap() should be unmapped with
early_memunmap() instead of early_iounmap().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/kernel/e820.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 46201de..7d46bb2 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -661,7 +661,7 @@ void __init parse_e820_ext(u64 phys_addr, u32 data_len)
 	extmap = (struct e820entry *)(sdata->data);
 	__append_e820_map(extmap, entries);
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
-	early_iounmap(sdata, data_len);
+	early_memunmap(sdata, data_len);
 	printk(KERN_INFO "e820: extended physical RAM map:\n");
 	e820_print_map("extended");
 }
-- 
2.1.4

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

* [PATCH 3/4] x86: use early_memunmap in arch/x86/kernel/setup.c
  2015-02-24  9:13 [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Juergen Gross
  2015-02-24  9:13 ` [PATCH 1/4] x86: use early_memunmap in arch/x86/kernel/devicetree.c Juergen Gross
  2015-02-24  9:13 ` [PATCH 2/4] x86: use early_memunmap in arch/x86/kernel/e820.c Juergen Gross
@ 2015-02-24  9:13 ` Juergen Gross
  2015-02-24  9:13 ` [PATCH 4/4] x86, efi: use early_ioremap in arch/x86/platform/efi/efi-bgrt.c Juergen Gross
       [not found] ` <1424769211-11378-1-git-send-email-jgross-IBi9RG/b67k@public.gmane.org>
  4 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2015-02-24  9:13 UTC (permalink / raw)
  To: linux-kernel, x86, hpa, tglx, mingo, linux-efi, matt.fleming
  Cc: Juergen Gross

Memory mapped via early_memremap() should be unmapped with
early_memunmap() instead of early_iounmap().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/kernel/setup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 98dc931..733864a 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -356,7 +356,7 @@ static void __init relocate_initrd(void)
 		mapaddr = ramdisk_image & PAGE_MASK;
 		p = early_memremap(mapaddr, clen+slop);
 		memcpy(q, p+slop, clen);
-		early_iounmap(p, clen+slop);
+		early_memunmap(p, clen+slop);
 		q += clen;
 		ramdisk_image += clen;
 		ramdisk_size  -= clen;
@@ -445,7 +445,7 @@ static void __init parse_setup_data(void)
 		data_len = data->len + sizeof(struct setup_data);
 		data_type = data->type;
 		pa_next = data->next;
-		early_iounmap(data, sizeof(*data));
+		early_memunmap(data, sizeof(*data));
 
 		switch (data_type) {
 		case SETUP_E820_EXT:
@@ -480,7 +480,7 @@ static void __init e820_reserve_setup_data(void)
 			 E820_RAM, E820_RESERVED_KERN);
 		found = 1;
 		pa_data = data->next;
-		early_iounmap(data, sizeof(*data));
+		early_memunmap(data, sizeof(*data));
 	}
 	if (!found)
 		return;
@@ -501,7 +501,7 @@ static void __init memblock_x86_reserve_range_setup_data(void)
 		data = early_memremap(pa_data, sizeof(*data));
 		memblock_reserve(pa_data, sizeof(*data) + data->len);
 		pa_data = data->next;
-		early_iounmap(data, sizeof(*data));
+		early_memunmap(data, sizeof(*data));
 	}
 }
 
-- 
2.1.4

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

* [PATCH 4/4] x86, efi: use early_ioremap in arch/x86/platform/efi/efi-bgrt.c
  2015-02-24  9:13 [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Juergen Gross
                   ` (2 preceding siblings ...)
  2015-02-24  9:13 ` [PATCH 3/4] x86: use early_memunmap in arch/x86/kernel/setup.c Juergen Gross
@ 2015-02-24  9:13 ` Juergen Gross
       [not found] ` <1424769211-11378-1-git-send-email-jgross-IBi9RG/b67k@public.gmane.org>
  4 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2015-02-24  9:13 UTC (permalink / raw)
  To: linux-kernel, x86, hpa, tglx, mingo, linux-efi, matt.fleming
  Cc: Juergen Gross

Use early_ioremap() to map an I/O-area instead of early_memremap().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/platform/efi/efi-bgrt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c
index d143d21..d7f997f 100644
--- a/arch/x86/platform/efi/efi-bgrt.c
+++ b/arch/x86/platform/efi/efi-bgrt.c
@@ -67,7 +67,7 @@ void __init efi_bgrt_init(void)
 
 	image = efi_lookup_mapped_addr(bgrt_tab->image_address);
 	if (!image) {
-		image = early_memremap(bgrt_tab->image_address,
+		image = early_ioremap(bgrt_tab->image_address,
 				       sizeof(bmp_header));
 		ioremapped = true;
 		if (!image) {
@@ -89,7 +89,7 @@ void __init efi_bgrt_init(void)
 	}
 
 	if (ioremapped) {
-		image = early_memremap(bgrt_tab->image_address,
+		image = early_ioremap(bgrt_tab->image_address,
 				       bmp_header.size);
 		if (!image) {
 			pr_err("Ignoring BGRT: failed to map image memory\n");
-- 
2.1.4

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

* Re: [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs
       [not found] ` <1424769211-11378-1-git-send-email-jgross-IBi9RG/b67k@public.gmane.org>
@ 2015-02-24 19:22   ` Matt Fleming
  2015-02-26  7:50   ` Dave Young
  1 sibling, 0 replies; 7+ messages in thread
From: Matt Fleming @ 2015-02-24 19:22 UTC (permalink / raw)
  To: Juergen Gross
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, x86-DgEjT+Ai2ygdnm+yROfE0A,
	hpa-YMNOUZJC4hwAvxtiuMwx3w, tglx-hfZtesqFncYOwBW4kG4KsQ,
	mingo-H+wXaHxf7aLQT0dZR+AlfA, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w

On Tue, 24 Feb, at 10:13:27AM, Juergen Gross wrote:
> Areas mapped via early_memremap() should be unmapped via
> early_memunmap(), while I/O-areas should be mapped via early_ioremap()
> and unmapped via early_iounmap().
> 
> There are multiple spots where an area is mapped via the mem variant
> and unmapped via the io variant. This series corrects this by using
> the appropriate variants.
> 
> Juergen Gross (4):
>   x86: use early_memunmap in arch/x86/kernel/devicetree.c
>   x86: use early_memunmap in arch/x86/kernel/e820.c
>   x86: use early_memunmap in arch/x86/kernel/setup.c
>   x86, efi: use early_ioremap in arch/x86/platform/efi/efi-bgrt.c
> 
>  arch/x86/kernel/devicetree.c     | 4 ++--
>  arch/x86/kernel/e820.c           | 2 +-
>  arch/x86/kernel/setup.c          | 8 ++++----
>  arch/x86/platform/efi/efi-bgrt.c | 4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)

Whole series looks good to me.

Reviewed-by: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

-- 
Matt Fleming, Intel Open Source Technology Center

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

* Re: [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs
       [not found] ` <1424769211-11378-1-git-send-email-jgross-IBi9RG/b67k@public.gmane.org>
  2015-02-24 19:22   ` [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Matt Fleming
@ 2015-02-26  7:50   ` Dave Young
  1 sibling, 0 replies; 7+ messages in thread
From: Dave Young @ 2015-02-26  7:50 UTC (permalink / raw)
  To: Juergen Gross
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, x86-DgEjT+Ai2ygdnm+yROfE0A,
	hpa-YMNOUZJC4hwAvxtiuMwx3w, tglx-hfZtesqFncYOwBW4kG4KsQ,
	mingo-H+wXaHxf7aLQT0dZR+AlfA, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w

On 02/24/15 at 10:13am, Juergen Gross wrote:
> Areas mapped via early_memremap() should be unmapped via
> early_memunmap(), while I/O-areas should be mapped via early_ioremap()
> and unmapped via early_iounmap().
> 
> There are multiple spots where an area is mapped via the mem variant
> and unmapped via the io variant. This series corrects this by using
> the appropriate variants.
> 
> Juergen Gross (4):
>   x86: use early_memunmap in arch/x86/kernel/devicetree.c
>   x86: use early_memunmap in arch/x86/kernel/e820.c
>   x86: use early_memunmap in arch/x86/kernel/setup.c
>   x86, efi: use early_ioremap in arch/x86/platform/efi/efi-bgrt.c
> 
>  arch/x86/kernel/devicetree.c     | 4 ++--
>  arch/x86/kernel/e820.c           | 2 +-
>  arch/x86/kernel/setup.c          | 8 ++++----
>  arch/x86/platform/efi/efi-bgrt.c | 4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)

Acked-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Thanks
Dave

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

end of thread, other threads:[~2015-02-26  7:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24  9:13 [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Juergen Gross
2015-02-24  9:13 ` [PATCH 1/4] x86: use early_memunmap in arch/x86/kernel/devicetree.c Juergen Gross
2015-02-24  9:13 ` [PATCH 2/4] x86: use early_memunmap in arch/x86/kernel/e820.c Juergen Gross
2015-02-24  9:13 ` [PATCH 3/4] x86: use early_memunmap in arch/x86/kernel/setup.c Juergen Gross
2015-02-24  9:13 ` [PATCH 4/4] x86, efi: use early_ioremap in arch/x86/platform/efi/efi-bgrt.c Juergen Gross
     [not found] ` <1424769211-11378-1-git-send-email-jgross-IBi9RG/b67k@public.gmane.org>
2015-02-24 19:22   ` [PATCH 0/4] x86: use correct early_[mem,io][re,un]map pairs Matt Fleming
2015-02-26  7:50   ` Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).