Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Rudo <prudo@redhat.com>
To: Pingfan Liu <piliu@redhat.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH 2/3] arm64/crashdump: unify routine to get page_offset
Date: Wed, 15 Dec 2021 14:35:12 +0100	[thread overview]
Message-ID: <20211215143512.4b0d745c@rhtmp> (raw)
In-Reply-To: <20211210030735.53155-3-piliu@redhat.com>

Hi Pinfang,

On Fri, 10 Dec 2021 11:07:34 +0800
Pingfan Liu <piliu@redhat.com> wrote:

> There are two funcs to get page_offset:
>   get_kernel_page_offset()
>   get_page_offset()
> 
> Since get_kernel_page_offset() does not observe the kernel formula, and
> remove it. Unify them in order to introduce 52-bits VA kernel more
> easily in the coming patch.
> 
> Signed-off-by: Pingfan Liu <piliu@redhat.com>
> ---
>  kexec/arch/arm64/crashdump-arm64.c | 23 +----------------------
>  kexec/arch/arm64/kexec-arm64.c     |  4 ++--
>  kexec/arch/arm64/kexec-arm64.h     |  1 +
>  3 files changed, 4 insertions(+), 24 deletions(-)
> 
> diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
> index a02019a..0a8d44c 100644
> --- a/kexec/arch/arm64/crashdump-arm64.c
> +++ b/kexec/arch/arm64/crashdump-arm64.c

[...]

> diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
> index 7373fa3..bd650e6 100644
> --- a/kexec/arch/arm64/kexec-arm64.c
> +++ b/kexec/arch/arm64/kexec-arm64.c
> @@ -909,7 +909,7 @@ static int get_va_bits(void)
>   * get_page_offset - Helper for getting PAGE_OFFSET
>   */
>  
> -static int get_page_offset(void)
> +int get_page_offset(unsigned long *page_offset)
>  {
>  	int ret;
>  

The new page_offset is never used in this patch. There's still the line
left with the global page_offset but that will cause a type miss-match
(unsigend long vs unsigned log *). In the next patch you do the update
(page_offset -> *page_offset) but in the meantime the code is broken.

Thanks
Philipp

> @@ -954,7 +954,7 @@ int get_phys_base_from_pt_load(long *phys_offset)
>  	unsigned long long phys_start;
>  	unsigned long long virt_start;
>  
> -	ret = get_page_offset();
> +	ret = get_page_offset(&page_offset);
>  	if (ret < 0)
>  		return ret;
>  
> diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
> index 1844b67..ed99d9d 100644
> --- a/kexec/arch/arm64/kexec-arm64.h
> +++ b/kexec/arch/arm64/kexec-arm64.h
> @@ -69,6 +69,7 @@ extern struct arm64_mem arm64_mem;
>  
>  uint64_t get_phys_offset(void);
>  uint64_t get_vp_offset(void);
> +int get_page_offset(unsigned long *offset);
>  
>  static inline void reset_vp_offset(void)
>  {


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

  reply	other threads:[~2021-12-15 13:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  3:07 [PATCH 0/3] arm64: make phys_to_virt() correct Pingfan Liu
2021-12-10  3:07 ` [PATCH 1/3] arm64: make phys_offset signed Pingfan Liu
2021-12-10  3:07 ` [PATCH 2/3] arm64/crashdump: unify routine to get page_offset Pingfan Liu
2021-12-15 13:35   ` Philipp Rudo [this message]
2021-12-16  2:58     ` Pingfan Liu
2021-12-10  3:07 ` [PATCH 3/3] arm64: read VA_BITS from kcore for 52-bits VA kernel Pingfan Liu
2021-12-15 13:34   ` Philipp Rudo
2021-12-16  2:46     ` Pingfan Liu
2021-12-16  3:05       ` Pingfan Liu
     [not found]   ` <20211215130557.GB4314@vergenet.net>
2021-12-16  1:59     ` Pingfan Liu
2021-12-16 11:02       ` Simon Horman
2021-12-15  1:43 ` [PATCH 0/3] arm64: make phys_to_virt() correct Pingfan Liu

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=20211215143512.4b0d745c@rhtmp \
    --to=prudo@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=piliu@redhat.com \
    /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