[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/arm: add warning if memory modules overlap



Hi,

On 10/11/19 7:06 PM, Brian Woods wrote:
On Fri, Oct 11, 2019 at 05:58:35PM +0100, Julien Grall wrote:
For that, you'd need to either check the start and end of the added
module or the start of both.  So something like:

if ( ((mod->start >= start) && (mod->start < (start + size))) ||
      ((start >= mod->start) && (start < (mod->start + mod->size))) )
     printk("WARNING: ...");

If you don't you run the risk of having a module overlap but not at the
start of the added module (unless there's a guaranteed order).  You're
still running all of the checks from what I can tell, just not in nested
for loop so. Plus I'm not sure how many times add_boot_module gets run
and the "mod->kind == kind .." if statement gets run and is true.
If the above is true, wouldn't that cause extra checks for the for loop
iterations before it was true?

For non-dom0less case, we are talking about 4 modules max (Xen, Kernel, Initramfs, flask policy). Modules cannot be the shared here.

For dom0less, you are unlikely to have that many domains started from Xen. So the number of modules will still be limited (even more if you share it).

This code is also only called at boot where there are bigger time consuming part (such as domheap initialization). So I would be surprised if you see any improvement (other than a couple of cycles) in boot time here.

Therefore, I would favor a readable solution over a micro-optimized solution here.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.