All of lore.kernel.org
 help / color / mirror / Atom feed
From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v19 03/13] arm64/kexec: Add core kexec support
Date: Mon, 20 Jun 2016 09:49:43 -0700	[thread overview]
Message-ID: <1466441383.7965.15.camel@infradead.org> (raw)
In-Reply-To: <57680D94.6080704@arm.com>

Hi,

On Mon, 2016-06-20 at 16:36 +0100, James Morse wrote:
> +> 	> 	> switch (flag) {
> > +> > 	> > 	> > case IND_INDIRECTION:
> > +> > 	> > 	> > 	> > /* Set entry point just before the new list page. */
> > +> > 	> > 	> > 	> > entry = (kimage_entry_t *)addr - 1;
> 
> Ah, after this restructuring we end up cleaning this page as we fall-through,
> and one kimage_entry_t at a time as we walk the list.
> 
> 	> 	> 	> break;
> ?

I added this in, but that missing break shouldn't cause any problems.


> > +> > 	> > 	> > case IND_SOURCE:
> > +> > 	> > 	> > 	> > __flush_dcache_area(addr, PAGE_SIZE);
> > +> > 	> > 	> > 	> > break;
> > +> > 	> > 	> > case IND_DESTINATION:
> > +> > 	> > 	> > 	> > break;
> > +> > 	> > 	> > default:
> > +> > 	> > 	> > 	> > BUG();
> > +> > 	> > 	> > }
> > +> > 	> > }
> > +}
> 
> 
> > diff --git a/arch/arm64/kernel/relocate_kernel.S b/arch/arm64/kernel/relocate_kernel.S
> > new file mode 100644
> > index 0000000..51b73cd
> > --- /dev/null
> > +++ b/arch/arm64/kernel/relocate_kernel.S
> 
> [ ... ]
> 
> > +.ltorg
> > +
> > +.align 3> > 	> > /* To keep the 64-bit values below naturally aligned. */
> > +
> > +.Lcopy_end:
> > +.org> > 	> > KEXEC_CONTROL_PAGE_SIZE
> 
> 
> On 16/06/16 23:41, Geoff Levand wrote:
> > This is to check if arm64_relocate_new_kernel gets too
> > big.  The assembler should give an error if the location
> > counter is set backwards.
> 
> Cunning. (probably worth a comment).

I thought this was the standard way to do it...

> This looks like it is need because we hard-coded KEXEC_CONTROL_PAGE_SIZE in
> kexec.h, so the code must be smaller than that size.
> It looks like this value is only ever passed to get_order(), could we just pass
> the actual size? It shouldn't matter if it grows >4K, as the core code will
> allocate enough memory, and the memcpy() in machine_kexec() uses the size too.

I thought 4K would be enough, but if some debugging code is
added it could get too big.

> Reviewed-by: James Morse <james.morse@arm.com>

Thanks for your comments.

-Geoff

WARNING: multiple messages have this Message-ID (diff)
From: Geoff Levand <geoff@infradead.org>
To: James Morse <james.morse@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	marc.zyngier@arm.com, Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v19 03/13] arm64/kexec: Add core kexec support
Date: Mon, 20 Jun 2016 09:49:43 -0700	[thread overview]
Message-ID: <1466441383.7965.15.camel@infradead.org> (raw)
In-Reply-To: <57680D94.6080704@arm.com>

Hi,

On Mon, 2016-06-20 at 16:36 +0100, James Morse wrote:
> +> 	> 	> switch (flag) {
> > +> > 	> > 	> > case IND_INDIRECTION:
> > +> > 	> > 	> > 	> > /* Set entry point just before the new list page. */
> > +> > 	> > 	> > 	> > entry = (kimage_entry_t *)addr - 1;
> 
> Ah, after this restructuring we end up cleaning this page as we fall-through,
> and one kimage_entry_t at a time as we walk the list.
> 
> 	> 	> 	> break;
> ?

I added this in, but that missing break shouldn't cause any problems.


> > +> > 	> > 	> > case IND_SOURCE:
> > +> > 	> > 	> > 	> > __flush_dcache_area(addr, PAGE_SIZE);
> > +> > 	> > 	> > 	> > break;
> > +> > 	> > 	> > case IND_DESTINATION:
> > +> > 	> > 	> > 	> > break;
> > +> > 	> > 	> > default:
> > +> > 	> > 	> > 	> > BUG();
> > +> > 	> > 	> > }
> > +> > 	> > }
> > +}
> 
> 
> > diff --git a/arch/arm64/kernel/relocate_kernel.S b/arch/arm64/kernel/relocate_kernel.S
> > new file mode 100644
> > index 0000000..51b73cd
> > --- /dev/null
> > +++ b/arch/arm64/kernel/relocate_kernel.S
> 
> [ ... ]
> 
> > +.ltorg
> > +
> > +.align 3> > 	> > /* To keep the 64-bit values below naturally aligned. */
> > +
> > +.Lcopy_end:
> > +.org> > 	> > KEXEC_CONTROL_PAGE_SIZE
> 
> 
> On 16/06/16 23:41, Geoff Levand wrote:
> > This is to check if arm64_relocate_new_kernel gets too
> > big.  The assembler should give an error if the location
> > counter is set backwards.
> 
> Cunning. (probably worth a comment).

I thought this was the standard way to do it...

> This looks like it is need because we hard-coded KEXEC_CONTROL_PAGE_SIZE in
> kexec.h, so the code must be smaller than that size.
> It looks like this value is only ever passed to get_order(), could we just pass
> the actual size? It shouldn't matter if it grows >4K, as the core code will
> allocate enough memory, and the memcpy() in machine_kexec() uses the size too.

I thought 4K would be enough, but if some debugging code is
added it could get too big.

> Reviewed-by: James Morse <james.morse@arm.com>

Thanks for your comments.

-Geoff

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2016-06-20 16:49 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 23:48 [PATCH v19 00/13] arm64 kexec kernel patches Geoff Levand
2016-06-16 23:48 ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 05/13] arm64/kexec: Add pr_debug output Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-20 16:06   ` James Morse
2016-06-20 16:06     ` James Morse
2016-06-20 16:50     ` Geoff Levand
2016-06-20 16:50       ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 02/13] arm64: Add back cpu reset routines Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 04/13] arm64/kexec: Enable kexec in the arm64 defconfig Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 01/13] arm64: Add cpus_are_stuck_in_kernel Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 03/13] arm64/kexec: Add core kexec support Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-20 15:36   ` James Morse
2016-06-20 15:36     ` James Morse
2016-06-20 16:49     ` Geoff Levand [this message]
2016-06-20 16:49       ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 11/13] arm64: kdump: enable kdump in the arm64 defconfig Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 13/13] Documentation: dt: usable-memory and elfcorehdr nodes for arm64 kexec Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 12/13] arm64: kdump: update a kernel doc Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 10/13] arm64: kdump: add VMCOREINFO's for user-space coredump tools Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-20  5:32   ` Pratyush Anand
2016-06-20  5:32     ` Pratyush Anand
2016-06-22  5:59     ` AKASHI Takahiro
2016-06-22  5:59       ` AKASHI Takahiro
2016-06-23  7:14       ` Pratyush Anand
2016-06-23  7:14         ` Pratyush Anand
2016-06-23  8:42         ` AKASHI Takahiro
2016-06-23  8:42           ` AKASHI Takahiro
2016-06-23 15:46           ` Pratyush Anand
2016-06-23 15:46             ` Pratyush Anand
2016-06-30  0:44             ` AKASHI Takahiro
2016-06-30  0:44               ` AKASHI Takahiro
2016-06-16 23:48 ` [PATCH v19 07/13] arm64: limit memory regions based on DT property, usable-memory Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 08/13] arm64: kdump: implement machine_crash_shutdown() Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-16 23:48 ` [PATCH v19 06/13] arm64: kdump: reserve memory for crash dump kernel Geoff Levand
2016-06-16 23:48   ` Geoff Levand
2016-06-20 16:07   ` James Morse
2016-06-20 16:07     ` James Morse
2016-06-21  1:23     ` AKASHI Takahiro
2016-06-21  1:23       ` AKASHI Takahiro
2016-06-16 23:48 ` [PATCH v19 09/13] arm64: kdump: add kdump support Geoff Levand
2016-06-16 23:48   ` Geoff Levand

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=1466441383.7965.15.camel@infradead.org \
    --to=geoff@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.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 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.