ia32 emulation on Pentium I
Dear all,
I'm trying to enable ia32 emulation in k1om kernel. Linux kernel is ported for k1om, but with ia32 emulation disabled. With it enabled, I'm getting the following error:
LD arch/x86/crypto/built-in.o
AS arch/x86/ia32/ia32entry.oarch/x86/ia32/ia32entry.S: Assembler messages:arch/x86/ia32/ia32entry.S:192: Error: sysexit' is not supported on k1om' make[2]: *** [arch/x86/ia32/ia32entry.o] Error 1
make[1]: *** [arch/x86/ia32] Error 2
make: *** [arch/x86] Error 2
sysexit is not supported because k1om (Intel MIC) is essentially Pentium I with AVX512 extensions.
sysexit is used in macro ENABLE_INTERRUPTS_SYSEXIT32, which is in turn used in ENTRY(ia32_sysenter_target).
So, it seems ia32 emulation assumes Pentium II+. Do you see a quick way to make it Pentium I -compatible?
Thanks,
- D.
Quoted 3 lines · Dmitry Mikushin
So, it seems ia32 emulation assumes Pentium II+. Do you see a quick way to make it Pentium I -compatible?
The SYSENTER code path should be never executed, so you could either hack the assembler to allow it, or just open code it.
Something like (totally untested):
From: Andi Kleen <[email protected]>
use .byte to implement SYSEXIT for k1om assembler
arch/x86/include/asm/irqflags.h +3 -1
@@ -130,6 +130,8 @@ static inline notrace unsigned long arch_local_irq_save(void)#define PARAVIRT_ADJUST_EXCEPTION_FRAME /* */ #define INTERRUPT_RETURN iretq +#define SYSEXIT .byte 0x0f,0x35 +#define USERGS_SYSRET64 \ swapgs; \ sysretq;
@@ -139,7 +141,7 @@ static inline notrace unsigned long arch_local_irq_save(void)#define ENABLE_INTERRUPTS_SYSEXIT32 \ swapgs; \ sti; \ - sysexit + SYSEXIT#else #define INTERRUPT_RETURN iret
Signature · 1 line
[email protected] -- Speaking for myself only