Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] arm64 kexec kernel patches V6
@ 2014-11-14  1:22 Geoff Levand
  2014-11-27  6:19 ` Dave Young
  0 siblings, 1 reply; 11+ messages in thread
From: Geoff Levand @ 2014-11-14  1:22 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: marc.zyngier, Grant Likely, kexec, linux-arm-kernel,
	christoffer.dall

Hi All,

This series adds the core support for kexec re-boots on arm64.  I have tested
with the ARM VE fast model, the ARM Base model and the ARM Foundation
model with various kernel config options for both the first and second stage
kernels.

To load a second stage kernel and execute a kexec re-boot on arm64 my patches to
kexec-tools [2], which have not yet been merged upstream, are needed.

Patches 1-3 rework the arm64 hcall mechanism to give the arm64 soft_restart()
routine the ability to switch exception levels from EL1 to EL2 for kernels that
were entered in EL2.

Patch 4 moves proc-macros.S from arm64/mm to arm64/include/asm so that the
dcache_line_size macro it defines can be uesd by kexec's relocate kernel
routine.

Patches 5-8 add the actual kexec support.

Please consider all patches for inclusion.  Any comments or suggestions on how 
to improve are welcome.

[1]  https://git.linaro.org/people/geoff.levand/linux-kexec.git
[2]  https://git.linaro.org/people/geoff.levand/kexec-tools.git

Several things are known to have problems on kexec re-boot:

spin-table
----------

PROBLEM: The spin-table enable method does not implement all the methods needed
for CPU hot-plug, so the first stage kernel cannot be shutdown properly.

WORK-AROUND: Upgrade to system firmware that provides PSCI enable method
support, OR build the first stage kernel with CONFIG_SMP=n, OR pass 'maxcpus=1'
on the first stage kernel command line.

FIX: Upgrade system firmware to provide PSCI enable method support or add
missing spin-table support to the kernel.

KVM
---

PROBLEM: KVM acquires hypervisor resources on startup, but does not free those
resources on shutdown, so the first stage kernel cannot be shutdown properly.

WORK-AROUND:  Build the first stage kernel with CONFIG_KVM=n.

FIX: Fix KVM to support soft_restart().  KVM needs to restore default exception
vectors, etc.

UEFI
----

PROBLEM: UEFI does not manage its runtime services virtual mappings in a way
that is compatible with a kexec re-boot, so the second stage kernel hangs on
boot-up.

WORK-AROUND: Disable UEFI in firmware, OR use EFI uboot emulation if provided
by your firmware.

FIX: Fix kernel to manage UEFI virtual mappings properly.

/memreserve/
----------

PROBLEM: The use of device tree /memreserve/ entries is not compatible with
kexec re-boot.  The second stage kernel will use the reserved regions and the
system will become unstable.

WORK-AROUND: Pass a user specified DTB using the kexec --dtb option.

FIX: Convert device tree source files (.dts) and/or bootloaders to use device
tree reserved-memory nodes to specify reserved memory or provide an in kernel
mechanism to export the /memreserve/ entries to user space.

ACPI
----

PROBLEM: The kernel for ACPI based systems does not export a device tree to the
standard user space location of 'proc/device-tree'.  Current applications
expect to access device tree information from this standard location.

WORK-AROUND: Disable ACPI in firmware, OR pass 'acpi=off' on the first stage
kernel command line, OR pass a user specified DTB using the kexec --dtb option.

FIX: Fix ACPI kernel support to export device tree information suitable for a
kexec re-boot, and if this information is exported to somewhere other than
'proc/device-tree' update existing kexec user applications to use this new
interface.

----------------------------------------------------------------
The following changes since commit 302cd37c417d59549d073a8986fd028998409cb9:

  arm64: kvm: eliminate literal pool entries (2014-11-07 15:04:54 +0000)

are available in the git repository at:

  git://git.linaro.org/people/geoff.levand/linux-kexec.git kexec-v6

for you to fetch changes up to 3fc5a4ba22342ccd8e7e5a09620b00f4b81667a6:

  arm64/kexec: Enable kexec in the arm64 defconfig (2014-11-13 16:52:16 -0800)

----------------------------------------------------------------
Geoff Levand (8):
      arm64: Convert hcalls to use ISS field
      arm64: Add new hcall HVC_CALL_FUNC
      arm64: Add EL2 switch to soft_restart
      arm64: Move proc-macros.S to include/asm
      arm64/kexec: Add core kexec support
      arm64/kexec: Add pr_devel output
      arm64/kexec: Add checks for KVM and EFI
      arm64/kexec: Enable kexec in the arm64 defconfig

 arch/arm64/Kconfig                           |   9 ++
 arch/arm64/configs/defconfig                 |   1 +
 arch/arm64/include/asm/kexec.h               |  47 ++++++
 arch/arm64/include/asm/proc-fns.h            |   4 +-
 arch/arm64/{mm => include/asm}/proc-macros.S |   0
 arch/arm64/include/asm/virt.h                |  33 ++++
 arch/arm64/kernel/Makefile                   |   1 +
 arch/arm64/kernel/hyp-stub.S                 |  45 ++++--
 arch/arm64/kernel/machine_kexec.c            | 232 +++++++++++++++++++++++++++
 arch/arm64/kernel/process.c                  |  10 +-
 arch/arm64/kernel/relocate_kernel.S          | 160 ++++++++++++++++++
 arch/arm64/kvm/hyp.S                         |  18 ++-
 arch/arm64/mm/cache.S                        |   3 +-
 arch/arm64/mm/proc.S                         |  50 ++++--
 include/uapi/linux/kexec.h                   |   1 +
 15 files changed, 576 insertions(+), 38 deletions(-)
 create mode 100644 arch/arm64/include/asm/kexec.h
 rename arch/arm64/{mm => include/asm}/proc-macros.S (100%)
 create mode 100644 arch/arm64/kernel/machine_kexec.c
 create mode 100644 arch/arm64/kernel/relocate_kernel.S

-- 
1.9.1


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
       [not found] <D2393EB95A9993478029A6FE6A290A9F8129D1FE@szxeml510-mbx.china.huawei.com>
@ 2014-11-18  6:18 ` Anurup M
  2014-11-20  1:19   ` Geoff Levand
  2014-11-20 22:57   ` Geoff Levand
  0 siblings, 2 replies; 11+ messages in thread
