All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
@ 2014-07-23 16:45 Ian Campbell
  2014-07-23 16:48 ` Roy Franz
  2014-07-24 10:40 ` Julien Grall
  0 siblings, 2 replies; 9+ messages in thread
From: Ian Campbell @ 2014-07-23 16:45 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, stefano.stabellini, julien.grall, tim, Roy Franz, Fu Wei

They might be in e.g. flash or something but more likely they could
bein a bank of RAM which we aren't handling or in RAM which the
bootloader hasn't told us about for some reason.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Fu Wei <fu.wei@linaro.org>
Cc: Roy Franz <roy.franz@linaro.org>
---
 xen/arch/arm/setup.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index e53e491..446b4dc 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -247,8 +247,13 @@ void __init discard_initial_modules(void)
         paddr_t s = mi->module[i].start;
         paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
 
-        if ( mi->module[i].kind != BOOTMOD_XEN )
-            dt_unreserved_regions(s, e, init_domheap_pages, 0);
+        if ( mi->module[i].kind == BOOTMOD_XEN )
+            continue;
+
+        if ( !mfn_valid(paddr_to_pfn(s)) || !mfn_valid(paddr_to_pfn(e)))
+            continue;
+
+        dt_unreserved_regions(s, e, init_domheap_pages, 0);
     }
 
     mi->nr_mods = 0;
-- 
1.7.10.4

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-07-23 16:45 [PATCH] xen: arm: don't release modules which aren't in RAM into the heap Ian Campbell
@ 2014-07-23 16:48 ` Roy Franz
  2014-07-24 10:40 ` Julien Grall
  1 sibling, 0 replies; 9+ messages in thread
From: Roy Franz @ 2014-07-23 16:48 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Stefano Stabellini, tim, Fu Wei, Julien Grall, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1434 bytes --]

On Wed, Jul 23, 2014 at 9:45 AM, Ian Campbell <ian.campbell@citrix.com>
wrote:

> They might be in e.g. flash or something but more likely they could
> bein a bank of RAM which we aren't handling or in RAM which the
> bootloader hasn't told us about for some reason.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Fu Wei <fu.wei@linaro.org>
> Cc: Roy Franz <roy.franz@linaro.org>
> ---
>  xen/arch/arm/setup.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index e53e491..446b4dc 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -247,8 +247,13 @@ void __init discard_initial_modules(void)
>          paddr_t s = mi->module[i].start;
>          paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
>
> -        if ( mi->module[i].kind != BOOTMOD_XEN )
> -            dt_unreserved_regions(s, e, init_domheap_pages, 0);
> +        if ( mi->module[i].kind == BOOTMOD_XEN )
> +            continue;
> +
> +        if ( !mfn_valid(paddr_to_pfn(s)) || !mfn_valid(paddr_to_pfn(e)))
> +            continue;
> +
> +        dt_unreserved_regions(s, e, init_domheap_pages, 0);
>      }
>
>      mi->nr_mods = 0;


This looks good - I'll give it a spin.  I think this will be sufficient to
allow the stub (or GRUB) to use any available EFI memory for loading modules
without worrying about whether XEN will map it.

Thanks,
Roy

