All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/setup: add paranoid index check and warning
@ 2014-10-14  1:11 Martin Kelly
  2014-10-14  1:19 ` Martin Kelly
  0 siblings, 1 reply; 14+ messages in thread
From: Martin Kelly @ 2014-10-14  1:11 UTC (permalink / raw)
  To: xen-devel, x86
  Cc: Martin Kelly, mingo, david.vrabel, Martin Kelly, boris.ostrovsky,
	tglx

In a call to set_phys_range_identity, i-1 is used without checking that
i is non-zero. Although unlikely, a bug in the code before it could
cause the value to be 0, leading to erroneous behavior. This patch adds
a check against 0 value and a corresponding warning.

Signed-off-by: Martin Kelly <martkell@amazon.com>
---
 arch/x86/xen/setup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index af72161..26e39af 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -671,7 +671,10 @@ char * __init xen_memory_setup(void)
 	 * PFNs above MAX_P2M_PFN are considered identity mapped as
 	 * well.
 	 */
-	set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
+	if (i > 0)
+		set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
+	else
+		WARN(1, "Something went wrong clamping memory to a factor of EXTRA_MEM_RATIO!");
 
 	/*
 	 * In domU, the ISA region is normal, usable memory, but we
-- 
2.1.1

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14  1:11 Martin Kelly
@ 2014-10-14  1:19 ` Martin Kelly
  0 siblings, 0 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14  1:19 UTC (permalink / raw)
  To: xen-devel, x86; +Cc: mingo, david.vrabel, Martin Kelly, boris.ostrovsky, tglx

On 10/13/2014 06:11 PM, Martin Kelly wrote:
> In a call to set_phys_range_identity, i-1 is used without checking that
> i is non-zero. Although unlikely, a bug in the code before it could
> cause the value to be 0, leading to erroneous behavior. This patch adds
> a check against 0 value and a corresponding warning.
> 
> Signed-off-by: Martin Kelly <martkell@amazon.com>
> ---
>  arch/x86/xen/setup.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index af72161..26e39af 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -671,7 +671,10 @@ char * __init xen_memory_setup(void)
>  	 * PFNs above MAX_P2M_PFN are considered identity mapped as
>  	 * well.
>  	 */
> -	set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
> +	if (i > 0)
> +		set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
> +	else
> +		WARN(1, "Something went wrong clamping memory to a factor of EXTRA_MEM_RATIO!");
>  
>  	/*
>  	 * In domU, the ISA region is normal, usable memory, but we
> 

Forgot to add linux-kernel@vger.kernel.org; resending.

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

* [PATCH] xen/setup: add paranoid index check and warning
@ 2014-10-14  1:19 Martin Kelly
  2014-10-14  9:22 ` David Vrabel
  2014-10-14  9:22 ` David Vrabel
  0 siblings, 2 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14  1:19 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: konrad.wilk, boris.ostrovsky, david.vrabel, tglx, mingo,
	Martin Kelly, Martin Kelly

In a call to set_phys_range_identity, i-1 is used without checking that
i is non-zero. Although unlikely, a bug in the code before it could
cause the value to be 0, leading to erroneous behavior. This patch adds
a check against 0 value and a corresponding warning.

Signed-off-by: Martin Kelly <martkell@amazon.com>
---
 arch/x86/xen/setup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index af72161..26e39af 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -671,7 +671,10 @@ char * __init xen_memory_setup(void)
 	 * PFNs above MAX_P2M_PFN are considered identity mapped as
 	 * well.
 	 */
-	set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
+	if (i > 0)
+		set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
+	else
+		WARN(1, "Something went wrong clamping memory to a factor of EXTRA_MEM_RATIO!");
 
 	/*
 	 * In domU, the ISA region is normal, usable memory, but we
-- 
2.1.1


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

* [PATCH] xen/setup: add paranoid index check and warning
@ 2014-10-14  1:19 Martin Kelly
  0 siblings, 0 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14  1:19 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: Martin Kelly, mingo, david.vrabel, Martin Kelly, boris.ostrovsky,
	tglx

In a call to set_phys_range_identity, i-1 is used without checking that
i is non-zero. Although unlikely, a bug in the code before it could
cause the value to be 0, leading to erroneous behavior. This patch adds
a check against 0 value and a corresponding warning.

Signed-off-by: Martin Kelly <martkell@amazon.com>
---
 arch/x86/xen/setup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index af72161..26e39af 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -671,7 +671,10 @@ char * __init xen_memory_setup(void)
 	 * PFNs above MAX_P2M_PFN are considered identity mapped as
 	 * well.
 	 */
-	set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
+	if (i > 0)
+		set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
+	else
+		WARN(1, "Something went wrong clamping memory to a factor of EXTRA_MEM_RATIO!");
 
 	/*
 	 * In domU, the ISA region is normal, usable memory, but we
-- 
2.1.1

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14  1:19 [PATCH] xen/setup: add paranoid index check and warning Martin Kelly
@ 2014-10-14  9:22 ` David Vrabel
  2014-10-14 14:04   ` Martin Kelly
  2014-10-14 14:04   ` Martin Kelly
  2014-10-14  9:22 ` David Vrabel
  1 sibling, 2 replies; 14+ messages in thread
From: David Vrabel @ 2014-10-14  9:22 UTC (permalink / raw)
  To: Martin Kelly, xen-devel, x86, linux-kernel
  Cc: konrad.wilk, boris.ostrovsky, tglx, mingo, Martin Kelly

On 14/10/14 02:19, Martin Kelly wrote:
> In a call to set_phys_range_identity, i-1 is used without checking that
> i is non-zero. Although unlikely, a bug in the code before it could
> cause the value to be 0, leading to erroneous behavior. This patch adds
> a check against 0 value and a corresponding warning.

This can only happen if the toolstack supplies a memory map with zero
entries.  I could see justification for adding a panic at the top of
this function in this case, but I can't see the usefulness of this warning.

> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -671,7 +671,10 @@ char * __init xen_memory_setup(void)
>  	 * PFNs above MAX_P2M_PFN are considered identity mapped as
>  	 * well.
>  	 */
> -	set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
> +	if (i > 0)
> +		set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
> +	else
> +		WARN(1, "Something went wrong clamping memory to a factor of EXTRA_MEM_RATIO!");
>  
>  	/*
>  	 * In domU, the ISA region is normal, usable memory, but we
> 


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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14  1:19 [PATCH] xen/setup: add paranoid index check and warning Martin Kelly
  2014-10-14  9:22 ` David Vrabel
@ 2014-10-14  9:22 ` David Vrabel
  1 sibling, 0 replies; 14+ messages in thread
From: David Vrabel @ 2014-10-14  9:22 UTC (permalink / raw)
  To: Martin Kelly, xen-devel, x86, linux-kernel
  Cc: boris.ostrovsky, mingo, tglx, Martin Kelly

On 14/10/14 02:19, Martin Kelly wrote:
> In a call to set_phys_range_identity, i-1 is used without checking that
> i is non-zero. Although unlikely, a bug in the code before it could
> cause the value to be 0, leading to erroneous behavior. This patch adds
> a check against 0 value and a corresponding warning.

This can only happen if the toolstack supplies a memory map with zero
entries.  I could see justification for adding a panic at the top of
this function in this case, but I can't see the usefulness of this warning.

> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -671,7 +671,10 @@ char * __init xen_memory_setup(void)
>  	 * PFNs above MAX_P2M_PFN are considered identity mapped as
>  	 * well.
>  	 */
> -	set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
> +	if (i > 0)
> +		set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
> +	else
> +		WARN(1, "Something went wrong clamping memory to a factor of EXTRA_MEM_RATIO!");
>  
>  	/*
>  	 * In domU, the ISA region is normal, usable memory, but we
> 

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14  9:22 ` David Vrabel
  2014-10-14 14:04   ` Martin Kelly
@ 2014-10-14 14:04   ` Martin Kelly
  2014-10-14 16:09     ` David Vrabel
  2014-10-14 16:09     ` David Vrabel
  1 sibling, 2 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14 14:04 UTC (permalink / raw)
  To: David Vrabel, xen-devel, x86, linux-kernel
  Cc: konrad.wilk, boris.ostrovsky, tglx, mingo, Martin Kelly

On 10/14/2014 02:22 AM, David Vrabel wrote:
> On 14/10/14 02:19, Martin Kelly wrote:
>> In a call to set_phys_range_identity, i-1 is used without checking that
>> i is non-zero. Although unlikely, a bug in the code before it could
>> cause the value to be 0, leading to erroneous behavior. This patch adds
>> a check against 0 value and a corresponding warning.
> 
> This can only happen if the toolstack supplies a memory map with zero
> entries.  I could see justification for adding a panic at the top of
> this function in this case, but I can't see the usefulness of this warning.
> 

Yes, a panic is probably appropriate. What do you think about the relative merits of panicing in the callers vs. in the sanitize_e820_map function itself (thus to avoid a bunch of similar error checks in the callers)?

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14  9:22 ` David Vrabel
@ 2014-10-14 14:04   ` Martin Kelly
  2014-10-14 14:04   ` Martin Kelly
  1 sibling, 0 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14 14:04 UTC (permalink / raw)
  To: David Vrabel, xen-devel, x86, linux-kernel
  Cc: boris.ostrovsky, mingo, tglx, Martin Kelly

On 10/14/2014 02:22 AM, David Vrabel wrote:
> On 14/10/14 02:19, Martin Kelly wrote:
>> In a call to set_phys_range_identity, i-1 is used without checking that
>> i is non-zero. Although unlikely, a bug in the code before it could
>> cause the value to be 0, leading to erroneous behavior. This patch adds
>> a check against 0 value and a corresponding warning.
> 
> This can only happen if the toolstack supplies a memory map with zero
> entries.  I could see justification for adding a panic at the top of
> this function in this case, but I can't see the usefulness of this warning.
> 

Yes, a panic is probably appropriate. What do you think about the relative merits of panicing in the callers vs. in the sanitize_e820_map function itself (thus to avoid a bunch of similar error checks in the callers)?

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14 14:04   ` Martin Kelly
@ 2014-10-14 16:09     ` David Vrabel
  2014-10-14 16:28       ` Martin Kelly
  2014-10-14 16:28       ` Martin Kelly
  2014-10-14 16:09     ` David Vrabel
  1 sibling, 2 replies; 14+ messages in thread
From: David Vrabel @ 2014-10-14 16:09 UTC (permalink / raw)
  To: Martin Kelly, xen-devel, x86, linux-kernel
  Cc: konrad.wilk, boris.ostrovsky, tglx, mingo, Martin Kelly

On 14/10/14 15:04, Martin Kelly wrote:
> On 10/14/2014 02:22 AM, David Vrabel wrote:
>> On 14/10/14 02:19, Martin Kelly wrote:
>>> In a call to set_phys_range_identity, i-1 is used without checking that
>>> i is non-zero. Although unlikely, a bug in the code before it could
>>> cause the value to be 0, leading to erroneous behavior. This patch adds
>>> a check against 0 value and a corresponding warning.
>>
>> This can only happen if the toolstack supplies a memory map with zero
>> entries.  I could see justification for adding a panic at the top of
>> this function in this case, but I can't see the usefulness of this warning.
>>
> 
> Yes, a panic is probably appropriate. What do you think about the
> relative merits of panicing in the callers vs. in the
> sanitize_e820_map function itself (thus to avoid a bunch of similar
> error checks in the callers)?

For Xen, it should panic immediately after getting the memory map.

You will note that there is fallback code for the case when no memory
map is provided.  But I do not think this should be used in the case
where the toolstack provided an empty memory map.

David

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14 14:04   ` Martin Kelly
  2014-10-14 16:09     ` David Vrabel
@ 2014-10-14 16:09     ` David Vrabel
  1 sibling, 0 replies; 14+ messages in thread
From: David Vrabel @ 2014-10-14 16:09 UTC (permalink / raw)
  To: Martin Kelly, xen-devel, x86, linux-kernel
  Cc: boris.ostrovsky, mingo, tglx, Martin Kelly

On 14/10/14 15:04, Martin Kelly wrote:
> On 10/14/2014 02:22 AM, David Vrabel wrote:
>> On 14/10/14 02:19, Martin Kelly wrote:
>>> In a call to set_phys_range_identity, i-1 is used without checking that
>>> i is non-zero. Although unlikely, a bug in the code before it could
>>> cause the value to be 0, leading to erroneous behavior. This patch adds
>>> a check against 0 value and a corresponding warning.
>>
>> This can only happen if the toolstack supplies a memory map with zero
>> entries.  I could see justification for adding a panic at the top of
>> this function in this case, but I can't see the usefulness of this warning.
>>
> 
> Yes, a panic is probably appropriate. What do you think about the
> relative merits of panicing in the callers vs. in the
> sanitize_e820_map function itself (thus to avoid a bunch of similar
> error checks in the callers)?

For Xen, it should panic immediately after getting the memory map.

You will note that there is fallback code for the case when no memory
map is provided.  But I do not think this should be used in the case
where the toolstack provided an empty memory map.

David

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14 16:09     ` David Vrabel
  2014-10-14 16:28       ` Martin Kelly
@ 2014-10-14 16:28       ` Martin Kelly
  2014-10-17  3:49         ` Martin Kelly
  2014-10-17  3:49         ` Martin Kelly
  1 sibling, 2 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14 16:28 UTC (permalink / raw)
  To: David Vrabel
  Cc: xen-devel, x86, linux-kernel, konrad.wilk, boris.ostrovsky, tglx,
	mingo, Martin Kelly

On Tue, Oct 14, 2014 at 9:09 AM, David Vrabel <david.vrabel@citrix.com> wrote:
> On 14/10/14 15:04, Martin Kelly wrote:
>> On 10/14/2014 02:22 AM, David Vrabel wrote:
>>> On 14/10/14 02:19, Martin Kelly wrote:
>>>> In a call to set_phys_range_identity, i-1 is used without checking that
>>>> i is non-zero. Although unlikely, a bug in the code before it could
>>>> cause the value to be 0, leading to erroneous behavior. This patch adds
>>>> a check against 0 value and a corresponding warning.
>>>
>>> This can only happen if the toolstack supplies a memory map with zero
>>> entries.  I could see justification for adding a panic at the top of
>>> this function in this case, but I can't see the usefulness of this warning.
>>>
>>
>> Yes, a panic is probably appropriate. What do you think about the
>> relative merits of panicing in the callers vs. in the
>> sanitize_e820_map function itself (thus to avoid a bunch of similar
>> error checks in the callers)?
>
> For Xen, it should panic immediately after getting the memory map.
>
> You will note that there is fallback code for the case when no memory
> map is provided.  But I do not think this should be used in the case
> where the toolstack provided an empty memory map.
>
> David

Sounds like the flow should be as follows:
1) Ask Xen for the memory map.
2) If no memory map is provided, use fallback code.
3) If the memory map has 0 entries, panic.

I will revise the patch to do that.

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14 16:09     ` David Vrabel
@ 2014-10-14 16:28       ` Martin Kelly
  2014-10-14 16:28       ` Martin Kelly
  1 sibling, 0 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-14 16:28 UTC (permalink / raw)
  To: David Vrabel
  Cc: x86, linux-kernel, mingo, Martin Kelly, xen-devel,
	boris.ostrovsky, tglx

On Tue, Oct 14, 2014 at 9:09 AM, David Vrabel <david.vrabel@citrix.com> wrote:
> On 14/10/14 15:04, Martin Kelly wrote:
>> On 10/14/2014 02:22 AM, David Vrabel wrote:
>>> On 14/10/14 02:19, Martin Kelly wrote:
>>>> In a call to set_phys_range_identity, i-1 is used without checking that
>>>> i is non-zero. Although unlikely, a bug in the code before it could
>>>> cause the value to be 0, leading to erroneous behavior. This patch adds
>>>> a check against 0 value and a corresponding warning.
>>>
>>> This can only happen if the toolstack supplies a memory map with zero
>>> entries.  I could see justification for adding a panic at the top of
>>> this function in this case, but I can't see the usefulness of this warning.
>>>
>>
>> Yes, a panic is probably appropriate. What do you think about the
>> relative merits of panicing in the callers vs. in the
>> sanitize_e820_map function itself (thus to avoid a bunch of similar
>> error checks in the callers)?
>
> For Xen, it should panic immediately after getting the memory map.
>
> You will note that there is fallback code for the case when no memory
> map is provided.  But I do not think this should be used in the case
> where the toolstack provided an empty memory map.
>
> David

Sounds like the flow should be as follows:
1) Ask Xen for the memory map.
2) If no memory map is provided, use fallback code.
3) If the memory map has 0 entries, panic.

I will revise the patch to do that.

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14 16:28       ` Martin Kelly
  2014-10-17  3:49         ` Martin Kelly
@ 2014-10-17  3:49         ` Martin Kelly
  1 sibling, 0 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-17  3:49 UTC (permalink / raw)
  To: David Vrabel
  Cc: xen-devel, x86, linux-kernel, konrad.wilk, boris.ostrovsky, tglx,
	mingo, Martin Kelly

On 10/14/2014 09:28 AM, Martin Kelly wrote:
> On Tue, Oct 14, 2014 at 9:09 AM, David Vrabel <david.vrabel@citrix.com> wrote:
>> On 14/10/14 15:04, Martin Kelly wrote:
>>> On 10/14/2014 02:22 AM, David Vrabel wrote:
>>>> On 14/10/14 02:19, Martin Kelly wrote:
>>>>> In a call to set_phys_range_identity, i-1 is used without checking that
>>>>> i is non-zero. Although unlikely, a bug in the code before it could
>>>>> cause the value to be 0, leading to erroneous behavior. This patch adds
>>>>> a check against 0 value and a corresponding warning.
>>>>
>>>> This can only happen if the toolstack supplies a memory map with zero
>>>> entries.  I could see justification for adding a panic at the top of
>>>> this function in this case, but I can't see the usefulness of this warning.
>>>>
>>>
>>> Yes, a panic is probably appropriate. What do you think about the
>>> relative merits of panicing in the callers vs. in the
>>> sanitize_e820_map function itself (thus to avoid a bunch of similar
>>> error checks in the callers)?
>>
>> For Xen, it should panic immediately after getting the memory map.
>>
>> You will note that there is fallback code for the case when no memory
>> map is provided.  But I do not think this should be used in the case
>> where the toolstack provided an empty memory map.
>>
>> David
> 
> Sounds like the flow should be as follows:
> 1) Ask Xen for the memory map.
> 2) If no memory map is provided, use fallback code.
> 3) If the memory map has 0 entries, panic.
> 
> I will revise the patch to do that.
> 

I have sent a revision adding the panic:
"[PATCH] x86/xen: panic on bad Xen-provided memory map"

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

* Re: [PATCH] xen/setup: add paranoid index check and warning
  2014-10-14 16:28       ` Martin Kelly
@ 2014-10-17  3:49         ` Martin Kelly
  2014-10-17  3:49         ` Martin Kelly
  1 sibling, 0 replies; 14+ messages in thread
From: Martin Kelly @ 2014-10-17  3:49 UTC (permalink / raw)
  To: David Vrabel
  Cc: x86, linux-kernel, mingo, Martin Kelly, xen-devel,
	boris.ostrovsky, tglx

On 10/14/2014 09:28 AM, Martin Kelly wrote:
> On Tue, Oct 14, 2014 at 9:09 AM, David Vrabel <david.vrabel@citrix.com> wrote:
>> On 14/10/14 15:04, Martin Kelly wrote:
>>> On 10/14/2014 02:22 AM, David Vrabel wrote:
>>>> On 14/10/14 02:19, Martin Kelly wrote:
>>>>> In a call to set_phys_range_identity, i-1 is used without checking that
>>>>> i is non-zero. Although unlikely, a bug in the code before it could
>>>>> cause the value to be 0, leading to erroneous behavior. This patch adds
>>>>> a check against 0 value and a corresponding warning.
>>>>
>>>> This can only happen if the toolstack supplies a memory map with zero
>>>> entries.  I could see justification for adding a panic at the top of
>>>> this function in this case, but I can't see the usefulness of this warning.
>>>>
>>>
>>> Yes, a panic is probably appropriate. What do you think about the
>>> relative merits of panicing in the callers vs. in the
>>> sanitize_e820_map function itself (thus to avoid a bunch of similar
>>> error checks in the callers)?
>>
>> For Xen, it should panic immediately after getting the memory map.
>>
>> You will note that there is fallback code for the case when no memory
>> map is provided.  But I do not think this should be used in the case
>> where the toolstack provided an empty memory map.
>>
>> David
> 
> Sounds like the flow should be as follows:
> 1) Ask Xen for the memory map.
> 2) If no memory map is provided, use fallback code.
> 3) If the memory map has 0 entries, panic.
> 
> I will revise the patch to do that.
> 

I have sent a revision adding the panic:
"[PATCH] x86/xen: panic on bad Xen-provided memory map"

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

end of thread, other threads:[~2014-10-17  3:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-14  1:19 [PATCH] xen/setup: add paranoid index check and warning Martin Kelly
2014-10-14  9:22 ` David Vrabel
2014-10-14 14:04   ` Martin Kelly
2014-10-14 14:04   ` Martin Kelly
2014-10-14 16:09     ` David Vrabel
2014-10-14 16:28       ` Martin Kelly
2014-10-14 16:28       ` Martin Kelly
2014-10-17  3:49         ` Martin Kelly
2014-10-17  3:49         ` Martin Kelly
2014-10-14 16:09     ` David Vrabel
2014-10-14  9:22 ` David Vrabel
  -- strict thread matches above, loose matches on Subject: below --
2014-10-14  1:19 Martin Kelly
2014-10-14  1:11 Martin Kelly
2014-10-14  1:19 ` Martin Kelly

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.