Hi, This series integrate the processor.h header. There are a lot of things that are deeply architectural differences between architectures, but I've done my best to come to a settlement. With this series, I am very close to have selectable paravirt for x86_64, It applies ontop of today's x86 git, mm branch.
Glauber de Oliveira Costa
2007-Dec-17 17:36 UTC
[PATCH 1/21] move tsc definitions to were they belong
This patch wipes out the definitions of tsc_disable from processor_32.h and move it to tsc.h, were it belongs Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> --- include/asm-x86/processor_32.h | 7 ------- include/asm-x86/tsc.h | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) Index: linux-2.6-x86/include/asm-x86/processor_32.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor_32.h +++ linux-2.6-x86/include/asm-x86/processor_32.h @@ -22,9 +22,6 @@ #include <asm/processor-flags.h> #include <asm/desc_defs.h> -/* flag for disabling the tsc */ -extern int tsc_disable; - static inline int desc_empty(const void *ptr) { const u32 *desc = ptr; @@ -206,8 +203,6 @@ extern int bootloader_type; #define HAVE_ARCH_PICK_MMAP_LAYOUT -extern void disable_TSC(void); - /* * Size of io_bitmap. */ Index: linux-2.6-x86/include/asm-x86/tsc.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/tsc.h +++ linux-2.6-x86/include/asm-x86/tsc.h @@ -16,6 +16,10 @@ typedef unsigned long long cycles_t; extern unsigned int cpu_khz; extern unsigned int tsc_khz; +/* flag for disabling the tsc */ +extern int tsc_disable; + +extern void disable_TSC(void); static inline cycles_t get_cycles(void) {
Glauber de Oliveira Costa
2007-Dec-17 18:06 UTC
[PATCH 16/21] [PATCH] unify mm_segment_t definition
This patch moves the mm_segment_t structure definition to processor.h This makes mmsegment.h file useless, and it is deleted. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> --- include/asm-x86/mmsegment.h | 8 -------- include/asm-x86/processor.h | 5 +++++ include/asm-x86/processor_32.h | 5 ----- include/asm-x86/processor_64.h | 1 - include/asm-x86/thread_info_64.h | 2 +- 5 files changed, 6 insertions(+), 15 deletions(-) Index: linux-2.6-x86/include/asm-x86/mmsegment.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/mmsegment.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _ASM_MMSEGMENT_H -#define _ASM_MMSEGMENT_H 1 - -typedef struct { - unsigned long seg; -} mm_segment_t; - -#endif Index: linux-2.6-x86/include/asm-x86/processor.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor.h +++ linux-2.6-x86/include/asm-x86/processor.h @@ -420,6 +420,11 @@ struct extended_sigtable { struct extended_signature sigs[0]; }; +typedef struct { + unsigned long seg; +} mm_segment_t; + + /* * create a kernel thread without removing it from tasklists */ Index: linux-2.6-x86/include/asm-x86/processor_32.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor_32.h +++ linux-2.6-x86/include/asm-x86/processor_32.h @@ -103,11 +103,6 @@ union i387_union { struct i387_soft_struct soft; }; -typedef struct { - unsigned long seg; -} mm_segment_t; - - #define INIT_THREAD { \ .sp0 = sizeof(init_stack) + (long)&init_stack, \ .vm86_info = NULL, \ Index: linux-2.6-x86/include/asm-x86/processor_64.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor_64.h +++ linux-2.6-x86/include/asm-x86/processor_64.h @@ -14,7 +14,6 @@ #include <asm/msr.h> #include <asm/current.h> #include <asm/system.h> -#include <asm/mmsegment.h> #include <linux/personality.h> #include <asm/desc_defs.h> Index: linux-2.6-x86/include/asm-x86/thread_info_64.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/thread_info_64.h +++ linux-2.6-x86/include/asm-x86/thread_info_64.h @@ -21,7 +21,7 @@ #ifndef __ASSEMBLY__ struct task_struct; struct exec_domain; -#include <asm/mmsegment.h> +#include <asm/processor.h> struct thread_info { struct task_struct *task; /* main task structure */
Glauber de Oliveira Costa
2007-Dec-17 18:06 UTC
[PATCH 20/21] [PATCH] move i387 definitions to processor.h
This patch moves i387 definitions from processor_32.h and processor_64.h to processor.h. They are different. Very different. And there's appearently nothing we can do about it, so they're enclosed inside ifdefs. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> --- include/asm-x86/processor.h | 66 ++++++++++++++++++++++++++++++++++++++++ include/asm-x86/processor_32.h | 49 ----------------------------- include/asm-x86/processor_64.h | 17 ---------- 3 files changed, 66 insertions(+), 66 deletions(-) Index: linux-2.6-x86/include/asm-x86/processor.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor.h +++ linux-2.6-x86/include/asm-x86/processor.h @@ -223,8 +223,74 @@ struct orig_ist { }; #ifdef CONFIG_X86_32 +struct i387_fsave_struct { + long cwd; + long swd; + long twd; + long fip; + long fcs; + long foo; + long fos; + long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ + long status; /* software status information */ +}; + +struct i387_fxsave_struct { + unsigned short cwd; + unsigned short swd; + unsigned short twd; + unsigned short fop; + long fip; + long fcs; + long foo; + long fos; + long mxcsr; + long mxcsr_mask; + long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ + long padding[56]; +} __attribute__((aligned(16))); + +struct i387_soft_struct { + long cwd; + long swd; + long twd; + long fip; + long fcs; + long foo; + long fos; + long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ + unsigned char ftop, changed, lookahead, no_update, rm, alimit; + struct info *info; + unsigned long entry_eip; +}; + +union i387_union { + struct i387_fsave_struct fsave; + struct i387_fxsave_struct fxsave; + struct i387_soft_struct soft; +}; + # include "processor_32.h" #else +struct i387_fxsave_struct { + u16 cwd; + u16 swd; + u16 twd; + u16 fop; + u64 rip; + u64 rdp; + u32 mxcsr; + u32 mxcsr_mask; + u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ + u32 padding[24]; +} __attribute__((aligned(16))); + +union i387_union { + struct i387_fxsave_struct fxsave; +}; + # include "processor_64.h" #endif Index: linux-2.6-x86/include/asm-x86/processor_32.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor_32.h +++ linux-2.6-x86/include/asm-x86/processor_32.h @@ -29,55 +29,6 @@ DECLARE_PER_CPU(u8, cpu_llc_id); */ #define TASK_SIZE (PAGE_OFFSET) - -struct i387_fsave_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ - long status; /* software status information */ -}; - -struct i387_fxsave_struct { - unsigned short cwd; - unsigned short swd; - unsigned short twd; - unsigned short fop; - long fip; - long fcs; - long foo; - long fos; - long mxcsr; - long mxcsr_mask; - long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ - long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ - long padding[56]; -} __attribute__ ((aligned (16))); - -struct i387_soft_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ - unsigned char ftop, changed, lookahead, no_update, rm, alimit; - struct info *info; - unsigned long entry_eip; -}; - -union i387_union { - struct i387_fsave_struct fsave; - struct i387_fxsave_struct fxsave; - struct i387_soft_struct soft; -}; - #define INIT_THREAD { \ .sp0 = sizeof(init_stack) + (long)&init_stack, \ .vm86_info = NULL, \ Index: linux-2.6-x86/include/asm-x86/processor_64.h ==================================================================--- linux-2.6-x86.orig/include/asm-x86/processor_64.h +++ linux-2.6-x86/include/asm-x86/processor_64.h @@ -31,23 +31,6 @@ #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64) -struct i387_fxsave_struct { - u16 cwd; - u16 swd; - u16 twd; - u16 fop; - u64 rip; - u64 rdp; - u32 mxcsr; - u32 mxcsr_mask; - u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ - u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ - u32 padding[24]; -} __attribute__ ((aligned (16))); - -union i387_union { - struct i387_fxsave_struct fxsave; -}; DECLARE_PER_CPU(struct orig_ist, orig_ist);
Rusty Russell
2007-Dec-17 21:14 UTC
[PATCH 3/21] [PATCH] move desc_empty to where they belong
On Tuesday 18 December 2007 09:52:26 Glauber de Oliveira Costa wrote:> +static inline int desc_empty(const void *ptr) > +{ > + const u32 *desc = ptr; > + return !(desc[0] | desc[1]); > +}Erk. This really needs to be a union, not a void *. I guess we can clean it later. Rusty.
Glauber de Oliveira Costa
2007-Dec-18 04:04 UTC
[PATCH 3/21] [PATCH] move desc_empty to where they belong
Rusty Russell wrote:> On Tuesday 18 December 2007 09:52:26 Glauber de Oliveira Costa wrote: >> +static inline int desc_empty(const void *ptr) >> +{ >> + const u32 *desc = ptr; >> + return !(desc[0] | desc[1]); >> +} > > Erk. This really needs to be a union, not a void *. I guess we can clean it > later. > > Rusty.My last series, that unified desc_struct, made it possible to do that. However, the intent of this, is just move it to a common place.