[-- Attachment #1.2: Type: text/html, Size: 2127 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-07-23 16:45 [PATCH] xen: arm: don't release modules which aren't in RAM into the heap Ian Campbell
  2014-07-23 16:48 ` Roy Franz
@ 2014-07-24 10:40 ` Julien Grall
  2014-07-24 10:44   ` Ian Campbell
  2014-07-24 15:54   ` Ian Campbell
  1 sibling, 2 replies; 9+ messages in thread
From: Julien Grall @ 2014-07-24 10:40 UTC (permalink / raw)
  To: Ian Campbell, xen-devel; +Cc: Roy Franz, tim, Fu Wei, stefano.stabellini

Hi Ian,

On 23/07/14 17:45, Ian Campbell wrote:
> They might be in e.g. flash or something but more likely they could
> bein a bank of RAM which we aren't handling or in RAM which the

being?

> bootloader hasn't told us about for some reason.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Fu Wei <fu.wei@linaro.org>
> Cc: Roy Franz <roy.franz@linaro.org>
> ---
>   xen/arch/arm/setup.c |    9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index e53e491..446b4dc 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -247,8 +247,13 @@ void __init discard_initial_modules(void)
>           paddr_t s = mi->module[i].start;
>           paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
>
> -        if ( mi->module[i].kind != BOOTMOD_XEN )
> -            dt_unreserved_regions(s, e, init_domheap_pages, 0);
> +        if ( mi->module[i].kind == BOOTMOD_XEN )
> +            continue;
> +
> +        if ( !mfn_valid(paddr_to_pfn(s)) || !mfn_valid(paddr_to_pfn(e)))
> +            continue;

What happen if the bootloader decide to put the module between 2 banks 
and having the hole in the middle. Such as:

start of the module

end of bank 0

hole

start of bank 1

end of the module

Regards,

-- 
Julien Grall

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-07-24 10:40 ` Julien Grall
@ 2014-07-24 10:44   ` Ian Campbell
  2014-07-24 13:52     ` Julien Grall
  2014-07-24 15:54   ` Ian Campbell
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Campbell @ 2014-07-24 10:44 UTC (permalink / raw)
  To: Julien Grall; +Cc: Roy Franz, stefano.stabellini, tim, Fu Wei, xen-devel

On Thu, 2014-07-24 at 11:40 +0100, Julien Grall wrote:
> > -        if ( mi->module[i].kind != BOOTMOD_XEN )
> > -            dt_unreserved_regions(s, e, init_domheap_pages, 0);
> > +        if ( mi->module[i].kind == BOOTMOD_XEN )
> > +            continue;
> > +
> > +        if ( !mfn_valid(paddr_to_pfn(s)) || !mfn_valid(paddr_to_pfn(e)))
> > +            continue;
> 
> What happen if the bootloader decide to put the module between 2 banks 
> and having the hole in the middle. Such as:
> 
> start of the module
> 
> end of bank 0
> 
> hole
> 
> start of bank 1
> 
> end of the module

Either we will ignore bank 1, in which case these checks will prevent us
adding them to the heap or the frame table will span bank0..1 and
include the hole.

We don't really handle the latter case very well, but the first one is
the one which is actually biting people today.

Ian.

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-07-24 10:44   ` Ian Campbell
@ 2014-07-24 13:52     ` Julien Grall
  0 siblings, 0 replies; 9+ messages in thread
From: Julien Grall @ 2014-07-24 13:52 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Roy Franz, stefano.stabellini, tim, Fu Wei, xen-devel

Hi Ian,

On 07/24/2014 11:44 AM, Ian Campbell wrote:
> On Thu, 2014-07-24 at 11:40 +0100, Julien Grall wrote:
>>> -        if ( mi->module[i].kind != BOOTMOD_XEN )
>>> -            dt_unreserved_regions(s, e, init_domheap_pages, 0);
>>> +        if ( mi->module[i].kind == BOOTMOD_XEN )
>>> +            continue;
>>> +
>>> +        if ( !mfn_valid(paddr_to_pfn(s)) || !mfn_valid(paddr_to_pfn(e)))
>>> +            continue;
>>
>> What happen if the bootloader decide to put the module between 2 banks 
>> and having the hole in the middle. Such as:
>>
>> start of the module
>>
>> end of bank 0
>>
>> hole
>>
>> start of bank 1
>>
>> end of the module
> 
> Either we will ignore bank 1, in which case these checks will prevent us
> adding them to the heap or the frame table will span bank0..1 and
> include the hole.
> 
> We don't really handle the latter case very well, but the first one is
> the one which is actually biting people today.

Thanks for the explanation. It might be worse to add a TODO to help the
person who will support sparse frame table.

Anyway:

Acked-by: Julien Grall <julien.grall@linaro.org>

Regards,

-- 
Julien Grall

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-07-24 10:40 ` Julien Grall
  2014-07-24 10:44   ` Ian Campbell
@ 2014-07-24 15:54   ` Ian Campbell
  2014-08-05  0:16     ` Roy Franz
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Campbell @ 2014-07-24 15:54 UTC (permalink / raw)
  To: Julien Grall; +Cc: Roy Franz, stefano.stabellini, tim, Fu Wei, xen-devel


On Thu, 2014-07-24 at 11:40 +0100, Julien Grall wrote:
> Hi Ian,
> 
> On 23/07/14 17:45, Ian Campbell wrote:
> > They might be in e.g. flash or something but more likely they could
> > bein a bank of RAM which we aren't handling or in RAM which the
> 
> being?

"be in". Oops!

I've made a note for myself about the sparseness thing (since I hope to
work on that soon) and applied with your Ack.

