From: Julien Grall <julien.grall@arm.com>
To: Brian Woods <brian.woods@xilinx.com>
Cc: xen-devel@lists.xenproject.org,
Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: add warning if memory modules overlap
Date: Fri, 11 Oct 2019 19:17:29 +0100 [thread overview]
Message-ID: <a3cf5b20-9a67-f3db-5a0d-1fb672b2bbe3@arm.com> (raw)
In-Reply-To: <20191011180612.GA19987@xilinx.com>
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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-10-11 18:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 19:47 [Xen-devel] [PATCH] xen/arm: add warning if memory modules overlap Brian Woods
2019-10-10 15:39 ` Julien Grall
2019-10-11 16:43 ` Brian Woods
2019-10-11 16:58 ` Julien Grall
2019-10-11 18:06 ` Brian Woods
2019-10-11 18:17 ` Julien Grall [this message]
2019-10-11 19:07 ` Brian Woods
2019-10-17 9:20 ` Julien Grall
2019-10-17 19:48 ` Brian Woods
2019-10-17 20:23 ` Julien Grall
2019-10-17 20:07 ` [Xen-devel] [PATCH v2] " Brian Woods
2019-10-17 20:34 ` Julien Grall
2019-10-17 21:20 ` Brian Woods
2019-10-17 21:49 ` Julien Grall
2019-10-17 22:34 ` Brian Woods
2019-10-18 15:41 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3cf5b20-9a67-f3db-5a0d-1fb672b2bbe3@arm.com \
--to=julien.grall@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=brian.woods@xilinx.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).