My kexec test patches for OpenBMC

Bruce Mitchell Bruce.Mitchell at ibm.com
Fri Feb 19 11:53:40 AEDT 2021



Hello Joel,

Per your request yesterday, I am emailing the details of my kexec/kdump
development efforts.

I am running QEMU
   qemu-system-arm --version
   QEMU emulator version 5.2.0 (v5.1.0-3479-g27ca38d3db)
   Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
   qemu-system-arm -d cpu_reset -M tacoma-bmc
   -kernel /tmp/tmp.y2fpdAXM1h.kernel -dtb /tmp/tmp.BWkadwNbTf.dtb
   -initrd /tmp/tmp.jRpFbzfpBs.initrd -drive
   file=obmc-phosphor-image-witherspoon-tacoma.wic,if=sd,format=raw,index=2
   -net nic -net
   user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostname=qemu
 -nographic -append "crashkernel=64M console=ttyS4,115200n8 rootwait
   root=PARTLABEL=rofs-a"

>From OpenBMC within QEMU I am using the following to test kexec
   kexec -d -l /home/kexec_files/tmp.y2fpdAXM1h.kernel
   --initrd=/home/kexec_files/tmp.jRpFbzfpBs.initrd
   --dtb=/home/kexec_files/tmp.BWkadwNbTf.dtb --append="earlycon
   console=ttyS4,115200n8 rootwait root=PARTLABEL=rofs-a 1 maxcpus=1
   reset_devices"
   kexec -d -e

This is my source code starting point: (taken from openbmc/openbmc: OpenBMC
Distribution (github.com) )
   bam at latitude-e5430:~/my_git/openbmc/openbmc$ git log
   commit c0263ac8ac029de5e7651a22cc864c4b3aaea5c3 (HEAD)
   Author: Andrew Geissler <openbmcbump-github at yahoo.com>
   Date:   Wed Feb 17 00:51:19 2021 +0000

       phosphor-sel-logger: srcrev bump 7d8a3003fb..dbd77b9200

       Charles Hsu (1):
             Add watchdog event monitor

       Change-Id: I08d375e006e560c573896349562ca53e3162d628
       Signed-off-by: Andrew Geissler <openbmcbump-github at yahoo.com>

   commit 91dd8078a5855ee7369c0d60dc405511c4941def
   Author: Andrew Geissler <openbmcbump-github at yahoo.com>
   Date:   Tue Feb 16 19:51:09 2021 +0000

       phosphor-power: srcrev bump de0fd44f76..10d9405574

       Jay Meyer (1):
             Capture PSU STATUS_MFR_SPECIFIC during analysis

       Change-Id: Ifd8b0e4b7dd2cd43f3e861e27d52ba03034a4d22
       Signed-off-by: Andrew Geissler <openbmcbump-github at yahoo.com>

This shows the modified files:
   bam at latitude-e5430:~/my_git/openbmc/openbmc$ git status
   HEAD detached at c0263ac8a
   Changes not staged for commit:
     (use "git add <file>..." to update what will be committed)
     (use "git checkout -- <file>..." to discard changes in working
   directory)

           modified:
   meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
           modified:
   meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend

This shows the git diff
meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
   bam at latitude-e5430:~/my_git/openbmc/openbmc$ git diff
   meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
   diff --git
   a/meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
   b/meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
   index b80042396..92de519a5 100644
   --- a/meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
   +++ b/meta-aspeed/recipes-kernel/linux/linux-aspeed/aspeed-g6/defconfig
   @@ -18,6 +18,10 @@ CONFIG_BLK_DEV_INITRD=y
    # CONFIG_RD_LZ4 is not set
    # CONFIG_UID16 is not set
    # CONFIG_SYSFS_SYSCALL is not set
   +CONFIG_SYSFS=y
   +CONFIG_CRASH_DUMP=y
   +CONFIG_PROC_VMCORE=y
   +AUTO_ZRELADDR=y
    # CONFIG_AIO is not set
    CONFIG_BPF_SYSCALL=y
    CONFIG_EMBEDDED=y
   @@ -299,3 +303,5 @@ CONFIG_FUNCTION_TRACER=y
    CONFIG_DEBUG_WX=y
    CONFIG_DEBUG_USER=y
    # CONFIG_RUNTIME_TESTING_MENU is not set
   +
   +CONFIG_MAGIC_SYSRQ=y

