Skip to contentSkip to conversation

64-bit kernels and 32-bit user-space

DISCUSSION Arend van Spriel 1 participant 2 messages May 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I am trying to get a kernel crashdump on an embedded router, but it has 32-bit user-space while the kernel is 64-bit. I tried something simple and got following:

# kexec -S
Unsupported machine type: aarch64

Looking in the build directory I only see arch/arm/ folder, but no arch/arm64. Is this due to 32-bit user-space? Has someone tried kexec in such an environment? Any pointers would be appreciated.

Regards,
Arend

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

#1 lore raw
Quoted 4 lines · Arend van Spriel

I am trying to get a kernel crashdump on an embedded router, but it has 32-bit user-space while the kernel is 64-bit. I tried something simple and got following:

# kexec -S
Unsupported machine type: aarch64

Clone the git repo and looked into the kexec message shown above, which is found in the function physical_arch(). It basically does a 'uname -m' and does a lookup in arches array. The problem is that on my platform it tries to lookup aarch64, which is not found.

Regarding the lookup I see:

	for (i = 0; arches[i].machine; ++i) {
		if (strcmp(utsname.machine, arches[i].machine) == 0)
			return arches[i].arch;
		if ((strcmp(arches[i].machine, "arm") == 0) &&
		    (strncmp(utsname.machine, arches[i].machine,
		     strlen(arches[i].machine)) == 0))
			return arches[i].arch;
	}

So the second if-statement means any utsname matching arm.* regexp, eg. arm64, will return arches[0].arch from arch/arm/kexec-arm.c, ie. KEXEC_ARCH_ARM, right? So can I conclude that 32-bit kexec can load and execute a 64-bit kernel?

Regards,
Arend

Quoted 4 lines

Looking in the build directory I only see arch/arm/ folder, but no arch/arm64. Is this due to 32-bit user-space? Has someone tried kexec in such an environment? Any pointers would be appreciated.

Regards,
Arend

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