Skip to contentSkip to conversation

crash/arm64: Determine vabits_actual value from 'TCR_EL1.T1SZ' value in vmcoreinfo

PATCH Dave Anderson 1 participant 1 message Nov 19, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

----- Original Message -----

Quoted 7 lines

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

Quoted 36 lines

[0].http://lists.infradead.org/pipermail/kexec/2019-November/023962.html

Cc Dave Anderson <[email protected]>
Cc AKASHI Takahiro <[email protected]>
Cc Prabhakar Kushwaha <[email protected]>
---
 arm64.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
arm64.c +11 -2
index af7147d24e20..083491331985 100644
@@ -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;
Quoted 5 lines

machdep->machspec->VA_BITS = value;
--
2.7.4

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec