All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen/setup: Don't relocate p2m over existing one
@ 2016-12-12 14:35 Ross Lagerwall
  2016-12-12 15:01 ` Juergen Gross
  2016-12-22  9:06 ` Juergen Gross
  0 siblings, 2 replies; 3+ messages in thread
From: Ross Lagerwall @ 2016-12-12 14:35 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Ross Lagerwall, Boris Ostrovsky, David Vrabel

When relocating the p2m, take special care not to relocate it so
that is overlaps with the current location of the p2m/initrd. This is
needed since the full extent of the current location is not marked as a
reserved region in the e820.

This was seen to happen to a dom0 with a large initial p2m and a small
reserved region in the middle of the initial p2m.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 arch/x86/xen/setup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index f8960fc..9f21b0c 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
 		size = PFN_PHYS(xen_start_info->nr_p2m_frames);
 	}
 
-	if (!xen_is_e820_reserved(start, size)) {
-		memblock_reserve(start, size);
+	memblock_reserve(start, size);
+	if (!xen_is_e820_reserved(start, size))
 		return;
-	}
 
 #ifdef CONFIG_X86_32
 	/*
@@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
 	BUG();
 #else
 	xen_relocate_p2m();
+	memblock_free(start, size);
 #endif
 }
 
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH v2] xen/setup: Don't relocate p2m over existing one
  2016-12-12 14:35 [PATCH v2] xen/setup: Don't relocate p2m over existing one Ross Lagerwall
@ 2016-12-12 15:01 ` Juergen Gross
  2016-12-22  9:06 ` Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2016-12-12 15:01 UTC (permalink / raw)
  To: Ross Lagerwall, xen-devel; +Cc: Boris Ostrovsky, David Vrabel

On 12/12/16 15:35, Ross Lagerwall wrote:
> When relocating the p2m, take special care not to relocate it so
> that is overlaps with the current location of the p2m/initrd. This is
> needed since the full extent of the current location is not marked as a
> reserved region in the e820.
> 
> This was seen to happen to a dom0 with a large initial p2m and a small
> reserved region in the middle of the initial p2m.
> 
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

> ---
>  arch/x86/xen/setup.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index f8960fc..9f21b0c 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
>  		size = PFN_PHYS(xen_start_info->nr_p2m_frames);
>  	}
>  
> -	if (!xen_is_e820_reserved(start, size)) {
> -		memblock_reserve(start, size);
> +	memblock_reserve(start, size);
> +	if (!xen_is_e820_reserved(start, size))
>  		return;
> -	}
>  
>  #ifdef CONFIG_X86_32
>  	/*
> @@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
>  	BUG();
>  #else
>  	xen_relocate_p2m();
> +	memblock_free(start, size);
>  #endif
>  }
>  
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH v2] xen/setup: Don't relocate p2m over existing one
  2016-12-12 14:35 [PATCH v2] xen/setup: Don't relocate p2m over existing one Ross Lagerwall
  2016-12-12 15:01 ` Juergen Gross
@ 2016-12-22  9:06 ` Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2016-12-22  9:06 UTC (permalink / raw)
  To: Ross Lagerwall, xen-devel; +Cc: Boris Ostrovsky, David Vrabel

On 12/12/16 15:35, Ross Lagerwall wrote:
> When relocating the p2m, take special care not to relocate it so
> that is overlaps with the current location of the p2m/initrd. This is
> needed since the full extent of the current location is not marked as a
> reserved region in the e820.
> 
> This was seen to happen to a dom0 with a large initial p2m and a small
> reserved region in the middle of the initial p2m.
> 
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>

Committed to xen/tip.git for-linus-4.10


Juergen

> ---
>  arch/x86/xen/setup.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index f8960fc..9f21b0c 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
>  		size = PFN_PHYS(xen_start_info->nr_p2m_frames);
>  	}
>  
> -	if (!xen_is_e820_reserved(start, size)) {
> -		memblock_reserve(start, size);
> +	memblock_reserve(start, size);
> +	if (!xen_is_e820_reserved(start, size))
>  		return;
> -	}
>  
>  #ifdef CONFIG_X86_32
>  	/*
> @@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
>  	BUG();
>  #else
>  	xen_relocate_p2m();
> +	memblock_free(start, size);
>  #endif
>  }
>  
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-12-22  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-12 14:35 [PATCH v2] xen/setup: Don't relocate p2m over existing one Ross Lagerwall
2016-12-12 15:01 ` Juergen Gross
2016-12-22  9:06 ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.