mbox series

[0/3] RISC-V: Add kexec/kdump support

Message ID 20200424171214.1515457-1-mick@ics.forth.gr (mailing list archive)
Headers show
Series RISC-V: Add kexec/kdump support | expand

Message

Nick Kossifidis April 24, 2020, 5:12 p.m. UTC
This patch series adds kexec/kdump and crash kernel
support on RISC-V. For testing the patches a patched
version of kexec-tools is needed. The patch is still
a work in progress but a draft version can be found at:

http://riscv.ics.forth.gr/kexec-tools.patch

Nick Kossifidis (3):
  RISC-V: Add kexec support
  RISC-V: Add kdump support
  RISC-V: Add crash kernel support

 arch/riscv/Kconfig                  |  24 +++
 arch/riscv/include/asm/kexec.h      |  54 +++++++
 arch/riscv/include/uapi/asm/elf.h   |   6 +
 arch/riscv/kernel/Makefile          |   3 +-
 arch/riscv/kernel/crash_dump.c      |  46 ++++++
 arch/riscv/kernel/crash_save_regs.S |  56 +++++++
 arch/riscv/kernel/kexec_relocate.S  | 217 ++++++++++++++++++++++++++++
 arch/riscv/kernel/machine_kexec.c   | 193 +++++++++++++++++++++++++
 arch/riscv/kernel/setup.c           |  63 ++++++++
 arch/riscv/mm/init.c                | 173 ++++++++++++++++++++++
 include/uapi/linux/kexec.h          |   1 +
 11 files changed, 835 insertions(+), 1 deletion(-)
 create mode 100644 arch/riscv/include/asm/kexec.h
 create mode 100644 arch/riscv/kernel/crash_dump.c
 create mode 100644 arch/riscv/kernel/crash_save_regs.S
 create mode 100644 arch/riscv/kernel/kexec_relocate.S
 create mode 100644 arch/riscv/kernel/machine_kexec.c

Comments

Nick Kossifidis May 21, 2020, 6:42 p.m. UTC | #1
Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
> This patch series adds kexec/kdump and crash kernel
> support on RISC-V. For testing the patches a patched
> version of kexec-tools is needed. The patch is still
> a work in progress but a draft version can be found at:
> 
> http://riscv.ics.forth.gr/kexec-tools.patch
> 

Any comments / feedback on this ? Should we get it in ?

Regards,
Nick
Nick Kossifidis June 11, 2020, 7:09 p.m. UTC | #2
Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
>> This patch series adds kexec/kdump and crash kernel
>> support on RISC-V. For testing the patches a patched
>> version of kexec-tools is needed. The patch is still
>> a work in progress but a draft version can be found at:
>> 
>> http://riscv.ics.forth.gr/kexec-tools.patch
>> 
> 
> Any comments / feedback on this ? Should we get it in ?
> 
> Regards,
> Nick

Anyone ?
Palmer Dabbelt June 11, 2020, 7:39 p.m. UTC | #3
On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
>>> This patch series adds kexec/kdump and crash kernel
>>> support on RISC-V. For testing the patches a patched
>>> version of kexec-tools is needed. The patch is still
>>> a work in progress but a draft version can be found at:
>>>
>>> http://riscv.ics.forth.gr/kexec-tools.patch
>>>
>>
>> Any comments / feedback on this ? Should we get it in ?
>>
>> Regards,
>> Nick
>
> Anyone ?

Sorry, I dropped the ball on this one.  After the CPU hotplug breakage I
decided I need to get a pre-merge test for all these new features, and I
haven't gotten around to actually doing so yet.  The merge window is closing
right now, so with any luck I'll have some time to get around to my patch
backlog -- first I need to go spin up some better testing, though.
Nick Kossifidis June 13, 2020, 7:24 a.m. UTC | #4
Στις 2020-06-11 22:39, Palmer Dabbelt έγραψε:
> On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
>> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
>>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
>>>> This patch series adds kexec/kdump and crash kernel
>>>> support on RISC-V. For testing the patches a patched
>>>> version of kexec-tools is needed. The patch is still
>>>> a work in progress but a draft version can be found at:
>>>> 
>>>> http://riscv.ics.forth.gr/kexec-tools.patch
>>>> 
>>> 
>>> Any comments / feedback on this ? Should we get it in ?
>>> 
>>> Regards,
>>> Nick
>> 
>> Anyone ?
> 
> Sorry, I dropped the ball on this one.  After the CPU hotplug breakage 
> I
> decided I need to get a pre-merge test for all these new features, and 
> I
> haven't gotten around to actually doing so yet.  The merge window is 
> closing
> right now, so with any luck I'll have some time to get around to my 
> patch
> backlog -- first I need to go spin up some better testing, though.

