From: Aurelien Jarno <aurelien@aurel32.net>
To: Dengcheng Zhu <dzhu@wavecomp.com>
Cc: pburton@wavecomp.com, ralf@linux-mips.org,
linux-mips@vger.kernel.org, rachel.mozes@intel.com
Subject: Re: [PATCH v5 2/5] MIPS: kexec: Make a framework for both jumping and halting on nonboot CPUs
Date: Thu, 27 Dec 2018 21:02:22 +0100 [thread overview]
Message-ID: <20181227200222.GA29774@aurel32.net> (raw)
In-Reply-To: <20180911214924.21993-3-dzhu@wavecomp.com>
On 2018-09-11 14:49, Dengcheng Zhu wrote:
> The existing implementation lets machine_kexec() CPU jump to reboot code
> buffer, whereas other CPUs to relocated_kexec_smp_wait. The natural way to
> bring up an SMP new kernel would be to let CPU0 do it while others being
> halted. For those failing to do so, fall back to the jumping method.
>
> Signed-off-by: Dengcheng Zhu <dzhu@wavecomp.com>
> ---
> arch/mips/cavium-octeon/smp.c | 7 +++
> arch/mips/include/asm/kexec.h | 5 +-
> arch/mips/include/asm/smp-ops.h | 3 +
> arch/mips/include/asm/smp.h | 16 +++++
> arch/mips/kernel/crash.c | 4 +-
> arch/mips/kernel/machine_kexec.c | 88 ++++++++++++++++++++++++---
> arch/mips/kernel/smp-bmips.c | 7 +++
> arch/mips/loongson64/loongson-3/smp.c | 4 ++
> 8 files changed, 124 insertions(+), 10 deletions(-)
>
[ snip ]
> diff --git a/arch/mips/include/asm/kexec.h b/arch/mips/include/asm/kexec.h
> index 493a3cc7c39a..5eeb648c4e3a 100644
> --- a/arch/mips/include/asm/kexec.h
> +++ b/arch/mips/include/asm/kexec.h
> @@ -39,11 +39,12 @@ extern unsigned long kexec_args[4];
> extern int (*_machine_kexec_prepare)(struct kimage *);
> extern void (*_machine_kexec_shutdown)(void);
> extern void (*_machine_crash_shutdown)(struct pt_regs *regs);
> -extern void default_machine_crash_shutdown(struct pt_regs *regs);
> +void default_machine_crash_shutdown(struct pt_regs *regs);
> +void kexec_nonboot_cpu_jump(void);
> +void kexec_reboot(void);
> #ifdef CONFIG_SMP
> extern const unsigned char kexec_smp_wait[];
> extern unsigned long secondary_kexec_args[4];
> -extern void (*relocated_kexec_smp_wait) (void *);
> extern atomic_t kexec_ready_to_reboot;
> extern void (*_crash_smp_send_stop)(void);
> #endif
[ snip ]
> diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c
> index 4b3726e4fe3a..c63c1f52d1c5 100644
> --- a/arch/mips/kernel/machine_kexec.c
> +++ b/arch/mips/kernel/machine_kexec.c
> @@ -19,15 +19,19 @@ extern const size_t relocate_new_kernel_size;
> extern unsigned long kexec_start_address;
> extern unsigned long kexec_indirection_page;
>
> -int (*_machine_kexec_prepare)(struct kimage *) = NULL;
> -void (*_machine_kexec_shutdown)(void) = NULL;
> -void (*_machine_crash_shutdown)(struct pt_regs *regs) = NULL;
> +static unsigned long reboot_code_buffer;
> +
> #ifdef CONFIG_SMP
> -void (*relocated_kexec_smp_wait) (void *);
> +static void (*relocated_kexec_smp_wait)(void *);
> +
> atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0);
> void (*_crash_smp_send_stop)(void) = NULL;
> #endif
The above changes broke kexec support on Octeon, as
relocated_kexec_smp_wait() is still called from octeon_kexec_smp_down():
| gcc-8 -Wp,-MD,arch/mips/cavium-octeon/.setup.o.d -nostdinc -isystem /usr/lib/gcc/mips-linux-gnu/8/include -I/<<PKGBUILDDIR>>/arch/mips/include -I./arch/mips/include/generated -I/<<PKGBUILDDIR>>/include -I./include -I/<<PKGBUILDDIR>>/arch/mips/include/uapi -I./arch/mips/include/generated/uapi -I/<<PKGBUILDDIR>>/include/uapi -I./include/generated/uapi -include /<<PKGBUILDDIR>>/include/linux/kconfig.h -include /<<PKGBUILDDIR>>/include/linux/compiler_types.h -I/<<PKGBUILDDIR>>/arch/mips/cavium-octeon -Iarch/mips/cavium-octeon -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff81100000 -DDATAOFFSET=0 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mmcount-ra-address -DKBUILD_MCOUNT_RA_ADDRESS -mno-check-zero-division -mabi=64 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -fno-stack-chec
k -march=octeon -Wa,--trap -Wa,-mfix-cn63xxp1 -DTOOLCHAIN_SUPPORTS_VIRT -DTOOLCHAIN_SUPPORTS_XPA -DTOOLCHAIN_SUPPORTS_CRC -DTOOLCHAIN_SUPPORTS_DSP -I/<<PKGBUILDDIR>>/arch/mips/include/asm/mach-cavium-octeon -I/<<PKGBUILDDIR>>/arch/mips/include/asm/mach-generic -msym32 -DKBUILD_64BIT_SYM32 -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=/<<PKGBUILDDIR>>/= -Wno-packed-not-aligned -fdebug-
prefix-map=/<<PKGBUILDDIR>>=. -DKBUILD_BASENAME='"setup"' -DKBUILD_MODNAME='"setup"' -c -o arch/mips/cavium-octeon/.tmp_setup.o /<<PKGBUILDDIR>>/arch/mips/cavium-octeon/setup.c
| /<<PKGBUILDDIR>>/arch/mips/cavium-octeon/setup.c: In function 'octeon_kexec_smp_down':
| /<<PKGBUILDDIR>>/arch/mips/cavium-octeon/setup.c:99:2: error: implicit declaration of function 'relocated_kexec_smp_wait'; did you mean 'octeon_kexec_smp_down'? [-Werror=implicit-function-declaration]
| relocated_kexec_smp_wait(NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| octeon_kexec_smp_down
|
| cc1: some warnings being treated as errors
| make[7]: *** [/<<PKGBUILDDIR>>/scripts/Makefile.build:296: arch/mips/cavium-octeon/setup.o] Error 1
| make[6]: *** [/<<PKGBUILDDIR>>/scripts/Makefile.build:521: arch/mips/cavium-octeon] Error 2
Regards,
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2018-12-27 20:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 21:49 [PATCH v5 0/5] MIPS: kexec/kdump: Fix smp reboot and other issues Dengcheng Zhu
2018-09-11 21:49 ` [PATCH v5 1/5] MIPS: kexec: Mark CPU offline before disabling local IRQ Dengcheng Zhu
2018-09-11 21:49 ` [PATCH v5 2/5] MIPS: kexec: Make a framework for both jumping and halting on nonboot CPUs Dengcheng Zhu
2018-12-27 20:02 ` Aurelien Jarno [this message]
2018-09-11 21:49 ` [PATCH v5 3/5] MIPS: kexec: CPS systems to halt " Dengcheng Zhu
2018-09-11 21:49 ` [PATCH v5 4/5] MIPS: kexec: Relax memory restriction Dengcheng Zhu
2018-09-11 21:49 ` [PATCH v5 5/5] MIPS: kexec: Use prepare method from Generic for UHI platforms Dengcheng Zhu
2018-09-23 0:23 ` [PATCH v5 0/5] MIPS: kexec/kdump: Fix smp reboot and other issues Paul Burton
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=20181227200222.GA29774@aurel32.net \
--to=aurelien@aurel32.net \
--cc=dzhu@wavecomp.com \
--cc=linux-mips@vger.kernel.org \
--cc=pburton@wavecomp.com \
--cc=rachel.mozes@intel.com \
--cc=ralf@linux-mips.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.