AMD Geode i686
Hi,
I have refreshed my AMD Geode i686 patch with NOPL and I have added a new nice feature.
When a NOPL is found the parser looks for any NOPL after the current one, so they are emulated in bulk.
Tested ok on a Pcengines Alix.
arch/x86/kernel/Makefile +2 -0
@@ -89,6 +89,8 @@ obj-$(CONFIG_HPET_TIMER) += hpet.o obj-$(CONFIG_K8_NB) += k8.o +obj-$(CONFIG_MGEODEGX1) += nopl_emu.o +obj-$(CONFIG_MGEODE_LX) += nopl_emu.o obj-$(CONFIG_DEBUG_RODATA_TEST) += test_rodata.o obj-$(CONFIG_DEBUG_NX_TEST) += test_nx.o
arch/x86/kernel/cpu/amd.c +0 -1
@@ -138,8 +138,10 @@ }if (c->x86_model ==10 ) { - /Index: linux-2.6.33/arch/x86/kernel/Makefile
===================================================================
* AMD Geode LX is model 10 */
- /* placeholder for any needed mods */
+ /* Geode only lacks the NOPL instruction to be i686,
+ but we can emulate it in the exception handler
+ and promote it to a class 6 cpu */
+ boot_cpu_data.x86 = 6;
return;
}
}
arch/x86/kernel/entry_32.S +4 -0
@@ -960,7 +960,11 @@ RING0_INT_FRAME pushl $0 CFI_ADJUST_CFA_OFFSET 4 +#ifdef CONFIG_MGEODE_LX + pushl $do_nopl_emu +#else pushl $do_invalid_op +#endif CFI_ADJUST_CFA_OFFSET 4 jmp error_code CFI_ENDPROC
arch/x86/kernel/nopl_emu.c new file +107 -0
107 lines not on this page · raw message
Quoted 8 lines · Matteo Croce
Hi,
I have refreshed my AMD Geode i686 patch with NOPL and I have added a new nice feature.
When a NOPL is found the parser looks for any NOPL after the current one, so they are emulated in bulk.
Tested ok on a Pcengines Alix.Signed-off-by Matteo Croce <[email protected]>
1. Since this can possibly touch userspace, you must use get_user() to read the instruction bytes.
2. This parser is too simple to cover all the possible encodings, not just the recommended ones from the Intel manual. You really should be decoding:
- all prefixes (like segment overrides), which can be repeated.
- the 0f 1f opcode.
- the Mod R/M byte.
- the SIB byte (if present).
- the displacement.
This should probably be part of a more general instruction emulator.
--
Brian Gerst
H. Peter Anvin
reviewerQuoted 3 lines · Brian Gerst
This should probably be part of a more general instruction emulator.
... as is being developed; see other thread.
-hpa
Quoted 40 lines · Matteo Croce
Hi,
I have refreshed my AMD Geode i686 patch with NOPL and I have added a new nice feature.
When a NOPL is found the parser looks for any NOPL after the current one, so they are emulated in bulk.
Tested ok on a Pcengines Alix.Signed-off-by Matteo Croce <[email protected]>arch/x86/kernel/Makefile +2
-0@@ -89,6 +89,8 @@ obj-$(CONFIG_HPET_TIMER) += hpet.o obj-$(CONFIG_K8_NB) += k8.o +obj-$(CONFIG_MGEODEGX1) += nopl_emu.o +obj-$(CONFIG_MGEODE_LX) += nopl_emu.o obj-$(CONFIG_DEBUG_RODATA_TEST) += test_rodata.o obj-$(CONFIG_DEBUG_NX_TEST) += test_nx.oarch/x86/kernel/cpu/amd.c +0
-1@@ -138,8 +138,10 @@ }if (c->x86_model ==10 ) { - /Index: linux-2.6.33/arch/x86/kernel/Makefile===================================================================
* AMD Geode LX is model 10 */arch/x86/kernel/cpu/amd.c +4
-1-/* placeholder for any needed mods */ +/* Geode only lacks the NOPL instruction to be i686, +but we can emulate it in the exception handler +and promote it to a class 6 cpu */ + boot_cpu_data.x86 =6 ;return ; } }
arch/x86/kernel/entry_32.S line 967
Quoted 8 lines
arch/x86/kernel/entry_32.S +4
-0@@ -960,7 +960,11 @@ RING0_INT_FRAME pushl $0 CFI_ADJUST_CFA_OFFSET 4 +#ifdef CONFIG_MGEODE_LX + pushl $do_nopl_emu +#else pushl $do_invalid_op +#endif
How does this work for MGEODEGX1 when it looks for MGEODE_LX? It seems you made both link against the code above after all. Is this wrong or the above?
Can it not work if you want to run a generic kernel on your Geode rather than one built explicitly for the LX? I build one kernel to run on Geode SC1200 and Geode LX.
Signature · 1 line
Len Sorensen
Quoted 54 lines · Lennart Sorensen
Quoted 46 lines · Matteo Croce
Hi,
I have refreshed my AMD Geode i686 patch with NOPL and I have added a new nice feature.
When a NOPL is found the parser looks for any NOPL after the current one, so they are emulated in bulk.
Tested ok on a Pcengines Alix.Signed-off-by Matteo Croce <[email protected]>arch/x86/kernel/Makefile 2010-03-01 01:19:45.727095700 +0100 renamed from arch/x86/kernel/Makefile 2010-03-01 01:18:51.697166322 +0100 +0
-0@@ -89,6 +89,8 @@obj-$(CONFIG_HPET_TIMER) += hpet.o
obj-$(CONFIG_K8_NB) += k8.o
arch/x86/kernel/Makefile 2010-03-01 01:19:45.727095700 +0100 renamed from arch/x86/kernel/Makefile 2010-03-01 01:18:51.697166322 +0100 +2
-0+obj-$(CONFIG_MGEODEGX1) += nopl_emu.o +obj-$(CONFIG_MGEODE_LX) += nopl_emu.oobj-$(CONFIG_DEBUG_RODATA_TEST) += test_rodata.o obj-$(CONFIG_DEBUG_NX_TEST) += test_nx.o
arch/x86/kernel/cpu/amd.c 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/cpu/amd.c 2010-03-01 01:18:51.737097341 +0100 +0
-1@@ -138,8 +138,10 @@ } if (c->x86_model == 10) { - /Index: linux-2.6.33/arch/x86/kernel/Makefile===================================================================
* AMD Geode LX is model 10 */
- /* placeholder for any needed mods */
+ /* Geode only lacks the NOPL instruction to be i686,
+ but we can emulate it in the exception handler
+ and promote it to a class 6 cpu */
+ boot_cpu_data.x86 = 6;
return;
}
}arch/x86/kernel/entry_32.S 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/entry_32.S 2010-03-01 01:18:51.717096708 +0100 +0
-0@@ -960,7 +960,11 @@
RING0_INT_FRAME
pushl $0
CFI_ADJUST_CFA_OFFSET4arch/x86/kernel/entry_32.S 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/entry_32.S 2010-03-01 01:18:51.717096708 +0100 +3
-0+#ifdef CONFIG_MGEODE_LX + pushl $do_nopl_emu +#elseQuoted 2 lines
pushl $do_invalid_op
+#endifHow does this work for MGEODEGX1 when it looks for
MGEODE_LX? It seems you made both link against the code above after all. Is this wrong or the above?
Quoted 7 lines
Can it not work if you want to run a generic kernel on your Geode rather than one built explicitly for the LX? I build one kernel to run on Geode SC1200 and Geode LX.
--
Len Sorensen
This code should work for Geode GX too.
Try it and report success please
Signature · 12 lines
Matteo Croce
OpenWrt developer
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
KAMIKAZE (bleeding edge) ------------------
* 10 oz Vodka Shake well with ice and strain
* 10 oz Triple sec mixture into 10 shot glasses.
* 10 oz lime juice Salute!
---------------------------------------------------Quoted 60 lines · Matteo Croce
Quoted 58 lines · Lennart Sorensen
Quoted 46 lines · Matteo Croce
Hi,
I have refreshed my AMD Geode i686 patch with NOPL and I have added a new nice feature.
When a NOPL is found the parser looks for any NOPL after the current one, so they are emulated in bulk.
Tested ok on a Pcengines Alix.Signed-off-by Matteo Croce <[email protected]>arch/x86/kernel/Makefile 2010-03-01 01:19:45.727095700 +0100 renamed from arch/x86/kernel/Makefile 2010-03-01 01:18:51.697166322 +0100 +0
-0@@ -89,6 +89,8 @@obj-$(CONFIG_HPET_TIMER) += hpet.o
obj-$(CONFIG_K8_NB) += k8.o
arch/x86/kernel/Makefile 2010-03-01 01:19:45.727095700 +0100 renamed from arch/x86/kernel/Makefile 2010-03-01 01:18:51.697166322 +0100 +2
-0+obj-$(CONFIG_MGEODEGX1) += nopl_emu.o +obj-$(CONFIG_MGEODE_LX) += nopl_emu.oobj-$(CONFIG_DEBUG_RODATA_TEST) += test_rodata.o obj-$(CONFIG_DEBUG_NX_TEST) += test_nx.o
arch/x86/kernel/cpu/amd.c 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/cpu/amd.c 2010-03-01 01:18:51.737097341 +0100 +0
-1@@ -138,8 +138,10 @@ } if (c->x86_model == 10) { - /Index: linux-2.6.33/arch/x86/kernel/Makefile===================================================================
* AMD Geode LX is model 10 */
- /* placeholder for any needed mods */
+ /* Geode only lacks the NOPL instruction to be i686,
+ but we can emulate it in the exception handler
+ and promote it to a class 6 cpu */
+ boot_cpu_data.x86 = 6;
return;
}
}arch/x86/kernel/entry_32.S 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/entry_32.S 2010-03-01 01:18:51.717096708 +0100 +0
-0@@ -960,7 +960,11 @@
RING0_INT_FRAME
pushl $0
CFI_ADJUST_CFA_OFFSET4arch/x86/kernel/entry_32.S 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/entry_32.S 2010-03-01 01:18:51.717096708 +0100 +3
-0+#ifdef CONFIG_MGEODE_LX + pushl $do_nopl_emu +#elseQuoted 2 lines
pushl $do_invalid_op
+#endifHow does this work for MGEODEGX1 when it looks for
MGEODE_LX? It seems you made both link against the code above after all. Is this wrong or the above?Can it not work if you want to run a generic kernel on your Geode rather than one built explicitly for the LX? I build one kernel to run on Geode SC1200 and Geode LX.
Quoted 6 lines
Quoted 3 lines
--
Len SorensenThis code should work for Geode GX too.
Try it and report success please
But if I don't have CONFIG_MGEODE_LX then what is going to call the $do_nopl_emu in entry_32.S?
Signature · 1 line
Len Sorensen
Quoted 65 lines · Lennart Sorensen
Quoted 64 lines · Matteo Croce
Quoted 61 lines · Lennart Sorensen
Quoted 46 lines · Matteo Croce
Hi,
I have refreshed my AMD Geode i686 patch with NOPL and I have added a new nice feature.
When a NOPL is found the parser looks for any NOPL after the current one, so they are emulated in bulk.
Tested ok on a Pcengines Alix.Signed-off-by Matteo Croce <[email protected]>arch/x86/kernel/Makefile 2010-03-01 01:19:45.727095700 +0100 renamed from arch/x86/kernel/Makefile 2010-03-01 01:18:51.697166322 +0100 +0
-0@@ -89,6 +89,8 @@obj-$(CONFIG_HPET_TIMER) += hpet.o
obj-$(CONFIG_K8_NB) += k8.o
arch/x86/kernel/Makefile 2010-03-01 01:19:45.727095700 +0100 renamed from arch/x86/kernel/Makefile 2010-03-01 01:18:51.697166322 +0100 +2
-0+obj-$(CONFIG_MGEODEGX1) += nopl_emu.o +obj-$(CONFIG_MGEODE_LX) += nopl_emu.oobj-$(CONFIG_DEBUG_RODATA_TEST) += test_rodata.o obj-$(CONFIG_DEBUG_NX_TEST) += test_nx.o
arch/x86/kernel/cpu/amd.c 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/cpu/amd.c 2010-03-01 01:18:51.737097341 +0100 +0
-1@@ -138,8 +138,10 @@ } if (c->x86_model == 10) { - /Index: linux-2.6.33/arch/x86/kernel/Makefile===================================================================
* AMD Geode LX is model 10 */
- /* placeholder for any needed mods */
+ /* Geode only lacks the NOPL instruction to be i686,
+ but we can emulate it in the exception handler
+ and promote it to a class 6 cpu */
+ boot_cpu_data.x86 = 6;
return;
}
}arch/x86/kernel/entry_32.S 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/entry_32.S 2010-03-01 01:18:51.717096708 +0100 +0
-0@@ -960,7 +960,11 @@
RING0_INT_FRAME
pushl $0
CFI_ADJUST_CFA_OFFSET4arch/x86/kernel/entry_32.S 2010-03-01 01:19:27.867865836 +0100 renamed from arch/x86/kernel/entry_32.S 2010-03-01 01:18:51.717096708 +0100 +3
-0+#ifdef CONFIG_MGEODE_LX + pushl $do_nopl_emu +#elseQuoted 2 lines
pushl $do_invalid_op
+#endifHow does this work for MGEODEGX1 when it looks for
MGEODE_LX? It seems you made both link against the code above after all. Is this wrong or the above?Can it not work if you want to run a generic kernel on your Geode rather than one built explicitly for the LX? I build one kernel to run on Geode SC1200 and Geode LX.
--
Len Sorensen
Quoted 9 lines
Quoted 2 lines
This code should work for Geode GX too.
Try it and report success pleaseBut if I don't have
CONFIG_MGEODE_LXthen what is going to call the $do_nopl_emu inentry_32.S?--
Len Sorensen
#if defined(CONFIG_MGEODE_LX) || defined(MGEODEGX1)
sort of..
Signature · 12 lines
Matteo Croce
OpenWrt developer
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
KAMIKAZE (bleeding edge) ------------------
* 10 oz Vodka Shake well with ice and strain
* 10 oz Triple sec mixture into 10 shot glasses.
* 10 oz lime juice Salute!
---------------------------------------------------