From: Geoff Levand <geoff@infradead.org>
To: Sameer Goel <sgoel@codeaurora.org>, kexec@lists.infradead.org
Cc: timur@codeaurora.org, rruigrok@codeaurora.org, shankerd@codeaurora.org
Subject: Re: [PATCH] arm64:kexec: Memstart should not be before the kernel start address
Date: Tue, 26 Apr 2016 16:58:40 -0700 [thread overview]
Message-ID: <1461715120.27026.4.camel@infradead.org> (raw)
In-Reply-To: <1461708860-23034-1-git-send-email-sgoel@codeaurora.org>
Hi,
I already added a patch like this to my series. Is this different?
-Geoff
On Tue, 2016-04-26 at 16:14 -0600, Sameer Goel wrote:
> Starting 4.6-rc4 the kernel memblock start is rounded down to a desirable
> alignment. So, the kernel can see reserved memory regions before the kernel
> start address in the iomem query.
> Need to make sure that the right kernel start address is picked from the iomem
> query.
> ---
> kexec/arch/arm64/kexec-arm64.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
> index 776596a..5e39f4f 100644
> --- a/kexec/arch/arm64/kexec-arm64.c
> +++ b/kexec/arch/arm64/kexec-arm64.c
> @@ -30,6 +30,12 @@
> #include "kexec-syscall.h"
> #include "arch/options.h"
>
> +#define SZ_2M 0x200000
> +
> +#define __round_mask(x, y) ((__typeof__(x))((y)-1))
> +#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
> +#define round_down(x, y) ((x) & ~__round_mask(x, y))
> +
> /* Global varables the core kexec routines expect. */
>
> unsigned char reuse_initrd;
> @@ -944,6 +950,10 @@ static int get_memory_ranges_iomem(struct memory_range *array,
> > > > str = line + consumed;
> > > > r.end++;
>
> +> > > if (memcmp(str, "Kernel code\n", 12)==0) {
> +> > > > set_memstart(round_down(r.start,SZ_2M));
> +> > > }
> +
> > > > if (memcmp(str, "System RAM\n", 11)) {
> > > > > dbgprintf("%s:%d: SKIP: %016Lx - %016Lx : %s", __func__,
> > > > > > __LINE__, r.start, r.end, str);
> @@ -956,8 +966,6 @@ static int get_memory_ranges_iomem(struct memory_range *array,
> > > > > __LINE__, r.start, r.end, str);
>
> > > > array[(*count)++] = r;
> -
> -> > > set_memstart(r.start);
> > > }
>
> > > fclose(fp);
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2016-04-26 23:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 22:14 [PATCH] arm64:kexec: Memstart should not be before the kernel start address Sameer Goel
2016-04-26 23:58 ` Geoff Levand [this message]
2016-05-03 15:12 ` Goel, Sameer
2016-06-10 16:41 ` Geoff Levand
2016-07-29 22:58 ` Goel, Sameer
2016-08-01 19:31 ` Geoff Levand
2016-08-02 1:25 ` AKASHI Takahiro
2016-08-03 23:44 ` Goel, Sameer
2016-08-04 1:16 ` AKASHI Takahiro
2016-08-04 23:15 ` Goel, Sameer
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=1461715120.27026.4.camel@infradead.org \
--to=geoff@infradead.org \
--cc=kexec@lists.infradead.org \
--cc=rruigrok@codeaurora.org \
--cc=sgoel@codeaurora.org \
--cc=shankerd@codeaurora.org \
--cc=timur@codeaurora.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