From: Anurup M @ 2014-11-18  6:18 UTC (permalink / raw)
  To: geoff; +Cc: sanil.kumar, kexec

Hi Geoff,

	I get a relocation error  when I try to load using latest kexec-tools from https://git.linaro.org/people/geoff.levand/kexec-tools.git.

############## error log ###############
machine_apply_elf_rel: CALL26 94000000->97ffff62
sym: sha256_update info: 12 other: 00 shndx: 1 value: 5f58 size: 16c
sym: sha256_update value: 81af7f58 addr: 81af81e4
machine_apply_elf_rel: CALL26 94000000->97ffff5d
sym:      .data info: 03 other: 00 shndx: 4 value: 0 size: 0
sym: .data value: 81af8630 addr: 81af8550
machine_apply_elf_rel: ABS64 0->81af8630
Symbol: sha256_regions is in a bss section cannot set
##############

	What should be the problem? I use foundation model and the kernel image from
https://git.linaro.org/people/geoff.levand/linux-kexec.git branch: origin/kexec-v6
and rootfs from Linaro (http://releases.linaro.org/14.09/openembedded/aarch64)

	The above error is not seen when I use kexec-tools branch: origin/kdump.

	Also wish to know how to verify the kdump feature.

Thanks,
Anurup

> -----Original Message-----
> From: kexec [mailto:kexec-bounces@lists.infradead.org] On Behalf Of Geoff Levand
> Sent: Friday, November 14, 2014 6:52 AM
> To: Catalin Marinas; Will Deacon
> Cc: marc.zyngier@arm.com; Grant Likely; kexec@lists.infradead.org; linux-arm-kernel@lists.infradead.org; christoffer.dall@linaro.org
> Subject: [PATCH 0/8] arm64 kexec kernel patches V6
> 
> Hi All,
> 
> This series adds the core support for kexec re-boots on arm64.  I have tested with the ARM VE fast model, the ARM Base model and the ARM Foundation model with various kernel config options for both the first and second stage kernels.
> 
> To load a second stage kernel and execute a kexec re-boot on arm64 my patches to kexec-tools [2], which have not yet been merged upstream, are needed.
> 
> Patches 1-3 rework the arm64 hcall mechanism to give the arm64 soft_restart() routine the ability to switch exception levels from EL1 to EL2 for kernels that were entered in EL2.
> 
> Patch 4 moves proc-macros.S from arm64/mm to arm64/include/asm so that the dcache_line_size macro it defines can be uesd by kexec's relocate kernel routine.
> 
> Patches 5-8 add the actual kexec support.
> 
> Please consider all patches for inclusion.  Any comments or suggestions on how to improve are welcome.
> 
> [1]  https://git.linaro.org/people/geoff.levand/linux-kexec.git
> [2]  https://git.linaro.org/people/geoff.levand/kexec-tools.git
> 
> Several things are known to have problems on kexec re-boot:
> 
> spin-table
> ----------
> 
> PROBLEM: The spin-table enable method does not implement all the methods needed for CPU hot-plug, so the first stage kernel cannot be shutdown properly.
> 
> WORK-AROUND: Upgrade to system firmware that provides PSCI enable method support, OR build the first stage kernel with CONFIG_SMP=n, OR pass 'maxcpus=1'
> on the first stage kernel command line.
> 
> FIX: Upgrade system firmware to provide PSCI enable method support or add missing spin-table support to the kernel.
> 
> KVM
> ---
> 
> PROBLEM: KVM acquires hypervisor resources on startup, but does not free those resources on shutdown, so the first stage kernel cannot be shutdown properly.
> 
> WORK-AROUND:  Build the first stage kernel with CONFIG_KVM=n.
> 
> FIX: Fix KVM to support soft_restart().  KVM needs to restore default exception vectors, etc.
> 
> UEFI
> ----
> 
> PROBLEM: UEFI does not manage its runtime services virtual mappings in a way that is compatible with a kexec re-boot, so the second stage kernel hangs on boot-up.
> 
> WORK-AROUND: Disable UEFI in firmware, OR use EFI uboot emulation if provided by your firmware.
> 
> FIX: Fix kernel to manage UEFI virtual mappings properly.
> 
> /memreserve/
> ----------
> 
> PROBLEM: The use of device tree /memreserve/ entries is not compatible with kexec re-boot.  The second stage kernel will use the reserved regions and the system will become unstable.
> 
> WORK-AROUND: Pass a user specified DTB using the kexec --dtb option.
> 
> FIX: Convert device tree source files (.dts) and/or bootloaders to use device tree reserved-memory nodes to specify reserved memory or provide an in kernel mechanism to export the /memreserve/ entries to user space.
> 
> ACPI
> ----
> 
> PROBLEM: The kernel for ACPI based systems does not export a device tree to the standard user space location of 'proc/device-tree'.  Current applications expect to access device tree information from this standard location.
> 
> WORK-AROUND: Disable ACPI in firmware, OR pass 'acpi=off' on the first stage kernel command line, OR pass a user specified DTB using the kexec --dtb option.
> 
> FIX: Fix ACPI kernel support to export device tree information suitable for a kexec re-boot, and if this information is exported to somewhere other than 'proc/device-tree' update existing kexec user applications to use this new interface.
> 
> ----------------------------------------------------------------
> The following changes since commit 302cd37c417d59549d073a8986fd028998409cb9:
> 
>   arm64: kvm: eliminate literal pool entries (2014-11-07 15:04:54 +0000)
> 
> are available in the git repository at:
> 
>   git://git.linaro.org/people/geoff.levand/linux-kexec.git kexec-v6
> 
> for you to fetch changes up to 3fc5a4ba22342ccd8e7e5a09620b00f4b81667a6:
> 
>   arm64/kexec: Enable kexec in the arm64 defconfig (2014-11-13 16:52:16 -0800)
> 
> ----------------------------------------------------------------
> Geoff Levand (8):
>       arm64: Convert hcalls to use ISS field
>       arm64: Add new hcall HVC_CALL_FUNC
>       arm64: Add EL2 switch to soft_restart
>       arm64: Move proc-macros.S to include/asm
>       arm64/kexec: Add core kexec support
>       arm64/kexec: Add pr_devel output
>       arm64/kexec: Add checks for KVM and EFI
>       arm64/kexec: Enable kexec in the arm64 defconfig
> 
>  arch/arm64/Kconfig                           |   9 ++
>  arch/arm64/configs/defconfig                 |   1 +
>  arch/arm64/include/asm/kexec.h               |  47 ++++++
>  arch/arm64/include/asm/proc-fns.h            |   4 +-
>  arch/arm64/{mm => include/asm}/proc-macros.S |   0
>  arch/arm64/include/asm/virt.h                |  33 ++++
>  arch/arm64/kernel/Makefile                   |   1 +
>  arch/arm64/kernel/hyp-stub.S                 |  45 ++++--
>  arch/arm64/kernel/machine_kexec.c            | 232 +++++++++++++++++++++++++++
>  arch/arm64/kernel/process.c                  |  10 +-
>  arch/arm64/kernel/relocate_kernel.S          | 160 ++++++++++++++++++
>  arch/arm64/kvm/hyp.S                         |  18 ++-
>  arch/arm64/mm/cache.S                        |   3 +-
>  arch/arm64/mm/proc.S                         |  50 ++++--
>  include/uapi/linux/kexec.h                   |   1 +
>  15 files changed, 576 insertions(+), 38 deletions(-)  create mode 100644 arch/arm64/include/asm/kexec.h  rename arch/arm64/{mm => include/asm}/proc-macros.S (100%)  create mode 100644 arch/arm64/kernel/machine_kexec.c  create mode 100644 arch/arm64/kernel/relocate_kernel.S
> 
> --
> 1.9.1
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 
> .
> 


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-18  6:18 ` [PATCH 0/8] arm64 kexec kernel patches V6 Anurup M
@ 2014-11-20  1:19   ` Geoff Levand
  2014-11-20 22:57   ` Geoff Levand
  1 sibling, 0 replies; 11+ messages in thread
From: Geoff Levand @ 2014-11-20  1:19 UTC (permalink / raw)
  To: Anurup M; +Cc: sanil.kumar, kexec

On Tue, 2014-11-18 at 11:48 +0530, Anurup M wrote:
> 	I get a relocation error  when I try to load using latest kexec-tools from https://git.linaro.org/people/geoff.levand/kexec-tools.git.
> 
> ############## error log ###############
> machine_apply_elf_rel: CALL26 94000000->97ffff62
> sym: sha256_update info: 12 other: 00 shndx: 1 value: 5f58 size: 16c
> sym: sha256_update value: 81af7f58 addr: 81af81e4
> machine_apply_elf_rel: CALL26 94000000->97ffff5d
> sym:      .data info: 03 other: 00 shndx: 4 value: 0 size: 0
> sym: .data value: 81af8630 addr: 81af8550
> machine_apply_elf_rel: ABS64 0->81af8630
> Symbol: sha256_regions is in a bss section cannot set
> ##############
> 
> 	What should be the problem? 

It seems either your purgatory code was not built correctly,
or the kexec-tools relocator didn't do the correct thing.

Please post the output from your gcc with the --version option and
the command line used to compile purgatory/purgatory.c.

> I use foundation model and the kernel image from
> https://git.linaro.org/people/geoff.levand/linux-kexec.git branch: origin/kexec-v6
> and rootfs from Linaro (http://releases.linaro.org/14.09/openembedded/aarch64)
> 
> 	The above error is not seen when I use kexec-tools branch: origin/kdump.
> 
> 	Also wish to know how to verify the kdump feature.

As I mentioned before, these patches only add kexec re-boot support.  kdump
has not been ported to arm64 yet.

-Geoff




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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-18  6:18 ` [PATCH 0/8] arm64 kexec kernel patches V6 Anurup M
  2014-11-20  1:19   ` Geoff Levand
@ 2014-11-20 22:57   ` Geoff Levand
  2014-11-20 23:31     ` Geoff Levand
  1 sibling, 1 reply; 11+ messages in thread
From: Geoff Levand @ 2014-11-20 22:57 UTC (permalink / raw)
  To: Anurup M; +Cc: sanil.kumar, kexec

Please use a mailer that can properly thread.

On Tue, 2014-11-18 at 11:48 +0530, Anurup M wrote:
> 	I get a relocation error  when I try to load using latest kexec-tools from https://git.linaro.org/people/geoff.levand/kexec-tools.git.

Post your purgatory/purgatory.map

-Geoff


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-20 22:57   ` Geoff Levand
@ 2014-11-20 23:31     ` Geoff Levand
  2014-12-02 13:39       ` Anurup m
  0 siblings, 1 reply; 11+ messages in thread
From: Geoff Levand @ 2014-11-20 23:31 UTC (permalink / raw)
  To: Anurup M; +Cc: sanil.kumar, kexec

> On Tue, 2014-11-18 at 11:48 +0530, Anurup M wrote:
> > 	I get a relocation error  when I try to load using latest kexec-tools from https://git.linaro.org/people/geoff.levand/kexec-tools.git.

Please build with the patch below and let me know the
result.

-Geoff

diff --git a/purgatory/purgatory.c b/purgatory/purgatory.c
index 3bbcc09..faee277 100644
--- a/purgatory/purgatory.c
+++ b/purgatory/purgatory.c
@@ -6,8 +6,9 @@
 #include <string.h>
 #include "../kexec/kexec-sha256.h"
 
-struct sha256_region sha256_regions[SHA256_REGIONS] = {};
-sha256_digest_t sha256_digest = { };
+struct sha256_region __attribute__ ((section (".data")))
+	sha256_regions[SHA256_REGIONS] = {};
+sha256_digest_t __attribute__ ((section (".data"))) sha256_digest = {};
 
 int verify_sha256_digest(void)
 {



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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-14  1:22 Geoff Levand
@ 2014-11-27  6:19 ` Dave Young
  2014-11-28  6:56   ` Dave Young
  2014-12-02 20:22   ` Geoff Levand
  0 siblings, 2 replies; 11+ messages in thread
From: Dave Young @ 2014-11-27  6:19 UTC (permalink / raw)
  To: Geoff Levand
  Cc: drjones, marc.zyngier, Catalin Marinas, Will Deacon,
	christoffer.dall, Grant Likely, kexec, linux-arm-kernel

Geoff,

Is there any Linaro card for the KVM soft restart issue?

Ccing Andrew Jones since he might be interested in KVM issues.

On 11/14/14 at 01:22am, Geoff Levand wrote:
> Hi All,
> 
> This series adds the core support for kexec re-boots on arm64.  I have tested
> with the ARM VE fast model, the ARM Base model and the ARM Foundation
> model with various kernel config options for both the first and second stage
> kernels.
> 
> To load a second stage kernel and execute a kexec re-boot on arm64 my patches to
> kexec-tools [2], which have not yet been merged upstream, are needed.
> 
> Patches 1-3 rework the arm64 hcall mechanism to give the arm64 soft_restart()
> routine the ability to switch exception levels from EL1 to EL2 for kernels that
> were entered in EL2.
> 
> Patch 4 moves proc-macros.S from arm64/mm to arm64/include/asm so that the
> dcache_line_size macro it defines can be uesd by kexec's relocate kernel
> routine.
> 
> Patches 5-8 add the actual kexec support.
> 
> Please consider all patches for inclusion.  Any comments or suggestions on how 
> to improve are welcome.
> 
> [1]  https://git.linaro.org/people/geoff.levand/linux-kexec.git
> [2]  https://git.linaro.org/people/geoff.levand/kexec-tools.git
> 
> Several things are known to have problems on kexec re-boot:
> 
> spin-table
> ----------
> 
> PROBLEM: The spin-table enable method does not implement all the methods needed
> for CPU hot-plug, so the first stage kernel cannot be shutdown properly.
> 
> WORK-AROUND: Upgrade to system firmware that provides PSCI enable method
> support, OR build the first stage kernel with CONFIG_SMP=n, OR pass 'maxcpus=1'
> on the first stage kernel command line.
> 
> FIX: Upgrade system firmware to provide PSCI enable method support or add
> missing spin-table support to the kernel.
> 
> KVM
> ---
> 
> PROBLEM: KVM acquires hypervisor resources on startup, but does not free those
> resources on shutdown, so the first stage kernel cannot be shutdown properly.
> 
> WORK-AROUND:  Build the first stage kernel with CONFIG_KVM=n.
> 
> FIX: Fix KVM to support soft_restart().  KVM needs to restore default exception
> vectors, etc.
> 
> UEFI
> ----
> 
> PROBLEM: UEFI does not manage its runtime services virtual mappings in a way
> that is compatible with a kexec re-boot, so the second stage kernel hangs on
> boot-up.
> 
> WORK-AROUND: Disable UEFI in firmware, OR use EFI uboot emulation if provided
> by your firmware.
> 
> FIX: Fix kernel to manage UEFI virtual mappings properly.
> 
> /memreserve/
> ----------
> 
> PROBLEM: The use of device tree /memreserve/ entries is not compatible with
> kexec re-boot.  The second stage kernel will use the reserved regions and the
> system will become unstable.
> 
> WORK-AROUND: Pass a user specified DTB using the kexec --dtb option.
> 
> FIX: Convert device tree source files (.dts) and/or bootloaders to use device
> tree reserved-memory nodes to specify reserved memory or provide an in kernel
> mechanism to export the /memreserve/ entries to user space.
> 
> ACPI
> ----
> 
> PROBLEM: The kernel for ACPI based systems does not export a device tree to the
> standard user space location of 'proc/device-tree'.  Current applications
> expect to access device tree information from this standard location.
> 
> WORK-AROUND: Disable ACPI in firmware, OR pass 'acpi=off' on the first stage
> kernel command line, OR pass a user specified DTB using the kexec --dtb option.
> 
> FIX: Fix ACPI kernel support to export device tree information suitable for a
> kexec re-boot, and if this information is exported to somewhere other than
> 'proc/device-tree' update existing kexec user applications to use this new
> interface.
> 
> ----------------------------------------------------------------
> The following changes since commit 302cd37c417d59549d073a8986fd028998409cb9:
> 
>   arm64: kvm: eliminate literal pool entries (2014-11-07 15:04:54 +0000)
> 
> are available in the git repository at:
> 
>   git://git.linaro.org/people/geoff.levand/linux-kexec.git kexec-v6
> 
> for you to fetch changes up to 3fc5a4ba22342ccd8e7e5a09620b00f4b81667a6:
> 
>   arm64/kexec: Enable kexec in the arm64 defconfig (2014-11-13 16:52:16 -0800)
> 
> ----------------------------------------------------------------
> Geoff Levand (8):
>       arm64: Convert hcalls to use ISS field
>       arm64: Add new hcall HVC_CALL_FUNC
>       arm64: Add EL2 switch to soft_restart
>       arm64: Move proc-macros.S to include/asm
>       arm64/kexec: Add core kexec support
>       arm64/kexec: Add pr_devel output
>       arm64/kexec: Add checks for KVM and EFI
>       arm64/kexec: Enable kexec in the arm64 defconfig
> 
>  arch/arm64/Kconfig                           |   9 ++
>  arch/arm64/configs/defconfig                 |   1 +
>  arch/arm64/include/asm/kexec.h               |  47 ++++++
>  arch/arm64/include/asm/proc-fns.h            |   4 +-
>  arch/arm64/{mm => include/asm}/proc-macros.S |   0
>  arch/arm64/include/asm/virt.h                |  33 ++++
>  arch/arm64/kernel/Makefile                   |   1 +
>  arch/arm64/kernel/hyp-stub.S                 |  45 ++++--
>  arch/arm64/kernel/machine_kexec.c            | 232 +++++++++++++++++++++++++++
>  arch/arm64/kernel/process.c                  |  10 +-
>  arch/arm64/kernel/relocate_kernel.S          | 160 ++++++++++++++++++
>  arch/arm64/kvm/hyp.S                         |  18 ++-
>  arch/arm64/mm/cache.S                        |   3 +-
>  arch/arm64/mm/proc.S                         |  50 ++++--
>  include/uapi/linux/kexec.h                   |   1 +
>  15 files changed, 576 insertions(+), 38 deletions(-)
>  create mode 100644 arch/arm64/include/asm/kexec.h
>  rename arch/arm64/{mm => include/asm}/proc-macros.S (100%)
>  create mode 100644 arch/arm64/kernel/machine_kexec.c
>  create mode 100644 arch/arm64/kernel/relocate_kernel.S
> 
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 
> 

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-27  6:19 ` Dave Young
@ 2014-11-28  6:56   ` Dave Young
  2014-12-02 20:26     ` Geoff Levand
  2014-12-02 20:22   ` Geoff Levand
  1 sibling, 1 reply; 11+ messages in thread
From: Dave Young @ 2014-11-28  6:56 UTC (permalink / raw)
  To: Geoff Levand
  Cc: drjones, marc.zyngier, Catalin Marinas, Will Deacon,
	christoffer.dall, Grant Likely, kexec, linux-arm-kernel

On 11/27/14 at 02:19pm, Dave Young wrote:
> Geoff,
> 
> Is there any Linaro card for the KVM soft restart issue?
> 
> Ccing Andrew Jones since he might be interested in KVM issues.
> 
> On 11/14/14 at 01:22am, Geoff Levand wrote:
> > Hi All,
> > 
> > This series adds the core support for kexec re-boots on arm64.  I have tested
> > with the ARM VE fast model, the ARM Base model and the ARM Foundation
> > model with various kernel config options for both the first and second stage
> > kernels.
> > 
> > To load a second stage kernel and execute a kexec re-boot on arm64 my patches to
> > kexec-tools [2], which have not yet been merged upstream, are needed.
> > 
> > Patches 1-3 rework the arm64 hcall mechanism to give the arm64 soft_restart()
> > routine the ability to switch exception levels from EL1 to EL2 for kernels that
> > were entered in EL2.
> > 
> > Patch 4 moves proc-macros.S from arm64/mm to arm64/include/asm so that the
> > dcache_line_size macro it defines can be uesd by kexec's relocate kernel
> > routine.
> > 
> > Patches 5-8 add the actual kexec support.
> > 
> > Please consider all patches for inclusion.  Any comments or suggestions on how 
> > to improve are welcome.
> > 
> > [1]  https://git.linaro.org/people/geoff.levand/linux-kexec.git
> > [2]  https://git.linaro.org/people/geoff.levand/kexec-tools.git
> > 
> > Several things are known to have problems on kexec re-boot:
> > 
> > spin-table
> > ----------
> > 
> > PROBLEM: The spin-table enable method does not implement all the methods needed
> > for CPU hot-plug, so the first stage kernel cannot be shutdown properly.
> > 
> > WORK-AROUND: Upgrade to system firmware that provides PSCI enable method
> > support, OR build the first stage kernel with CONFIG_SMP=n, OR pass 'maxcpus=1'
> > on the first stage kernel command line.
> > 
> > FIX: Upgrade system firmware to provide PSCI enable method support or add
> > missing spin-table support to the kernel.
> > 
> > KVM
> > ---
> > 
> > PROBLEM: KVM acquires hypervisor resources on startup, but does not free those
> > resources on shutdown, so the first stage kernel cannot be shutdown properly.
> > 
> > WORK-AROUND:  Build the first stage kernel with CONFIG_KVM=n.
> > 
> > FIX: Fix KVM to support soft_restart().  KVM needs to restore default exception
> > vectors, etc.
> > 
> > UEFI
> > ----
> > 
> > PROBLEM: UEFI does not manage its runtime services virtual mappings in a way
> > that is compatible with a kexec re-boot, so the second stage kernel hangs on
> > boot-up.
> > 
> > WORK-AROUND: Disable UEFI in firmware, OR use EFI uboot emulation if provided
> > by your firmware.
> > 
> > FIX: Fix kernel to manage UEFI virtual mappings properly.
> > 
> > /memreserve/
> > ----------
> > 
> > PROBLEM: The use of device tree /memreserve/ entries is not compatible with
> > kexec re-boot.  The second stage kernel will use the reserved regions and the
> > system will become unstable.
> > 
> > WORK-AROUND: Pass a user specified DTB using the kexec --dtb option.
> > 
> > FIX: Convert device tree source files (.dts) and/or bootloaders to use device
> > tree reserved-memory nodes to specify reserved memory or provide an in kernel
> > mechanism to export the /memreserve/ entries to user space.
> > 
> > ACPI
> > ----
> > 
> > PROBLEM: The kernel for ACPI based systems does not export a device tree to the
> > standard user space location of 'proc/device-tree'.  Current applications
> > expect to access device tree information from this standard location.
> > 
> > WORK-AROUND: Disable ACPI in firmware, OR pass 'acpi=off' on the first stage
> > kernel command line, OR pass a user specified DTB using the kexec --dtb option.
> > 
> > FIX: Fix ACPI kernel support to export device tree information suitable for a
> > kexec re-boot, and if this information is exported to somewhere other than
> > 'proc/device-tree' update existing kexec user applications to use this new
> > interface.
> > 
> > ----------------------------------------------------------------
> > The following changes since commit 302cd37c417d59549d073a8986fd028998409cb9:
> > 
> >   arm64: kvm: eliminate literal pool entries (2014-11-07 15:04:54 +0000)
> > 
> > are available in the git repository at:
> > 
> >   git://git.linaro.org/people/geoff.levand/linux-kexec.git kexec-v6
> > 

Tested your master branch, works for me with below setup:
UEFI boot, CONFIG_KVM=n, maxcpus=1, --lite

But --dtb still does not work if there's no /proc/device-tree, failed as below:
unrecoverable error: could not scan "/proc/device-tree/": No such file or directory.

kexec without --lite also does not work, looks like it hangs after "Bye" ..

Thanks
Dave

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-20 23:31     ` Geoff Levand
@ 2014-12-02 13:39       ` Anurup m
  2014-12-02 20:30         ` Geoff Levand
  0 siblings, 1 reply; 11+ messages in thread
From: Anurup m @ 2014-12-02 13:39 UTC (permalink / raw)
  To: Geoff Levand; +Cc: Sanil kumar, kexec@lists.infradead.org

Hi Geoff,

	The patch solved the issue reported.

Thanks and Regards
Anurup M

-----Original Message-----
From: Geoff Levand [mailto:geoff@infradead.org] 
Sent: Friday, November 21, 2014 5:01 AM
To: Anurup m
Cc: kexec@lists.infradead.org; Sanil kumar
Subject: Re: [PATCH 0/8] arm64 kexec kernel patches V6

> On Tue, 2014-11-18 at 11:48 +0530, Anurup M wrote:
> > 	I get a relocation error  when I try to load using latest kexec-tools from https://git.linaro.org/people/geoff.levand/kexec-tools.git.

Please build with the patch below and let me know the result.

-Geoff

diff --git a/purgatory/purgatory.c b/purgatory/purgatory.c index 3bbcc09..faee277 100644
--- a/purgatory/purgatory.c
+++ b/purgatory/purgatory.c
@@ -6,8 +6,9 @@
 #include <string.h>
 #include "../kexec/kexec-sha256.h"
 
-struct sha256_region sha256_regions[SHA256_REGIONS] = {}; -sha256_digest_t sha256_digest = { };
+struct sha256_region __attribute__ ((section (".data")))
+	sha256_regions[SHA256_REGIONS] = {};
+sha256_digest_t __attribute__ ((section (".data"))) sha256_digest = {};
 
 int verify_sha256_digest(void)
 {


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-27  6:19 ` Dave Young
  2014-11-28  6:56   ` Dave Young
@ 2014-12-02 20:22   ` Geoff Levand
  1 sibling, 0 replies; 11+ messages in thread
From: Geoff Levand @ 2014-12-02 20:22 UTC (permalink / raw)
  To: Dave Young
  Cc: drjones, marc.zyngier, Catalin Marinas, Will Deacon,
	christoffer.dall, Grant Likely, kexec, linux-arm-kernel

Hi Dave,

On Thu, 2014-11-27 at 14:19 +0800, Dave Young wrote:
> Is there any Linaro card for the KVM soft restart issue?

  https://cards.linaro.org/browse/KWG-611

I have a skeleton patch for the fix that needs to be filled
out in both in the Linaro card and in the commit (arm64/kvm:
Add KVM cpu shutdown) my master branch here:

 http://git.linaro.org/people/geoff.levand/linux-kexec.git

-Geoff




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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-11-28  6:56   ` Dave Young
@ 2014-12-02 20:26     ` Geoff Levand
  0 siblings, 0 replies; 11+ messages in thread
From: Geoff Levand @ 2014-12-02 20:26 UTC (permalink / raw)
  To: Dave Young
  Cc: drjones, marc.zyngier, Catalin Marinas, Will Deacon,
	christoffer.dall, Grant Likely, kexec, linux-arm-kernel

Hi Dave,

On Fri, 2014-11-28 at 14:56 +0800, Dave Young wrote:
> Tested your master branch, works for me with below setup:
> UEFI boot, CONFIG_KVM=n, maxcpus=1, --lite
> 
> But --dtb still does not work if there's no /proc/device-tree, failed as below:
> unrecoverable error: could not scan "/proc/device-tree/": No such file or directory.
> 
> kexec without --lite also does not work, looks like it hangs after "Bye" ..

I'll be away from the office this week.  I'll look into this when I
return.

-Geoff


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] arm64 kexec kernel patches V6
  2014-12-02 13:39       ` Anurup m
@ 2014-12-02 20:30         ` Geoff Levand
  0 siblings, 0 replies; 11+ messages in thread
From: Geoff Levand @ 2014-12-02 20:30 UTC (permalink / raw)
  To: Anurup m; +Cc: Sanil kumar, kexec@lists.infradead.org

On Tue, 2014-12-02 at 13:39 +0000, Anurup m wrote:
> 	The patch solved the issue reported.

OK, this seems to be a bug in the core purgatory code.  I'll verify and
post the fix to the ML for inclusion.

-Geoff




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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-12-02 20:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <D2393EB95A9993478029A6FE6A290A9F8129D1FE@szxeml510-mbx.china.huawei.com>
2014-11-18  6:18 ` [PATCH 0/8] arm64 kexec kernel patches V6 Anurup M
2014-11-20  1:19   ` Geoff Levand
2014-11-20 22:57   ` Geoff Levand
2014-11-20 23:31     ` Geoff Levand
2014-12-02 13:39       ` Anurup m
2014-12-02 20:30         ` Geoff Levand
2014-11-14  1:22 Geoff Levand
2014-11-27  6:19 ` Dave Young
2014-11-28  6:56   ` Dave Young
2014-12-02 20:26     ` Geoff Levand
2014-12-02 20:22   ` Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox