Re: Testers wanted: Atom netbooks with x86_64 disabled by BIOS

2021-03-28 Thread Mateusz Jończyk

W dniu 28.03.2021 o 00:25, Willy Tarreau pisze:

FWIW I tested on my ASUS 1025C which runs on an Atom N2600 forced to
32-bit. I had already tried in the past but wanted to give it a try
again in case I'd have missed anything. Sadly it didn't work, I'm
still getting the "requires an x86-64 CPU" message.


Thank you. It looks like your bootloader uses the 16-bit kernel boot protocol. 
The 16-bit kernel boot code checks for x86_64 presence with a similar message ( 
inside arch/x86/boot/cpu.c ), which I did not patch out. If you would like to 
test again, use the same patched kernel, but change in GRUB: "linux16" to 
"linux" and "initrd16" to "initrd" to use the 32-bit boot protocol. Which 
distribution and bootloader do you use?


W dniu 28.03.2021 o 03:07, Thomas Gleixner pisze:
> There are some of these '32bit only' CPUs out there in the wild which
> actually support long mode. Some of them even do not have the long mode
> CPUID bit fused out. But whether it works is a different story:
>
>   - If the CPUID bit is on, then the chance is high, but it runs out of
> spec (guarantee wise)
>
>   - If it's off is still might work by some definition of work as they
> might have fused off more or there are actual defects in some 64bit
> only area which are irrelevant when in 32bit mode.

Of course, force enabling x86_64 would require passing a kernel command line 
parameter with a prominent warning in documentation, just like with "forcepae".


Greetings,
Mateusz


Re: Testers wanted: Atom netbooks with x86_64 disabled by BIOS

2021-03-27 Thread Mateusz Jończyk
W dniu 27.03.2021 o 21:32, Mateusz Jończyk pisze:
> Hello,
>
> There are some netbooks with Intel Atom processors that have 64-bit
> support disabled by BIOS. Theoretically, the processor supports 64-bit
> operation, but BIOS allows only 32-bit code to run.
>
> I wonder whether the 64-bit mode is really disabled in the CPU or only
> hidden in the CPUID flags. If the latter, the computer could be made to
> run a 64-bit kernel.
>
> Similarly, there are some Pentium M processors that support PAE
> (Physical Address Extensions), but do not show this in CPUID. They could
> be made to run distributions that require PAE with the "forcepae" kernel
> command line parameter.
>
> I would like to ask people with such netbooks to try to run a 64-bit kernel
> with this patch applied.
>
> When a patched 64-bit kernel is run in `qemu-system-i386`, the virtual
> machine restarts instantly. Without this patch in such a case a 64-bit
> kernel hangs indefinitely (inside .Lno_longmode in head_64.S).

I have made two mistakes:
- I left commented out code,
- I have commented out lines with '#'. The code compiled though.

Attaching corrected patch, please excuse me.

Greetings,
Mateusz

Signed-off-by: Mateusz Jończyk 

---
 arch/x86/boot/compressed/head_64.S | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/boot/compressed/head_64.S 
b/arch/x86/boot/compressed/head_64.S
index e94874f4bbc1..a9f0415da7c2 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -111,8 +111,6 @@ SYM_FUNC_START(startup_32)
lealrva(boot_stack_end)(%ebp), %esp
 
callverify_cpu
-   testl   %eax, %eax
-   jnz .Lno_longmode
 
 /*
  * Compute the delta between where we were compiled to run at
-- 
2.25.1



Testers wanted: Atom netbooks with x86_64 disabled by BIOS

2021-03-27 Thread Mateusz Jończyk
Hello,

There are some netbooks with Intel Atom processors that have 64-bit
support disabled by BIOS. Theoretically, the processor supports 64-bit
operation, but BIOS allows only 32-bit code to run.

I wonder whether the 64-bit mode is really disabled in the CPU or only
hidden in the CPUID flags. If the latter, the computer could be made to
run a 64-bit kernel.

Similarly, there are some Pentium M processors that support PAE
(Physical Address Extensions), but do not show this in CPUID. They could
be made to run distributions that require PAE with the "forcepae" kernel
command line parameter.

I would like to ask people with such netbooks to try to run a 64-bit kernel
with this patch applied.

When a patched 64-bit kernel is run in `qemu-system-i386`, the virtual
machine restarts instantly. Without this patch in such a case a 64-bit
kernel hangs indefinitely (inside .Lno_longmode in head_64.S).


CC: Thomas Gleixner 
CC: Ingo Molnar 
CC: Borislav Petkov 
CC: 

Signed-off-by: Mateusz Jończyk 

---
 arch/x86/boot/compressed/head_64.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/head_64.S 
b/arch/x86/boot/compressed/head_64.S
index e94874f4bbc1..23c376d0b221 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -112,7 +112,7 @@ SYM_FUNC_START(startup_32)
 
callverify_cpu
testl   %eax, %eax
-   jnz .Lno_longmode
+   #jnz.Lno_longmode
 
 /*
  * Compute the delta between where we were compiled to run at
-- 
2.25.1