From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen: arm: don't release modules which aren't in RAM into the heap Date: Thu, 24 Jul 2014 14:52:44 +0100 Message-ID: <53D10FAC.2020204@linaro.org> References: <0dddfee6c0817bd548ed4f8c69d7032455eec5a9.1406133930.git.ian.campbell@citrix.com> <53D0E2B1.2040708@linaro.org> <1406198666.555.4.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406198666.555.4.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Roy Franz , stefano.stabellini@eu.citrix.com, tim@xen.org, Fu Wei , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 Regards, -- Julien Grall