Anything I can do to help ? I have a bunch of hw available (unleashed, 
genesys2 and nexys 2 ddr for Ariane / LowRISC SoC) and I'll probably 
also need to have a CI flow for the stuff I do internally.
Anup Patel June 13, 2020, 8:17 a.m. UTC | #5
> -----Original Message-----
> From: linux-riscv <linux-riscv-bounces@lists.infradead.org> On Behalf Of Nick
> Kossifidis
> Sent: 13 June 2020 12:54
> To: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: david.abdurachmanov@sifive.com; anup@brainfault.org; Atish Patra
> <Atish.Patra@wdc.com>; yibin_liu@c-sky.com; Paul Walmsley
> <paul.walmsley@sifive.com>; mick@ics.forth.gr; linux-
> riscv@lists.infradead.org
> Subject: Re: [PATCH 0/3] RISC-V: Add kexec/kdump support
> 
> Στις 2020-06-11 22:39, Palmer Dabbelt έγραψε:
> > On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
> >> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
> >>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
> >>>> This patch series adds kexec/kdump and crash kernel support on
> >>>> RISC-V. For testing the patches a patched version of kexec-tools is
> >>>> needed. The patch is still a work in progress but a draft version
> >>>> can be found at:
> >>>>
> >>>> http://riscv.ics.forth.gr/kexec-tools.patch
> >>>>
> >>>
> >>> Any comments / feedback on this ? Should we get it in ?
> >>>
> >>> Regards,
> >>> Nick
> >>
> >> Anyone ?
> >
> > Sorry, I dropped the ball on this one.  After the CPU hotplug breakage
> > I decided I need to get a pre-merge test for all these new features,
> > and I haven't gotten around to actually doing so yet.  The merge
> > window is closing right now, so with any luck I'll have some time to
> > get around to my patch backlog -- first I need to go spin up some
> > better testing, though.
> 
> Anything I can do to help ? I have a bunch of hw available (unleashed,
> genesys2 and nexys 2 ddr for Ariane / LowRISC SoC) and I'll probably also
> need to have a CI flow for the stuff I do internally.

I had send-out a fix for CPU hotplug which can be taken for
any of the Linux-5.8-rcX.

These patches should be based upon the CPU hotplug fix.

Regards,
Anup
Nick Kossifidis June 13, 2020, 8:21 a.m. UTC | #6
Στις 2020-06-13 11:17, Anup Patel έγραψε:
>> -----Original Message-----
>> From: linux-riscv <linux-riscv-bounces@lists.infradead.org> On Behalf 
>> Of Nick
>> Kossifidis
>> Sent: 13 June 2020 12:54
>> To: Palmer Dabbelt <palmer@dabbelt.com>
>> Cc: david.abdurachmanov@sifive.com; anup@brainfault.org; Atish Patra
>> <Atish.Patra@wdc.com>; yibin_liu@c-sky.com; Paul Walmsley
>> <paul.walmsley@sifive.com>; mick@ics.forth.gr; linux-
>> riscv@lists.infradead.org
>> Subject: Re: [PATCH 0/3] RISC-V: Add kexec/kdump support
>> 
>> Στις 2020-06-11 22:39, Palmer Dabbelt έγραψε:
>> > On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
>> >> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
>> >>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
>> >>>> This patch series adds kexec/kdump and crash kernel support on
>> >>>> RISC-V. For testing the patches a patched version of kexec-tools is
>> >>>> needed. The patch is still a work in progress but a draft version
>> >>>> can be found at:
>> >>>>
>> >>>> http://riscv.ics.forth.gr/kexec-tools.patch
>> >>>>
>> >>>
>> >>> Any comments / feedback on this ? Should we get it in ?
>> >>>
>> >>> Regards,
>> >>> Nick
>> >>
>> >> Anyone ?
>> >
>> > Sorry, I dropped the ball on this one.  After the CPU hotplug breakage
>> > I decided I need to get a pre-merge test for all these new features,
>> > and I haven't gotten around to actually doing so yet.  The merge
>> > window is closing right now, so with any luck I'll have some time to
>> > get around to my patch backlog -- first I need to go spin up some
>> > better testing, though.
>> 
>> Anything I can do to help ? I have a bunch of hw available (unleashed,
>> genesys2 and nexys 2 ddr for Ariane / LowRISC SoC) and I'll probably 
>> also
>> need to have a CI flow for the stuff I do internally.
> 
> I had send-out a fix for CPU hotplug which can be taken for
> any of the Linux-5.8-rcX.
> 
> These patches should be based upon the CPU hotplug fix.
> 
> Regards,
> Anup

I only call smp_shutdown_nonboot_cpus(), the patches shouldn't need any 
updates but I'll do a re-check just in case.
Palmer Dabbelt June 18, 2020, 11:06 p.m. UTC | #7
On Sat, 13 Jun 2020 00:24:01 PDT (-0700), mick@ics.forth.gr wrote:
> Στις 2020-06-11 22:39, Palmer Dabbelt έγραψε:
>> On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
>>> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
>>>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
>>>>> This patch series adds kexec/kdump and crash kernel
>>>>> support on RISC-V. For testing the patches a patched
>>>>> version of kexec-tools is needed. The patch is still
>>>>> a work in progress but a draft version can be found at:
>>>>>
>>>>> http://riscv.ics.forth.gr/kexec-tools.patch
>>>>>
>>>>
>>>> Any comments / feedback on this ? Should we get it in ?
>>>>
>>>> Regards,
>>>> Nick
>>>
>>> Anyone ?
>>
>> Sorry, I dropped the ball on this one.  After the CPU hotplug breakage
>> I
>> decided I need to get a pre-merge test for all these new features, and
>> I
>> haven't gotten around to actually doing so yet.  The merge window is
>> closing
>> right now, so with any luck I'll have some time to get around to my
>> patch
>> backlog -- first I need to go spin up some better testing, though.
>
> Anything I can do to help ? I have a bunch of hw available (unleashed,
> genesys2 and nexys 2 ddr for Ariane / LowRISC SoC) and I'll probably
> also need to have a CI flow for the stuff I do internally.

