search for: gdt_entry

Displaying 20 results from an estimated 113 matches for "gdt_entry".

2007 Apr 18
2
[PATCH 3/3] Gdt page isolation
..._STACK_SIZE]); @@ -29,6 +26,8 @@ struct Xgt_desc_struct { extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; +#define get_cpu_gdt_table(_cpu) ((struct desc_struct *)cpu_gdt_descr[(_cpu)].address) + #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) Index: linux-2.6.14-rc1/arch/i386/kernel/i386_ksyms.c =================================================================== --- linux-2.6.14-rc1.orig/arch/i386/kernel/i386_ksyms.c 2005-09-20...
2007 Apr 18
2
[PATCH 3/3] Gdt page isolation
..._STACK_SIZE]); @@ -29,6 +26,8 @@ struct Xgt_desc_struct { extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; +#define get_cpu_gdt_table(_cpu) ((struct desc_struct *)cpu_gdt_descr[(_cpu)].address) + #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) Index: linux-2.6.14-rc1/arch/i386/kernel/i386_ksyms.c =================================================================== --- linux-2.6.14-rc1.orig/arch/i386/kernel/i386_ksyms.c 2005-09-20...
2007 Apr 18
0
[PATCH 13/21] i386 Gdt page isolation
...ruct { extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; +static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) +{ + return ((struct desc_struct *)cpu_gdt_descr[cpu].address); +} + #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) Index: linux-2.6.14-zach-work/arch/i386/kernel/i386_ksyms.c =================================================================== --- linux-2.6.14-zach-work.orig/arch/i386/kernel/i386_ksyms....
2007 Apr 18
0
[PATCH 13/21] i386 Gdt page isolation
...ruct { extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; +static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) +{ + return ((struct desc_struct *)cpu_gdt_descr[cpu].address); +} + #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) Index: linux-2.6.14-zach-work/arch/i386/kernel/i386_ksyms.c =================================================================== --- linux-2.6.14-zach-work.orig/arch/i386/kernel/i386_ksyms....
2007 Apr 18
1
[PATCH 0/7] Using %gs for per-cpu areas on x86
OK, here it is. Benchmarks still coming. This is against Andi's 2.6.18-rc7-git3 tree, and replaces the patches between (and not including) i386-pda-asm-offsets and i386-early-fault. One patch is identical, one is mildly modified, the rest are re-implemented but inspired by Jeremy's PDA work. Thanks, Rusty. -- Help! Save Australia from the worst of the DMCA: http://linux.org.au/law
2007 Apr 18
1
[PATCH 0/7] Using %gs for per-cpu areas on x86
OK, here it is. Benchmarks still coming. This is against Andi's 2.6.18-rc7-git3 tree, and replaces the patches between (and not including) i386-pda-asm-offsets and i386-early-fault. One patch is identical, one is mildly modified, the rest are re-implemented but inspired by Jeremy's PDA work. Thanks, Rusty. -- Help! Save Australia from the worst of the DMCA: http://linux.org.au/law
2007 Apr 18
1
[RFC/PATCH PV_OPS X86_64 05/17] pravirt_ops - segments
...r de Oliveira Costa <gcosta@redhat.com> Index: clean-start/include/asm-x86_64/segment.h =================================================================== --- clean-start.orig/include/asm-x86_64/segment.h +++ clean-start/include/asm-x86_64/segment.h @@ -37,8 +37,14 @@ #define GS_TLS_SEL ((GDT_ENTRY_TLS_MIN+GS_TLS)*8 + 3) #define FS_TLS_SEL ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3) +#define __HV_CS 0x80 /* 16*8 */ +#define __HV_DS 0x88 /* 17*8 */ + +#define GDT_ENTRY_HV_CS 16 +#define GDT_ENTRY_HV_DS 17 + #define IDT_ENTRIES 256 -#define GDT_ENTRIES 16 +#define GDT_ENTRIES 18 #define GDT_SIZE...
2007 Apr 18
0
[PATCH 8/21] i386 Segment protect properly
...h-work.orig/include/asm-i386/desc.h 2005-11-04 17:45:02.000000000 -0800 +++ linux-2.6.14-zach-work/include/asm-i386/desc.h 2005-11-05 00:28:08.000000000 -0800 @@ -158,6 +158,15 @@ static inline unsigned long get_desc_bas return base; } +static inline void prepare_protected_segment(int cpu, int gdt_entry, void *base, u32 size) +{ + struct desc_struct *gdt = get_cpu_gdt_table(cpu); + + /* Forced zero-length segments to 1-byte access at unmapped page zero */ + set_base(gdt[gdt_entry], size > 0 ? (u32)base : 0); + set_limit(gdt[gdt_entry], size > 0 ? size - 1 : 0); +} + struct bios_segment_save...
2007 Apr 18
0
[PATCH 8/21] i386 Segment protect properly
...h-work.orig/include/asm-i386/desc.h 2005-11-04 17:45:02.000000000 -0800 +++ linux-2.6.14-zach-work/include/asm-i386/desc.h 2005-11-05 00:28:08.000000000 -0800 @@ -158,6 +158,15 @@ static inline unsigned long get_desc_bas return base; } +static inline void prepare_protected_segment(int cpu, int gdt_entry, void *base, u32 size) +{ + struct desc_struct *gdt = get_cpu_gdt_table(cpu); + + /* Forced zero-length segments to 1-byte access at unmapped page zero */ + set_base(gdt[gdt_entry], size > 0 ? (u32)base : 0); + set_limit(gdt[gdt_entry], size > 0 ? size - 1 : 0); +} + struct bios_segment_save...
2007 Apr 18
1
[RFC/PATCH PV_OPS X86_64 05/17] pravirt_ops - segments
...r de Oliveira Costa <gcosta@redhat.com> Index: clean-start/include/asm-x86_64/segment.h =================================================================== --- clean-start.orig/include/asm-x86_64/segment.h +++ clean-start/include/asm-x86_64/segment.h @@ -37,8 +37,14 @@ #define GS_TLS_SEL ((GDT_ENTRY_TLS_MIN+GS_TLS)*8 + 3) #define FS_TLS_SEL ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3) +#define __HV_CS 0x80 /* 16*8 */ +#define __HV_DS 0x88 /* 17*8 */ + +#define GDT_ENTRY_HV_CS 16 +#define GDT_ENTRY_HV_DS 17 + #define IDT_ENTRIES 256 -#define GDT_ENTRIES 16 +#define GDT_ENTRIES 18 #define GDT_SIZE...
2007 Apr 18
3
[PATCH 12/21] i386 Deprecate descriptor asm
...cpu_gdt_table(cpu)[entry], (int)addr, offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); } @@ -70,7 +118,7 @@ static inline void __set_tss_desc(unsign static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) { - _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); + set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } #define LDT_entry_a(info) \ @@ -149,22 +197,13 @@ static inline void load_LDT(mm_context_t put_cpu(); } -static inline unsigned long get_d...
2007 Apr 18
3
[PATCH 12/21] i386 Deprecate descriptor asm
...cpu_gdt_table(cpu)[entry], (int)addr, offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); } @@ -70,7 +118,7 @@ static inline void __set_tss_desc(unsign static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) { - _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); + set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } #define LDT_entry_a(info) \ @@ -149,22 +197,13 @@ static inline void load_LDT(mm_context_t put_cpu(); } -static inline unsigned long get_d...
2007 Apr 18
2
[PATCH 8/14] i386 / Add a per cpu gdt accessor
...ble, cpu)[entry], (int)addr, + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[entry], (int)addr, offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); } static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) { - _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } static inline int write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b) @@ -72,7 +72,7 @@ static inline void load_TLS(struct...
2007 Apr 18
2
[PATCH 8/14] i386 / Add a per cpu gdt accessor
...ble, cpu)[entry], (int)addr, + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[entry], (int)addr, offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); } static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) { - _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } static inline int write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b) @@ -72,7 +72,7 @@ static inline void load_TLS(struct...
2007 Apr 18
1
[PATCH 2/12] ldt-accessors
Introduce a write acessor for updating the current LDT. This is required for hypervisors like Xen that do not allow LDT pages to be directly written. Testing - here's a fun little LDT test that can be trivially modified to test limits as well. /* * Copyright (c) 2005, Zachary Amsden (zach@vmware.com) * This is licensed under the GPL. */ #include <stdio.h> #include <signal.h>
2007 Apr 18
1
[PATCH 2/12] ldt-accessors
Introduce a write acessor for updating the current LDT. This is required for hypervisors like Xen that do not allow LDT pages to be directly written. Testing - here's a fun little LDT test that can be trivially modified to test limits as well. /* * Copyright (c) 2005, Zachary Amsden (zach@vmware.com) * This is licensed under the GPL. */ #include <stdio.h> #include <signal.h>
2007 Apr 18
0
[PATCH 11/14] i386 / Eliminate yet another redundant accessor
...)->b >> 15) & 1) -#define GET_USEABLE(desc) (((desc)->b >> 20) & 1) - asmlinkage int sys_get_thread_area(struct user_desc __user *u_info) { struct user_desc info; @@ -932,16 +912,7 @@ memset(&info, 0, sizeof(info)); desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN; - - info.entry_number = idx; - info.base_addr = GET_BASE(desc); - info.limit = GET_LIMIT(desc); - info.seg_32bit = GET_32BIT(desc); - info.contents = GET_CONTENTS(desc); - info.read_exec_only = !GET_WRITABLE(desc); - info.limit_in_pages = GET_LIMIT_PAGES(desc); - info.seg_not_present = !GE...
2007 Apr 18
0
[PATCH 11/14] i386 / Eliminate yet another redundant accessor
...)->b >> 15) & 1) -#define GET_USEABLE(desc) (((desc)->b >> 20) & 1) - asmlinkage int sys_get_thread_area(struct user_desc __user *u_info) { struct user_desc info; @@ -932,16 +912,7 @@ memset(&info, 0, sizeof(info)); desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN; - - info.entry_number = idx; - info.base_addr = GET_BASE(desc); - info.limit = GET_LIMIT(desc); - info.seg_32bit = GET_32BIT(desc); - info.contents = GET_CONTENTS(desc); - info.read_exec_only = !GET_WRITABLE(desc); - info.limit_in_pages = GET_LIMIT_PAGES(desc); - info.seg_not_present = !GE...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...nt)addr, + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[entry], (int)addr, offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); } @@ -76,7 +78,7 @@ static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) { - _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } #define LDT_entry_a(info) \ @@ -112,7 +114,7 @@ static inline void load_TLS(struct thread_struct *t, unsigned int cpu) { - memcpy(&per...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...nt)addr, + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[entry], (int)addr, offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); } @@ -76,7 +78,7 @@ static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) { - _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); + _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } #define LDT_entry_a(info) \ @@ -112,7 +114,7 @@ static inline void load_TLS(struct thread_struct *t, unsigned int cpu) { - memcpy(&per...