linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@ozlabs.org
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	dyoung@redhat.com, stewart@linux.vnet.ibm.com,
	bauerman@linux.vnet.ibm.com
Subject: [PATCH v11 0/8] powerpc: Implement kexec_file_load()
Date: Tue, 29 Nov 2016 23:45:46 +1100	[thread overview]
Message-ID: <1480423554-6411-1-git-send-email-mpe@ellerman.id.au> (raw)

This is v11 of the kexec_file_load() for powerpc series.

I've stripped this down to the minimum we need, so we can get this in for 4.10.
Any additions can come later incrementally.

If no one objects I'll merge this via the powerpc tree. The three kexec patches
have been acked by Dave Young (since forever), and have been in linux-next (via
akpm's tree) also for a long time.

cheers


v11 (Michael Ellerman):
 - Strip back purgatory to the minimal trampoline required. This avoids
   complexity in the purgatory environment where all exceptions are fatal.
 - Reorder the series so we don't start advertising the config symbol, or more
   importantly the syscall, until they're actually implemented.


Original cover letter by Thiago:

This patch series implements the kexec_file_load system call on PowerPC.

This system call moves the reading of the kernel, initrd and the device tree
from the userspace kexec tool to the kernel. This is needed if you want to
do one or both of the following:

1. only allow loading of signed kernels.
2. "measure" (i.e., record the hashes of) the kernel, initrd, kernel
   command line and other boot inputs for the Integrity Measurement
   Architecture subsystem.

The above are the functions kexec already has built into kexec_file_load.
Yesterday I posted a set of patches which allows a third feature:

3. have IMA pass-on its event log (where integrity measurements are
   registered) accross kexec to the second kernel, so that the event
   history is preserved.

Because OpenPower uses an intermediary Linux instance as a boot loader
(skiroot), feature 1 is needed to implement secure boot for the platform,
while features 2 and 3 are needed to implement trusted boot.

This patch series starts by removing an x86 assumption from kexec_file:
kexec_add_buffer uses iomem to find reserved memory ranges, but PowerPC
uses the memblock subsystem.  A hook is added so that each arch can
specify how memory ranges can be found.

Also, the memory-walking logic in kexec_add_buffer is useful in this
implementation to find a free area for the purgatory's stack, so the
next patch moves that logic to kexec_locate_mem_hole.

The kexec_file_load system call needs to apply relocations to the
purgatory but adding code for that would duplicate functionality with
the module loading mechanism, which also needs to apply relocations to
the kernel modules.  Therefore, this patch series factors out the module
relocation code so that it can be shared.

One thing that is still missing is crashkernel support, which I intend
to submit shortly. For now, arch_kexec_kernel_image_probe rejects crash
kernels.

This code is based on kexec-tools, but with many modifications to adapt
it to the kernel environment and facilities.

             reply	other threads:[~2016-11-29 12:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 12:45 Michael Ellerman [this message]
2016-11-29 12:45 ` [PATCH v11 1/8] kexec_file: Allow arch-specific memory walking for kexec_add_buffer Michael Ellerman
2016-11-30 19:51   ` [v11, " Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 2/8] kexec_file: Change kexec_add_buffer to take kexec_buf as argument Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 3/8] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 4/8] powerpc: Change places using CONFIG_KEXEC to use CONFIG_KEXEC_CORE instead Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 5/8] powerpc: Add support code for kexec_file_load() Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 6/8] powerpc: Add purgatory for kexec_file_load() implementation Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 7/8] powerpc/kexec: Enable kexec_file_load() syscall Michael Ellerman
2016-11-29 12:45 ` [PATCH v11 8/8] powerpc: Enable CONFIG_KEXEC_FILE in powerpc server defconfigs Michael Ellerman
2016-11-29 21:45 ` [PATCH v11 0/8] powerpc: Implement kexec_file_load() Andrew Morton
2016-11-29 22:17   ` Thiago Jung Bauermann
2016-11-30  4:52   ` Michael Ellerman
2016-11-30 13:03     ` Mimi Zohar
2016-12-01  1:14       ` Mimi Zohar

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=1480423554-6411-1-git-send-email-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=akpm@linux-foundation.org \
    --cc=bauerman@linux.vnet.ibm.com \
    --cc=dyoung@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=stewart@linux.vnet.ibm.com \
    /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).