[PATCH 1/2] kexec: Default __NR_kexec_file_load is set to undefined

Baoquan He bhe at redhat.com
Tue Feb 28 05:32:26 PST 2023


Hi Philipp,

On 02/27/23 at 04:19pm, Philipp Rudo wrote:
...... 
> > diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
> > index be6ccd5..ea77936 100644
> > --- a/kexec/kexec-syscall.h
> > +++ b/kexec/kexec-syscall.h
> > @@ -59,9 +59,7 @@
> >  #endif
> >  #endif /*ifndef __NR_kexec_load*/
> >  
> > -#ifdef __arm__
> >  #undef __NR_kexec_file_load
> > -#endif
> >  
> >  #ifndef __NR_kexec_file_load
> 
> I don't think this will work as intended. 
> 
> On the top of the file sys/syscall.h gets included. In there
> architectures that support kexec_file_load define __NR_kexec_file_load.
> This also means that if an architecture doesn't support kexec_file_load
> __NR_kexec_file_load shouldn't be defined in the first place. Thus I
> suggest that you find out why sys/syscall.h defines
> __NR_kexec_file_load for LoongArch even when the system call is not
> supported and fix it there.

Checking whether LoongArch has defined __NR_kexec_file_load sounds a
good suggestion. Wondering why we still need add __NR_kexec_file_load
definition in kexec-tools. E.g below s390 kexec_file support you added.
<sys/syscall.h> sometime won't be found or __NR_kexec_file_load could be
not defined yet?

commit d4a948c268272cf37c71be820fb02bf40e56292b
Author: Philipp Rudo <prudo at linux.ibm.com>
Date:   Wed May 16 14:27:18 2018 +0200

    kexec/s390: Add support for kexec_file_load




More information about the kexec mailing list