All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <jroedel@suse.de>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] x86/boot: Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h
Date: Thu, 8 Oct 2020 11:11:32 +0200	[thread overview]
Message-ID: <20201008091132.GE3209@suse.de> (raw)
In-Reply-To: <20201007195351.776555-3-nivedita@alum.mit.edu>

On Wed, Oct 07, 2020 at 03:53:48PM -0400, Arvind Sankar wrote:
> Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h for easier
> use from multiple files.
> 
> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
> ---
>  arch/x86/boot/compressed/cmdline.c |  8 --------
>  arch/x86/boot/compressed/kaslr.c   |  6 ------
>  arch/x86/boot/compressed/misc.h    | 13 +++++++++++++
>  3 files changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c
> index f1add5d85da9..d0e1d386749d 100644
> --- a/arch/x86/boot/compressed/cmdline.c
> +++ b/arch/x86/boot/compressed/cmdline.c
> @@ -12,14 +12,6 @@ static inline char rdfs8(addr_t addr)
>  	return *((char *)(fs + addr));
>  }
>  #include "../cmdline.c"
> -unsigned long get_cmd_line_ptr(void)
> -{
> -	unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
> -
> -	cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
> -
> -	return cmd_line_ptr;
> -}
>  int cmdline_find_option(const char *option, char *buffer, int bufsize)
>  {
>  	return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index b59547ce5b19..f3286a3bef36 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -36,12 +36,6 @@
>  #define STATIC
>  #include <linux/decompress/mm.h>
>  
> -#define _SETUP
> -#include <asm/setup.h>	/* For COMMAND_LINE_SIZE */
> -#undef _SETUP
> -
> -extern unsigned long get_cmd_line_ptr(void);
> -
>  /* Simplified build-specific string for starting entropy. */
>  static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"
>  		LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION;
> diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
> index 6d31f1b4c4d1..95aacc361f78 100644
> --- a/arch/x86/boot/compressed/misc.h
> +++ b/arch/x86/boot/compressed/misc.h
> @@ -25,6 +25,10 @@
>  #include <asm/bootparam.h>
>  #include <asm/desc_defs.h>
>  
> +#define _SETUP
> +#include <asm/setup.h>	/* For COMMAND_LINE_SIZE */
> +#undef _SETUP
> +
>  #define BOOT_CTYPE_H
>  #include <linux/acpi.h>
>  
> @@ -70,6 +74,15 @@ static inline void debug_puthex(unsigned long value)
>  #endif
>  
>  /* cmdline.c */
> +static inline
> +unsigned long get_cmd_line_ptr(void)
> +{
> +	unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
> +
> +	cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
> +
> +	return cmd_line_ptr;
> +}
>  int cmdline_find_option(const char *option, char *buffer, int bufsize);
>  int cmdline_find_option_bool(const char *option);

Reviewed-by: Joerg Roedel <jroedel@suse.de>

  reply	other threads:[~2020-10-08  9:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 19:53 [PATCH 0/5] Couple of bugfixes to sev-es series Arvind Sankar
2020-10-07 19:53 ` [PATCH 1/5] x86/boot: Initialize boot_params in startup code Arvind Sankar
2020-10-08  9:04   ` Joerg Roedel
2020-10-08 13:44     ` Arvind Sankar
2020-10-07 19:53 ` [PATCH 2/5] x86/boot: Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h Arvind Sankar
2020-10-08  9:11   ` Joerg Roedel [this message]
2020-10-08  9:30   ` Borislav Petkov
2020-10-08 13:47     ` Arvind Sankar
2020-10-08 15:10       ` Borislav Petkov
2020-10-08 15:30         ` Arvind Sankar
2020-10-08 16:16           ` Borislav Petkov
2020-10-07 19:53 ` [PATCH 3/5] x86/boot/64: Change add_identity_map() to take size for ease of use Arvind Sankar
2020-10-08  9:14   ` Joerg Roedel
2020-10-08 13:49     ` Arvind Sankar
2020-10-07 19:53 ` [PATCH 4/5] x86/boot/64: Explicitly map boot_params and command line Arvind Sankar
2020-10-08  9:17   ` Joerg Roedel
2020-10-08  9:48   ` Joerg Roedel
2020-10-08 13:57     ` Arvind Sankar
2020-10-07 19:53 ` [PATCH 5/5] x86/head/64: Disable stack protection for head$(BITS).o Arvind Sankar
2020-10-08  8:42   ` Joerg Roedel
2020-10-08 14:52     ` Arvind Sankar

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=20201008091132.GE3209@suse.de \
    --to=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@kernel.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.