Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Anderson <anderson@redhat.com>
To: Bhupesh Sharma <bhsharma@redhat.com>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>,
	bhupesh linux <bhupesh.linux@gmail.com>,
	kexec@lists.infradead.org,
	Prabhakar Kushwaha <prabhakar.pkin@gmail.com>,
	crash-utility@redhat.com
Subject: Re: [PATCH] crash/arm64: Determine vabits_actual value from 'TCR_EL1.T1SZ' value in vmcoreinfo
Date: Tue, 19 Nov 2019 10:24:22 -0500 (EST)	[thread overview]
Message-ID: <1049422055.13569004.1574177062892.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1574169634-10329-1-git-send-email-bhsharma@redhat.com>


----- Original Message -----
> I have recently sent a kernel patch upstream to add 'TCR_EL1.T1SZ' to
> vmcoreinfo for arm64 (see [0]), instead of VA_BITS_ACTUAL.
> 
> 'crash' can read the 'TCR_EL1.T1SZ' value from vmcoreinfo
> [which indicates the size offset of the memory region addressed by
> TTBR1_EL1] and hence can be used for determining the vabits_actual
> value.

Thanks Bhupesh -- your patch has been queued for crash-7.2.8:

  https://github.com/crash-utility/crash/commit/bfd9a651f9426d86250295ac875d7e33d8de2a97

Dave


> 
> [0].http://lists.infradead.org/pipermail/kexec/2019-November/023962.html
> 
> Cc: Dave Anderson <anderson@redhat.com>
> Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Cc: Prabhakar Kushwaha <prabhakar.pkin@gmail.com>
> Cc: crash-utility@redhat.com
> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
> ---
>  arm64.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/arm64.c b/arm64.c
> index af7147d24e20..083491331985 100644
> --- a/arm64.c
> +++ b/arm64.c
> @@ -3856,8 +3856,17 @@ arm64_calc_VA_BITS(void)
>  		} else if (ACTIVE())
>  			error(FATAL, "cannot determine VA_BITS_ACTUAL: please use
>  			/proc/kcore\n");
>  		else {
> -			if ((string = pc->read_vmcoreinfo("NUMBER(VA_BITS_ACTUAL)"))) {
> -				value = atol(string);
> +			if ((string = pc->read_vmcoreinfo("NUMBER(tcr_el1_t1sz)"))) {
> +				/* See ARMv8 ARM for the description of
> +				 * TCR_EL1.T1SZ and how it can be used
> +				 * to calculate the vabits_actual
> +				 * supported by underlying kernel.
> +				 *
> +				 * Basically:
> +				 * vabits_actual = 64 - T1SZ;
> +				 */
> +				value = 64 - strtoll(string, NULL, 0);
> +				fprintf(fp,  "vmcoreinfo : vabits_actual: %ld\n", value);
>  				free(string);
>  				machdep->machspec->VA_BITS_ACTUAL = value;
>  				machdep->machspec->VA_BITS = value;
> --
> 2.7.4
> 
> 


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

           reply	other threads:[~2019-11-19 15:26 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1574169634-10329-1-git-send-email-bhsharma@redhat.com>]

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=1049422055.13569004.1574177062892.JavaMail.zimbra@redhat.com \
    --to=anderson@redhat.com \
    --cc=bhsharma@redhat.com \
    --cc=bhupesh.linux@gmail.com \
    --cc=crash-utility@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=prabhakar.pkin@gmail.com \
    --cc=takahiro.akashi@linaro.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