diff mbox

[U-Boot,v2,46/63] x86: Don't build call64 and setjmp on 64-bit

Message ID 1479587152-25065-47-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Nov. 19, 2016, 8:25 p.m. UTC
These are currently not supported. Calling 64-bit code from 64-bit U-Boot is
much simpler, so this code is not needed. setjmp() is not yet implemented for
64-bit.

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

Changes in v2: None

 arch/x86/cpu/Makefile | 6 +++++-
 arch/x86/lib/bootm.c  | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Bin Meng Jan. 14, 2017, 1:32 p.m. UTC | #1
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass <sjg@chromium.org> wrote:
> These are currently not supported. Calling 64-bit code from 64-bit U-Boot is
> much simpler, so this code is not needed. setjmp() is not yet implemented for
> 64-bit.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile | 6 +++++-
>  arch/x86/lib/bootm.c  | 2 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
> index 7f89ff0..f0135a7 100644
> --- a/arch/x86/cpu/Makefile
> +++ b/arch/x86/cpu/Makefile
> @@ -14,7 +14,11 @@ else
>  extra-y        = start.o
>  endif
>  extra-$(CONFIG_$(SPL_)X86_16BIT_INIT) += resetvec.o start16.o
> -obj-y  += cpu.o cpu_x86.o call64.o setjmp.o
> +ifndef CONFIG_$(SPL_)X86_64
> +obj-y  += call64.o setjmp.o
> +endif
> +
> +obj-y  += cpu.o cpu_x86.o
>
>  AFLAGS_REMOVE_call32.o := -mregparm=3 \
>         $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
> index 80fadef..4ac01a3 100644
> --- a/arch/x86/lib/bootm.c
> +++ b/arch/x86/lib/bootm.c
> @@ -150,7 +150,9 @@ int boot_linux_kernel(ulong setup_base, ulong load_address, bool image_64bit)
>                         puts("Cannot boot 64-bit kernel on 32-bit machine\n");
>                         return -EFAULT;
>                 }
> +#if !CONFIG_IS_ENABLED(X86_64)
>                 return cpu_jump_to_64bit(setup_base, load_address);

Can we add a comment here mentioning booting 64-bit kernel is not
supported? Also, do we plan to support 64-bit U-Boot booting 32-bit
kernel? I guess no?

> +#endif
>         } else {
>                 /*
>                 * Set %ebx, %ebp, and %edi to 0, %esi to point to the
> --

Regards,
Bin
Simon Glass Jan. 16, 2017, 2:08 p.m. UTC | #2
Hi Bin,

On 14 January 2017 at 06:32, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass <sjg@chromium.org> wrote:
>> These are currently not supported. Calling 64-bit code from 64-bit U-Boot is
>> much simpler, so this code is not needed. setjmp() is not yet implemented for
>> 64-bit.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>> Changes in v2: None
>>
>>  arch/x86/cpu/Makefile | 6 +++++-
>>  arch/x86/lib/bootm.c  | 2 ++
>>  2 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
>> index 7f89ff0..f0135a7 100644
>> --- a/arch/x86/cpu/Makefile
>> +++ b/arch/x86/cpu/Makefile
>> @@ -14,7 +14,11 @@ else
>>  extra-y        = start.o
>>  endif
>>  extra-$(CONFIG_$(SPL_)X86_16BIT_INIT) += resetvec.o start16.o
>> -obj-y  += cpu.o cpu_x86.o call64.o setjmp.o
>> +ifndef CONFIG_$(SPL_)X86_64
>> +obj-y  += call64.o setjmp.o
>> +endif
>> +
>> +obj-y  += cpu.o cpu_x86.o
>>
>>  AFLAGS_REMOVE_call32.o := -mregparm=3 \
>>         $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
>> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
>> index 80fadef..4ac01a3 100644
>> --- a/arch/x86/lib/bootm.c
>> +++ b/arch/x86/lib/bootm.c
>> @@ -150,7 +150,9 @@ int boot_linux_kernel(ulong setup_base, ulong load_address, bool image_64bit)
>>                         puts("Cannot boot 64-bit kernel on 32-bit machine\n");
>>                         return -EFAULT;
>>                 }
>> +#if !CONFIG_IS_ENABLED(X86_64)
>>                 return cpu_jump_to_64bit(setup_base, load_address);
>
> Can we add a comment here mentioning booting 64-bit kernel is not
> supported? Also, do we plan to support 64-bit U-Boot booting 32-bit
> kernel? I guess no?

OK will add a TODO. There's no reason to not support that that I can think of.

>
>> +#endif
>>         } else {
>>                 /*
>>                 * Set %ebx, %ebp, and %edi to 0, %esi to point to the
>> --
>
> Regards,
> Bin

Regards,
Simon
diff mbox

Patch

diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
index 7f89ff0..f0135a7 100644
--- a/arch/x86/cpu/Makefile
+++ b/arch/x86/cpu/Makefile
@@ -14,7 +14,11 @@  else
 extra-y	= start.o
 endif
 extra-$(CONFIG_$(SPL_)X86_16BIT_INIT) += resetvec.o start16.o
-obj-y	+= cpu.o cpu_x86.o call64.o setjmp.o
+ifndef CONFIG_$(SPL_)X86_64
+obj-y	+= call64.o setjmp.o
+endif
+
+obj-y	+= cpu.o cpu_x86.o
 
 AFLAGS_REMOVE_call32.o := -mregparm=3 \
 	$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 80fadef..4ac01a3 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -150,7 +150,9 @@  int boot_linux_kernel(ulong setup_base, ulong load_address, bool image_64bit)
 			puts("Cannot boot 64-bit kernel on 32-bit machine\n");
 			return -EFAULT;
 		}
+#if !CONFIG_IS_ENABLED(X86_64)
 		return cpu_jump_to_64bit(setup_base, load_address);
+#endif
 	} else {
 		/*
 		* Set %ebx, %ebp, and %edi to 0, %esi to point to the