Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: kexec@lists.infradead.org
Cc: Eric Biederman <ebiederm@xmission.com>
Subject: Re: 64-bit kernels and 32-bit user-space
Date: Wed, 3 May 2023 13:43:30 +0200	[thread overview]
Message-ID: <ce9aec4a-e8fe-56e7-dc96-0180375f7c37@broadcom.com> (raw)
In-Reply-To: <b4ada33d-f6a7-ad32-9de2-51968ea29af9@broadcom.com>


[-- Attachment #1.1: Type: text/plain, Size: 1335 bytes --]

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

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

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

      reply	other threads:[~2023-05-03 17:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 12:55 64-bit kernels and 32-bit user-space Arend van Spriel
2023-05-03 11:43 ` Arend van Spriel [this message]

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=ce9aec4a-e8fe-56e7-dc96-0180375f7c37@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.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