64-bit kernels and 32-bit user-space

Arend van Spriel arend.vanspriel at broadcom.com
Wed May 3 04:43:30 PDT 2023


On 5/2/2023 2:55 PM, Arend van Spriel wrote:
> 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

> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4219 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20230503/2c7a1651/attachment-0001.p7s>


More information about the kexec mailing list