This shows the git diff
meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
   bam at latitude-e5430:~/my_git/openbmc/openbmc$ git diff
   meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
   diff --git
   a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
 b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
   index 29a567e27..5a19f561b 100644
   ---
   a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
   +++
   b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
   @@ -28,9 +28,9 @@ RDEPENDS_${PN}-inventory_append_mihawk = "
   openpower-fru-vpd openpower-occ-contr
    RDEPENDS_${PN}-fan-control_append_ibm-ac-server = " fan-watchdog"
    RDEPENDS_${PN}-fan-control_append_rainier = " fan-watchdog"
    RDEPENDS_${PN}-extras_append_ibm-ac-server = " $
   {POWER_SERVICE_PACKAGES_AC_SERVER} witherspoon-power-supply-sync
   phosphor-webui"
   -RDEPENDS_${PN}-extras_append_rainier = " $
   {POWER_SERVICE_PACKAGES_RAINIER} webui-vue dbus-sensors
   phosphor-virtual-sensor"
   +RDEPENDS_${PN}-extras_append_rainier = " $
   {POWER_SERVICE_PACKAGES_RAINIER} webui-vue dbus-sensors
   phosphor-virtual-sensor kexec-tools file"
    RDEPENDS_${PN}-extras_append_mihawk = " phosphor-webui
   phosphor-image-signing wistron-ipmi-oem $
   {POWER_SERVICE_PACKAGES_AC_SERVER}"
   -RDEPENDS_${PN}-extras_append_witherspoon-tacoma = " pldm srvcfg-manager
   webui-vue biosconfig-manager"
   +RDEPENDS_${PN}-extras_append_witherspoon-tacoma = " pldm srvcfg-manager
   webui-vue biosconfig-manager kexec-tools file"

    RDEPENDS_${PN}-extras_remove_rainier = "obmc-ikvm liberation-fonts
   uart-render-controller"
    RDEPENDS_${PN}-extras_remove_swift = "obmc-ikvm"
   bam at latitude-e5430:~/my_git/openbmc/openbmc$


Here is where I am staring from for linux-aspeed:
   bam at latitude-e5430:~/my_git/openbmc/openbmc/build/witherspoon-tacoma/workspace/sources/linux-aspeed
$ git log
   commit 56621ca6dcf8c20fc7bc72771df00cd3d59c153b
   Author: Joel Stanley <joel at jms.id.au>
   Date:   Tue Feb 9 13:47:10 2021 +1030

       ARM: configs: aspeed: Update defconfigs

       OpenBMC-Staging-Count: 1
       Signed-off-by: Joel Stanley <joel at jms.id.au>

   commit 88c06f67f99fead1fba4ab508786f5ef824a7404
   Author: Tomer Maimon <tmaimon77 at gmail.com>
   Date:   Mon Jan 14 15:07:09 2019 +0200

       ARM: configs: add defconfig for Nuvoton NPCM7xx BMC

       OpenBMC-Staging-Count: 9
       Signed-off-by: Tomer Maimon <tmaimon77 at gmail.com>
       Signed-off-by: Joel Stanley <joel at jms.id.au>

This shows the modified file:
   bam at latitude-e5430:~/my_git/openbmc/openbmc/build/witherspoon-tacoma/workspace/sources/linux-aspeed
$ git status
   On branch devtool
   Changes not staged for commit:
     (use "git add <file>..." to update what will be committed)
     (use "git checkout -- <file>..." to discard changes in working
   directory)

           modified:   arch/arm/mach-aspeed/platsmp.c

This shows the git diff arch/arm/mach-aspeed/platsmp.c
   bam at latitude-e5430:~/my_git/openbmc/openbmc/build/witherspoon-tacoma/workspace/sources/linux-aspeed
$ git diff
   diff --git a/arch/arm/mach-aspeed/platsmp.c
   b/arch/arm/mach-aspeed/platsmp.c
   index 2324becf7991..d004fef81e6f 100644
   --- a/arch/arm/mach-aspeed/platsmp.c
   +++ b/arch/arm/mach-aspeed/platsmp.c
   @@ -7,11 +7,32 @@
    #include <linux/of.h>
    #include <linux/smp.h>

   +#include <linux/errno.h>
   +#include <linux/jiffies.h>
   +#include <asm/cacheflush.h>
   +#include <asm/cp15.h>
   +#include <asm/proc-fns.h>
   +
    #define BOOT_ADDR      0x00
    #define BOOT_SIG       0x04

    static struct device_node *secboot_node;

   +static void aspeed_g6_cpu_die(unsigned int cpu)
   +{
   +       v7_exit_coherency_flush(louis);
   +
   +       while (1) {
   +               cpu_do_idle();
   +       }
   +}
   +
   +static int aspeed_g6_cpu_kill(unsigned int cpu)
   +{
   +
   +       return 1;
   +}
   +
    static int aspeed_g6_boot_secondary(unsigned int cpu, struct
   task_struct *idle)
    {
           void __iomem *base;
   @@ -56,6 +77,10 @@ static void __init aspeed_g6_smp_prepare_cpus
   (unsigned int max_cpus)
    static const struct smp_operations aspeed_smp_ops __initconst = {
           .smp_prepare_cpus       = aspeed_g6_smp_prepare_cpus,
           .smp_boot_secondary     = aspeed_g6_boot_secondary,
   +#ifdef CONFIG_HOTPLUG_CPU
   +       .cpu_die                = aspeed_g6_cpu_die,
   +       .cpu_kill               = aspeed_g6_cpu_kill,
   +#endif
    };

    CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp",
   &aspeed_smp_ops);
   bam at latitude-e5430:~/my_git/openbmc/openbmc/build/witherspoon-tacoma/workspace/sources/linux-aspeed
$

Thank you.

--
Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210218/a1f6d374/attachment-0001.htm>


More information about the openbmc mailing list