mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Borisov <nik.borisov@suse.com>
To: Wei Yang <richard.weiyang@gmail.com>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] x86/boot: replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR
Date: Wed, 13 Mar 2024 12:29:37 +0200	[thread overview]
Message-ID: <d167bf69-64f7-4b7b-81ee-054f05d39c98@suse.com> (raw)
In-Reply-To: <20240313075839.8321-3-richard.weiyang@gmail.com>



On 13.03.24 г. 9:58 ч., Wei Yang wrote:
> Both __PHYSICAL_START and LOAD_PHYSICAL_ADDR are defined to get aligned
> CONFIG_PHYSICAL_START, so we can replace __PHYSICAL_START with
> LOAD_PHYSICAL_ADDR. And then remove the definition of __PHYSICAL_START,
> which is only used to define __START_KERNEL.
> 
> Since <asm/boot.h> includes <asm/pgtable_types.h>, which includes
> <asm/page_types.h>, it is fine to move definition from <asm/boot.h> to
> <asm/page_types.h>.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> ---
>   arch/x86/include/asm/boot.h       | 5 -----
>   arch/x86/include/asm/page_types.h | 8 +++++---
>   2 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
> index a38cc0afc90a..12cbc57d0128 100644
> --- a/arch/x86/include/asm/boot.h
> +++ b/arch/x86/include/asm/boot.h
> @@ -6,11 +6,6 @@
>   #include <asm/pgtable_types.h>
>   #include <uapi/asm/boot.h>
>   
> -/* Physical address where kernel should be loaded. */
> -#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
> -				+ (CONFIG_PHYSICAL_ALIGN - 1)) \
> -				& ~(CONFIG_PHYSICAL_ALIGN - 1))
> -
>   /* Minimum kernel alignment, as a power of two */
>   #ifdef CONFIG_X86_64
>   # define MIN_KERNEL_ALIGN_LG2	PMD_SHIFT
> diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
> index 86bd4311daf8..acc1620fd121 100644
> --- a/arch/x86/include/asm/page_types.h
> +++ b/arch/x86/include/asm/page_types.h
> @@ -31,10 +31,12 @@
>   
>   #define VM_DATA_DEFAULT_FLAGS	VM_DATA_FLAGS_TSK_EXEC
>   
> -#define __PHYSICAL_START	ALIGN(CONFIG_PHYSICAL_START, \
> -				      CONFIG_PHYSICAL_ALIGN)
> +/* Physical address where kernel should be loaded. */
> +#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
> +				+ (CONFIG_PHYSICAL_ALIGN - 1)) \
> +				& ~(CONFIG_PHYSICAL_ALIGN - 1))

Why don't you simply define LOAD_PHYSICAL_ADDR via 
ALIGN(CONFIG_PHYSICAL_START, CONFIG_PHYSICAL_ALING) it's way more readable.

>   
> -#define __START_KERNEL		(__START_KERNEL_map + __PHYSICAL_START)
> +#define __START_KERNEL		(__START_KERNEL_map + LOAD_PHYSICAL_ADDR)
>   
>   #ifdef CONFIG_X86_64
>   #include <asm/page_64_types.h>

  parent reply	other threads:[~2024-03-13 10:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  7:58 [PATCH 0/4] Cleanup vmlinux.lds.S Wei Yang
2024-03-13  7:58 ` [PATCH 1/4] vmlinux.lds.h: fix a typo in comment Wei Yang
2024-03-13 10:39   ` [tip: x86/build] vmlinux.lds.h: Fix " tip-bot2 for Wei Yang
2024-03-13  7:58 ` [PATCH 2/4] x86/boot: replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR Wei Yang
2024-03-13 10:29   ` Ingo Molnar
2024-03-14  0:54     ` Wei Yang
2024-03-14  3:23     ` Wei Yang
2024-03-14  9:25       ` Ingo Molnar
2024-03-15  0:57         ` Wei Yang
2024-03-16 17:44           ` Wei Yang
2024-03-13 10:29   ` Nikolay Borisov [this message]
2024-03-14  0:54     ` Wei Yang
2024-03-22 10:59   ` [tip: x86/build] x86/boot: Replace " tip-bot2 for Wei Yang
2024-03-13  7:58 ` [PATCH 3/4] x86/vmlinux.lds.S: remove conditional definition of LOAD_OFFSET Wei Yang
2024-03-13 10:39   ` [tip: x86/build] x86/vmlinux.lds.S: Remove " tip-bot2 for Wei Yang
2024-03-13 13:18     ` Borislav Petkov
2024-03-14  0:59       ` Wei Yang
2024-03-13  7:58 ` [PATCH 4/4] x86/vmlinux.lds.S: take __START_KERNEL out conditional definition Wei Yang
2024-03-13 10:39   ` [tip: x86/build] x86/vmlinux.lds.S: Take " tip-bot2 for Wei Yang

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=d167bf69-64f7-4b7b-81ee-054f05d39c98@suse.com \
    --to=nik.borisov@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=richard.weiyang@gmail.com \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®