All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Rudo <prudo@redhat.com>
To: Youling Tang <tangyouling@loongson.cn>
Cc: Simon Horman <horms@kernel.org>, kexec@lists.infradead.org
Subject: Re: [PATCH 1/2] kexec: Default __NR_kexec_file_load is set to undefined
Date: Mon, 27 Feb 2023 16:19:19 +0100	[thread overview]
Message-ID: <20230227161919.7c4884cd@rotkaeppchen> (raw)
In-Reply-To: <1677232268-2451-1-git-send-email-tangyouling@loongson.cn>

Hi Youling,

On Fri, 24 Feb 2023 17:51:07 +0800
Youling Tang <tangyouling@loongson.cn> wrote:

> The initial reason is that after the merger of 29fe5067ed07
> ("kexec: make -a the default"), kexec cannot be used on LoongArch,
> MIPS .etc architectures. We need to add "-c" for normal use. The
> current kexec_file_load system call is not implemented in
> architectures such as LoongArch, so it needs to pass kexec_load.
> So we need to set __NR_kexec_file_load to undefined in unsupported
> architectures. This will return EFALLBACK via is_kexec_file_load_implemented,
> and then via kexec_load.
> 
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>  kexec/kexec-syscall.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> 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.

Thanks
Philipp 


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

  parent reply	other threads:[~2023-02-27 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24  9:51 [PATCH 1/2] kexec: Default __NR_kexec_file_load is set to undefined Youling Tang
2023-02-24  9:51 ` [PATCH 2/2] LoongArch: kdump: Set up kernel image segment Youling Tang
2023-02-27 15:19 ` Philipp Rudo [this message]
2023-02-28 13:32   ` [PATCH 1/2] kexec: Default __NR_kexec_file_load is set to undefined Baoquan He
2023-03-03 11:03     ` Philipp Rudo
2023-03-07  3:28       ` Baoquan He
     [not found]   ` <eb34b2b5-3965-27f1-2fe5-bb4fda4ef16b@loongson.cn>
2023-03-03 10:54     ` Philipp Rudo

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=20230227161919.7c4884cd@rotkaeppchen \
    --to=prudo@redhat.com \
    --cc=horms@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=tangyouling@loongson.cn \
    /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.