Well, getting CI up and running would be great -- specifically, running stress
tests on real hardware is something we're missing.
Nick Kossifidis June 19, 2020, 8:27 a.m. UTC | #8
Στις 2020-06-19 02:06, Palmer Dabbelt έγραψε:
> On Sat, 13 Jun 2020 00:24:01 PDT (-0700), mick@ics.forth.gr wrote:
>> Στις 2020-06-11 22:39, Palmer Dabbelt έγραψε:
>>> On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
>>>> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
>>>>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
>>>>>> This patch series adds kexec/kdump and crash kernel
>>>>>> support on RISC-V. For testing the patches a patched
>>>>>> version of kexec-tools is needed. The patch is still
>>>>>> a work in progress but a draft version can be found at:
>>>>>> 
>>>>>> http://riscv.ics.forth.gr/kexec-tools.patch
>>>>>> 
>>>>> 
>>>>> Any comments / feedback on this ? Should we get it in ?
>>>>> 
>>>>> Regards,
>>>>> Nick
>>>> 
>>>> Anyone ?
>>> 
>>> Sorry, I dropped the ball on this one.  After the CPU hotplug 
>>> breakage
>>> I
>>> decided I need to get a pre-merge test for all these new features, 
>>> and
>>> I
>>> haven't gotten around to actually doing so yet.  The merge window is
>>> closing
>>> right now, so with any luck I'll have some time to get around to my
>>> patch
>>> backlog -- first I need to go spin up some better testing, though.
>> 
>> Anything I can do to help ? I have a bunch of hw available (unleashed,
>> genesys2 and nexys 2 ddr for Ariane / LowRISC SoC) and I'll probably
>> also need to have a CI flow for the stuff I do internally.
> 
> Well, getting CI up and running would be great -- specifically, running 
> stress
> tests on real hardware is something we're missing.

Any particular tests / test suites in mind ?
Atish Patra June 19, 2020, 5:23 p.m. UTC | #9
On Fri, Jun 19, 2020 at 1:27 AM Nick Kossifidis <mick@ics.forth.gr> wrote:
>
> Στις 2020-06-19 02:06, Palmer Dabbelt έγραψε:
> > On Sat, 13 Jun 2020 00:24:01 PDT (-0700), mick@ics.forth.gr wrote:
> >> Στις 2020-06-11 22:39, Palmer Dabbelt έγραψε:
> >>> On Thu, 11 Jun 2020 12:09:08 PDT (-0700), mick@ics.forth.gr wrote:
> >>>> Στις 2020-05-21 21:42, Nick Kossifidis έγραψε:
> >>>>> Στις 2020-04-24 20:12, Nick Kossifidis έγραψε:
> >>>>>> This patch series adds kexec/kdump and crash kernel
> >>>>>> support on RISC-V. For testing the patches a patched
> >>>>>> version of kexec-tools is needed. The patch is still
> >>>>>> a work in progress but a draft version can be found at:
> >>>>>>
> >>>>>> http://riscv.ics.forth.gr/kexec-tools.patch
> >>>>>>
> >>>>>
> >>>>> Any comments / feedback on this ? Should we get it in ?
> >>>>>
> >>>>> Regards,
> >>>>> Nick
> >>>>
> >>>> Anyone ?
> >>>
> >>> Sorry, I dropped the ball on this one.  After the CPU hotplug
> >>> breakage
> >>> I
> >>> decided I need to get a pre-merge test for all these new features,
> >>> and
> >>> I
> >>> haven't gotten around to actually doing so yet.  The merge window is
> >>> closing
> >>> right now, so with any luck I'll have some time to get around to my
> >>> patch
> >>> backlog -- first I need to go spin up some better testing, though.
> >>
> >> Anything I can do to help ? I have a bunch of hw available (unleashed,
> >> genesys2 and nexys 2 ddr for Ariane / LowRISC SoC) and I'll probably
> >> also need to have a CI flow for the stuff I do internally.
> >
> > Well, getting CI up and running would be great -- specifically, running
> > stress
> > tests on real hardware is something we're missing.
>
> Any particular tests / test suites in mind ?
>

I quickly checked kerneci project. They regularly build and does a boot test on
HiFive unleashed. Here is the log for the last successful boot test on 5.8-rc1.
https://kernelci.org/test/case/id/5ee3959b44cd149f2b97bf1b/

Can we leverage the same setup locally ?

+kevin

Is there any way to add more tests (lkp test may be ?) for riscv to
kernelci infrastructure ?