Ian.

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-07-24 15:54   ` Ian Campbell
@ 2014-08-05  0:16     ` Roy Franz
  2014-08-06  3:07       ` Roy Franz
  0 siblings, 1 reply; 9+ messages in thread
From: Roy Franz @ 2014-08-05  0:16 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Julien Grall, tim, Fu Wei, Stefano Stabellini, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 680 bytes --]

On Thu, Jul 24, 2014 at 8:54 AM, Ian Campbell <Ian.Campbell@citrix.com>
wrote:

>
> On Thu, 2014-07-24 at 11:40 +0100, Julien Grall wrote:
> > Hi Ian,
> >
> > On 23/07/14 17:45, Ian Campbell wrote:
> > > They might be in e.g. flash or something but more likely they could
> > > bein a bank of RAM which we aren't handling or in RAM which the
> >
> > being?
>
> "be in". Oops!
>
> I've made a note for myself about the sparseness thing (since I hope to
> work on that soon) and applied with your Ack.
>
> Ian.
>
>
>
>
>
Thanks Ian - this should allow me to simplify the allocation of buffers for
the modules.
I just got back from vacation today, so I'll give this a try soon.

Roy

[-- Attachment #1.2: Type: text/html, Size: 1320 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-08-05  0:16     ` Roy Franz
@ 2014-08-06  3:07       ` Roy Franz
  2014-08-06  9:37         ` Stefano Stabellini
  0 siblings, 1 reply; 9+ messages in thread
From: Roy Franz @ 2014-08-06  3:07 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Julien Grall, tim, Fu Wei, Stefano Stabellini, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 992 bytes --]

On Mon, Aug 4, 2014 at 5:16 PM, Roy Franz <roy.franz@linaro.org> wrote:

> On Thu, Jul 24, 2014 at 8:54 AM, Ian Campbell <Ian.Campbell@citrix.com>
> wrote:
>
>>
>> On Thu, 2014-07-24 at 11:40 +0100, Julien Grall wrote:
>> > Hi Ian,
>> >
>> > On 23/07/14 17:45, Ian Campbell wrote:
>> > > They might be in e.g. flash or something but more likely they could
>> > > bein a bank of RAM which we aren't handling or in RAM which the
>> >
>> > being?
>>
>> "be in". Oops!
>>
>> I've made a note for myself about the sparseness thing (since I hope to
>> work on that soon) and applied with your Ack.
>>
>> Ian.
>>
>>
>>
>>
>>
> Thanks Ian - this should allow me to simplify the allocation of buffers
> for the modules.
> I just got back from vacation today, so I'll give this a try soon.
>
> Roy
>
> This works and resolves the issue of the EFI stub trying to put modules
into RAM that XEN will later
use.  I'll remove the max address stuff I put in to deal with this in my
next series.

Thanks,
Roy

[-- Attachment #1.2: Type: text/html, Size: 2143 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap
  2014-08-06  3:07       ` Roy Franz
@ 2014-08-06  9:37         ` Stefano Stabellini
  0 siblings, 0 replies; 9+ messages in thread
From: Stefano Stabellini @ 2014-08-06  9:37 UTC (permalink / raw)
  To: Roy Franz
  Cc: Ian Campbell, Stefano Stabellini, Julien Grall, tim, xen-devel, Fu Wei

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

Roy,
could you please use plain text emails? HTML emails are not easy to read
with my MUA.

On Tue, 5 Aug 2014, Roy Franz wrote:
> On Mon, Aug 4, 2014 at 5:16 PM, Roy Franz <roy.franz@linaro.org> wrote:
>       On Thu, Jul 24, 2014 at 8:54 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
>             On Thu, 2014-07-24 at 11:40 +0100, Julien Grall wrote:
> > Hi Ian,
> >
> > On 23/07/14 17:45, Ian Campbell wrote:
> > > They might be in e.g. flash or something but more likely they could
> > > bein a bank of RAM which we aren't handling or in RAM which the
> >
> > being?
> 
> "be in". Oops!
> 
> I've made a note for myself about the sparseness thing (since I hope to
> work on that soon) and applied with your Ack.
> 
> Ian.
> 
> 
> 
> 
> 
> Thanks Ian - this should allow me to simplify the allocation of buffers for the modules.
> I just got back from vacation today, so I'll give this a try soon.
> 
> Roy
> 
> This works and resolves the issue of the EFI stub trying to put modules into RAM that XEN will later
> use.  I'll remove the max address stuff I put in to deal with this in my next series.
> 
> Thanks,
> Roy
> 
> 
> 

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

end of thread, other threads:[~2014-08-06  9:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 16:45 [PATCH] xen: arm: don't release modules which aren't in RAM into the heap Ian Campbell
2014-07-23 16:48 ` Roy Franz
2014-07-24 10:40 ` Julien Grall
2014-07-24 10:44   ` Ian Campbell
2014-07-24 13:52     ` Julien Grall
2014-07-24 15:54   ` Ian Campbell
2014-08-05  0:16     ` Roy Franz
2014-08-06  3:07       ` Roy Franz
2014-08-06  9:37         ` Stefano Stabellini

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.