diff mbox series

[1/1] arch: x86: lib: Add support of legacy 64-bit entry point at 0x200

Message ID 20241120103943.886802-1-paul.henrys_ext@softathome.com
State Accepted
Commit 37f0c32ca2590135304f6d1c1acebca16681056e
Delegated to: Tom Rini
Headers show
Series [1/1] arch: x86: lib: Add support of legacy 64-bit entry point at 0x200 | expand

Commit Message

Paul HENRYS (EXT) Nov. 20, 2024, 10:39 a.m. UTC
Support of legacy 64-bit entry point was already present when booting a bzimage
with 'zboot' but not supported with 'bootm' when the x86_64 Linux kernel is
embedded in a FIT image.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
---
 arch/x86/lib/bootm.c  | 6 ++++++
 arch/x86/lib/zimage.c | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Simon Glass Nov. 20, 2024, 12:49 p.m. UTC | #1
On Wed, 20 Nov 2024 at 03:39, Paul HENRYS
<paul.henrys_ext@softathome.com> wrote:
>
> Support of legacy 64-bit entry point was already present when booting a bzimage
> with 'zboot' but not supported with 'bootm' when the x86_64 Linux kernel is
> embedded in a FIT image.
>
> Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
> ---
>  arch/x86/lib/bootm.c  | 6 ++++++
>  arch/x86/lib/zimage.c | 1 -
>  2 files changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
> index 55f581836d..38b4ebf759 100644
> --- a/arch/x86/lib/bootm.c
> +++ b/arch/x86/lib/bootm.c
> @@ -189,6 +189,12 @@ int boot_linux_kernel(ulong setup_base, ulong entry, bool image_64bit)
>                 if (CONFIG_IS_ENABLED(X86_64)) {
>                         typedef void (*h_func)(ulong zero, ulong setup);
>                         h_func func;
> +                       struct setup_header *hdr = &(((struct boot_params *)(setup_base))->hdr);
> +
> +                       /* Handle kernel with legacy 64-bit entry point at 0x200 */
> +                       if (hdr->xloadflags & XLF_KERNEL_64) {
> +                               entry += 0x200;
> +                       }
>
>                         /* jump to Linux with rdi=0, rsi=setup_base */
>                         func = (h_func)entry;
> diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
> index 73a21bc8f0..2eece34a07 100644
> --- a/arch/x86/lib/zimage.c
> +++ b/arch/x86/lib/zimage.c
> @@ -426,7 +426,6 @@ int zboot_go(void)
>         image_64bit = false;
>         if (IS_ENABLED(CONFIG_X86_RUN_64BIT) &&
>             (hdr->xloadflags & XLF_KERNEL_64)) {
> -               entry += 0x200;
>                 image_64bit = true;
>         }
>
> --
> 2.43.0
>
> -- This message and any attachments herein are, unless otherwise stated, confidential, intended solely for the addressees and are SoftAtHome’s ownership. Any unauthorized use, reproduction or dissemination is prohibited unless formaly agreed beforehand by the sender. If you are not the intended addressee of this message, please immediately delete it and all its attachments from your computer system and notify the sender. SoftAtHome reserves the right to monitor all email communications through its networks. Any views or opinions presented are solely those of its author and do not necessarily represent those of SoftAtHome. The internet cannot guarantee the integrity of this message. SoftAtHome not shall be liable for the message if altered, changed or falsified. While we take all reasonable precautions to ensure that viruses are not transmitted via emails, we recommend that you take your own measures to prevent viruses from entering your computer system. SoftAtHome is a French Société Anonyme with a Board of Directors, having a capital of 6 450 699 Euros having its registered office located at 9-11 rue du débarcadère – 92700 – Colombes – France – Tel + 33 (0)1 57 66 88 88 – Fax + 33 (0)1 57 66 88 89 - RCS Nanterre B 500 440 813 – Intra-Community VAT: FR 04500440813 -- Ce message et toutes les pièces jointes qui y sont incluses sont, sauf indication contraire, confidentiels, destinés uniquement aux destinataires et sont la propriété de SoftAtHome. Toute utilisation non autorisée, reproduction ou diffusion est interdite, sauf accord formel préalable de l'expéditeur. Si vous n'êtes pas le destinataire prévu de ce message, veuillez le supprimer immédiatement ainsi que toutes ses pièces jointes de votre système informatique et en informer l'expéditeur. SoftAtHome se réserve le droit de surveiller toutes les communications par e-mail via ses réseaux. Les opinions exprimées dans ce message sont celles de leur auteur et ne représentent pas nécessairement celles de SoftAtHome. L’Internet ne permettant pas d’assurer l’intégrité de ce message, SoftAtHome décline toute responsabilité à ce titre, dans l’hypothèse où il aurait été altéré, déformé ou falsifié. Par ailleurs et malgré toutes les précautions prises pour éviter la présence de virus dans nos envois, nous vous recommandons de prendre, de votre côté, les mesures permettant d'assurer la non-introduction de virus dans votre système informatique. SoftAtHome est une Société Anonyme française à Conseil d’Administration ayant un capital de 6 450 699 euros, dont le siège social est situé au 9-11 rue du débarcadère - 92700 - Colombes - France - Tel + 33 (0)1 57 66 88 88 - Fax + 33 (0)1 57 66 88 89 RCS Nanterre B 500 440 813 - TVA intracommunautaire : FR 04500440813

Can you please drop this when using the mailing list?

Regards,
Simon
Paul HENRYS d'AUBIGNY Nov. 20, 2024, 1:03 p.m. UTC | #2
Hi Simon, all,

I am really sorry about this automatic footer added by SoftAtHome's mail
server. I complained about it but the legal and IT departments did not
agree to remove it.
I will now send such a patch with my private email address and notify
SoftAtHome of it.
Sorry again for the inconvenience.

Best regards,
Paul HENRYS
PGP fingerprint: 1C45 321A 7830 4DCD 8453 2CE4 DF32 6222 6747 82F7
PGP key: https://pgp.mit.edu/pks/lookup?op=get&search=0xDF326222674782F7


Le mer. 20 nov. 2024 à 11:39, Paul HENRYS <paul.henrys_ext@softathome.com>
a écrit :

> Support of legacy 64-bit entry point was already present when booting a
> bzimage
> with 'zboot' but not supported with 'bootm' when the x86_64 Linux kernel is
> embedded in a FIT image.
>
> Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
> ---
>  arch/x86/lib/bootm.c  | 6 ++++++
>  arch/x86/lib/zimage.c | 1 -
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
> index 55f581836d..38b4ebf759 100644
> --- a/arch/x86/lib/bootm.c
> +++ b/arch/x86/lib/bootm.c
> @@ -189,6 +189,12 @@ int boot_linux_kernel(ulong setup_base, ulong entry,
> bool image_64bit)
>                 if (CONFIG_IS_ENABLED(X86_64)) {
>                         typedef void (*h_func)(ulong zero, ulong setup);
>                         h_func func;
> +                       struct setup_header *hdr = &(((struct boot_params
> *)(setup_base))->hdr);
> +
> +                       /* Handle kernel with legacy 64-bit entry point at
> 0x200 */
> +                       if (hdr->xloadflags & XLF_KERNEL_64) {
> +                               entry += 0x200;
> +                       }
>
>                         /* jump to Linux with rdi=0, rsi=setup_base */
>                         func = (h_func)entry;
> diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
> index 73a21bc8f0..2eece34a07 100644
> --- a/arch/x86/lib/zimage.c
> +++ b/arch/x86/lib/zimage.c
> @@ -426,7 +426,6 @@ int zboot_go(void)
>         image_64bit = false;
>         if (IS_ENABLED(CONFIG_X86_RUN_64BIT) &&
>             (hdr->xloadflags & XLF_KERNEL_64)) {
> -               entry += 0x200;
>                 image_64bit = true;
>         }
>
> --
> 2.43.0
>
> -- This message and any attachments herein are, unless otherwise stated,
> confidential, intended solely for the addressees and are SoftAtHome’s
> ownership. Any unauthorized use, reproduction or dissemination is
> prohibited unless formaly agreed beforehand by the sender. If you are not
> the intended addressee of this message, please immediately delete it and
> all its attachments from your computer system and notify the sender.
> SoftAtHome reserves the right to monitor all email communications through
> its networks. Any views or opinions presented are solely those of its
> author and do not necessarily represent those of SoftAtHome. The internet
> cannot guarantee the integrity of this message. SoftAtHome not shall be
> liable for the message if altered, changed or falsified. While we take all
> reasonable precautions to ensure that viruses are not transmitted via
> emails, we recommend that you take your own measures to prevent viruses
> from entering your computer system. SoftAtHome is a French Société Anonyme
> with a Board of Directors, having a capital of 6 450 699 Euros having its
> registered office located at 9-11 rue du débarcadère – 92700 – Colombes –
> France – Tel + 33 (0)1 57 66 88 88 – Fax + 33 (0)1 57 66 88 89 - RCS
> Nanterre B 500 440 813 – Intra-Community VAT: FR 04500440813 -- Ce message
> et toutes les pièces jointes qui y sont incluses sont, sauf indication
> contraire, confidentiels, destinés uniquement aux destinataires et sont la
> propriété de SoftAtHome. Toute utilisation non autorisée, reproduction ou
> diffusion est interdite, sauf accord formel préalable de l'expéditeur. Si
> vous n'êtes pas le destinataire prévu de ce message, veuillez le supprimer
> immédiatement ainsi que toutes ses pièces jointes de votre système
> informatique et en informer l'expéditeur. SoftAtHome se réserve le droit de
> surveiller toutes les communications par e-mail via ses réseaux. Les
> opinions exprimées dans ce message sont celles de leur auteur et ne
> représentent pas nécessairement celles de SoftAtHome. L’Internet ne
> permettant pas d’assurer l’intégrité de ce message, SoftAtHome décline
> toute responsabilité à ce titre, dans l’hypothèse où il aurait été altéré,
> déformé ou falsifié. Par ailleurs et malgré toutes les précautions prises
> pour éviter la présence de virus dans nos envois, nous vous recommandons de
> prendre, de votre côté, les mesures permettant d'assurer la
> non-introduction de virus dans votre système informatique. SoftAtHome est
> une Société Anonyme française à Conseil d’Administration ayant un capital
> de 6 450 699 euros, dont le siège social est situé au 9-11 rue du
> débarcadère - 92700 - Colombes - France - Tel + 33 (0)1 57 66 88 88 - Fax +
> 33 (0)1 57 66 88 89 RCS Nanterre B 500 440 813 - TVA intracommunautaire :
> FR 04500440813
>
Simon Glass Nov. 20, 2024, 1:38 p.m. UTC | #3
Hi Paul,

On Wed, 20 Nov 2024 at 06:03, Paul HENRYS d'AUBIGNY
<paul.henrysd@gmail.com> wrote:
>
> Hi Simon, all,
>
> I am really sorry about this automatic footer added by SoftAtHome's mail server. I complained about it but the legal and IT departments did not agree to remove it.
> I will now send such a patch with my private email address and notify SoftAtHome of it.
> Sorry again for the inconvenience.

Thank you. It makes me wonder what the meaning of your signoff on the
patch, since it seems in conflict with the idea of sending a patch to
a mailing list. Are SoftAtHome's lawyers trying to assert that the
patches are not subject to GPL, or something else?

Anyway, thanks for adjusting it.

Regards,
Simon
Tom Rini Dec. 18, 2024, 11:26 p.m. UTC | #4
On Wed, 20 Nov 2024 11:39:43 +0100, Paul HENRYS wrote:

> Support of legacy 64-bit entry point was already present when booting a bzimage
> with 'zboot' but not supported with 'bootm' when the x86_64 Linux kernel is
> embedded in a FIT image.
> 
> 

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 55f581836d..38b4ebf759 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -189,6 +189,12 @@  int boot_linux_kernel(ulong setup_base, ulong entry, bool image_64bit)
 		if (CONFIG_IS_ENABLED(X86_64)) {
 			typedef void (*h_func)(ulong zero, ulong setup);
 			h_func func;
+			struct setup_header *hdr = &(((struct boot_params *)(setup_base))->hdr);
+
+			/* Handle kernel with legacy 64-bit entry point at 0x200 */
+			if (hdr->xloadflags & XLF_KERNEL_64) {
+				entry += 0x200;
+			}
 
 			/* jump to Linux with rdi=0, rsi=setup_base */
 			func = (h_func)entry;
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 73a21bc8f0..2eece34a07 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -426,7 +426,6 @@  int zboot_go(void)
 	image_64bit = false;
 	if (IS_ENABLED(CONFIG_X86_RUN_64BIT) &&
 	    (hdr->xloadflags & XLF_KERNEL_64)) {
-		entry += 0x200;
 		image_64bit = true;
 	}