Displaying 20 results from an estimated 26 matches for "get_desc_base".
2007 Apr 18
1
[PATCH 2/12] ldt-accessors
...and
* calculate the address by reading the base address from the LDT entry.
*/
- if ((regs->xcs & 4) && (current->mm)) {
- lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
- + (char *) current->mm->context.ldt);
- addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
+ if (segment_is_ldt(regs->xcs) && (current->mm)) {
+ struct desc_struct *desc = &LDT_DESCRIPTOR(regs->xcs);
+ addr = (kprobe_opcode_t *) (get_desc_base(desc) + regs->eip -
sizeof(kprobe_opcode_t));
} else {
addr = (kprobe_opcode_t *)(regs-...
2007 Apr 18
1
[PATCH 2/12] ldt-accessors
...and
* calculate the address by reading the base address from the LDT entry.
*/
- if ((regs->xcs & 4) && (current->mm)) {
- lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
- + (char *) current->mm->context.ldt);
- addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
+ if (segment_is_ldt(regs->xcs) && (current->mm)) {
+ struct desc_struct *desc = &LDT_DESCRIPTOR(regs->xcs);
+ addr = (kprobe_opcode_t *) (get_desc_base(desc) + regs->eip -
sizeof(kprobe_opcode_t));
} else {
addr = (kprobe_opcode_t *)(regs-...
2007 Apr 18
1
[PATCH 7/14] i386 / Add some descriptor convenience functions
...05-08-10 20:42:03.000000000 -0700
@@ -14,6 +14,28 @@
#include <asm/mmu.h>
+#define desc_empty(desc) \
+ (!((desc)->a + (desc)->b))
+
+#define desc_equal(desc1, desc2) \
+ (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
+
+static inline unsigned long get_desc_base(struct desc_struct *desc)
+{
+ unsigned long base;
+ base = ((desc->a >> 16) & 0x0000ffff) |
+ ((desc->b << 16) & 0x00ff0000) |
+ (desc->b & 0xff000000);
+ return base;
+}
+
+static inline unsigned long get_desc_limit(struct desc_struct *desc)
+{
+ unsigned long...
2007 Apr 18
1
[PATCH 7/14] i386 / Add some descriptor convenience functions
...05-08-10 20:42:03.000000000 -0700
@@ -14,6 +14,28 @@
#include <asm/mmu.h>
+#define desc_empty(desc) \
+ (!((desc)->a + (desc)->b))
+
+#define desc_equal(desc1, desc2) \
+ (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
+
+static inline unsigned long get_desc_base(struct desc_struct *desc)
+{
+ unsigned long base;
+ base = ((desc->a >> 16) & 0x0000ffff) |
+ ((desc->b << 16) & 0x00ff0000) |
+ (desc->b & 0xff000000);
+ return base;
+}
+
+static inline unsigned long get_desc_limit(struct desc_struct *desc)
+{
+ unsigned long...
2007 Apr 18
3
[PATCH 12/21] i386 Deprecate descriptor asm
...har base1;
+ unsigned char type;
+ unsigned int limit1 : 4;
+ unsigned int flags : 4;
+ unsigned char base2;
+} __attribute__((packed));
+
+static inline struct desc_internal_struct *desc_internal(struct desc_struct *d)
+{
+ return (struct desc_internal_struct *)d;
+}
+
+static inline unsigned long get_desc_base(struct desc_struct *desc)
+{
+ unsigned long base;
+ struct desc_internal_struct *dint = desc_internal(desc);
+ base = (dint->base0) | (dint->base1 << 16) | (dint->base2 << 24);
+ return base;
+}
+
+static inline unsigned long get_desc_limit(struct desc_struct *desc)
+{
+ unsig...
2007 Apr 18
3
[PATCH 12/21] i386 Deprecate descriptor asm
...har base1;
+ unsigned char type;
+ unsigned int limit1 : 4;
+ unsigned int flags : 4;
+ unsigned char base2;
+} __attribute__((packed));
+
+static inline struct desc_internal_struct *desc_internal(struct desc_struct *d)
+{
+ return (struct desc_internal_struct *)d;
+}
+
+static inline unsigned long get_desc_base(struct desc_struct *desc)
+{
+ unsigned long base;
+ struct desc_internal_struct *dint = desc_internal(desc);
+ base = (dint->base0) | (dint->base1 << 16) | (dint->base2 << 24);
+ return base;
+}
+
+static inline unsigned long get_desc_limit(struct desc_struct *desc)
+{
+ unsig...
2007 Dec 06
51
[PATCH 0/19] desc_struct integration
Hi,
this is a series of patches that unify the struct desc_struct and friends
across x86_64 and i386. As usual, it provides paravirt capabilities as a
side-effect for x86_64.
I consider the main goal, namely, of unifying the desc_struct, an ongoing
effort, being this the beginning. A lot of old code has to be touched to
accomplish that.
I don't consider this patch ready for inclusion.
2007 Dec 06
51
[PATCH 0/19] desc_struct integration
Hi,
this is a series of patches that unify the struct desc_struct and friends
across x86_64 and i386. As usual, it provides paravirt capabilities as a
side-effect for x86_64.
I consider the main goal, namely, of unifying the desc_struct, an ongoing
effort, being this the beginning. A lot of old code has to be touched to
accomplish that.
I don't consider this patch ready for inclusion.
2007 Apr 18
0
[PATCH 10/12] yet-another-redundant-accessor
...esc)->b >> 20) & 1)
-
asmlinkage int sys_get_thread_area(struct user_desc __user *u_info)
{
struct user_desc info;
@@ -934,7 +914,7 @@
desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
info.entry_number = idx;
- info.base_addr = GET_BASE(desc);
+ info.base_addr = get_desc_base(desc);
info.limit = GET_LIMIT(desc);
info.seg_32bit = GET_32BIT(desc);
info.contents = GET_CONTENTS(desc);
Index: linux-2.6.13/arch/i386/kernel/ptrace.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/ptrace.c 2005-08-08 20:48:06.0000...
2007 Apr 18
0
[PATCH 10/12] yet-another-redundant-accessor
...esc)->b >> 20) & 1)
-
asmlinkage int sys_get_thread_area(struct user_desc __user *u_info)
{
struct user_desc info;
@@ -934,7 +914,7 @@
desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
info.entry_number = idx;
- info.base_addr = GET_BASE(desc);
+ info.base_addr = get_desc_base(desc);
info.limit = GET_LIMIT(desc);
info.seg_32bit = GET_32BIT(desc);
info.contents = GET_CONTENTS(desc);
Index: linux-2.6.13/arch/i386/kernel/ptrace.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/ptrace.c 2005-08-08 20:48:06.0000...
2007 Apr 18
1
[PATCH 6/14] i386 / Add some segment convenience functions
...- lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
+ if (segment_from_ldt(regs->xcs) && (current->mm)) {
+ lp = (unsigned long *) ((unsigned long)(segment_index(regs->xcs) * 8)
+ (char *) current->mm->context.ldt);
addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
sizeof(kprobe_opcode_t));
Index: linux-2.6.13/arch/i386/kernel/entry.S
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/entry.S 2005-08-09 19:36:36.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/entry.S 2005-08...
2007 Apr 18
1
[PATCH 6/14] i386 / Add some segment convenience functions
...- lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
+ if (segment_from_ldt(regs->xcs) && (current->mm)) {
+ lp = (unsigned long *) ((unsigned long)(segment_index(regs->xcs) * 8)
+ (char *) current->mm->context.ldt);
addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
sizeof(kprobe_opcode_t));
Index: linux-2.6.13/arch/i386/kernel/entry.S
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/entry.S 2005-08-09 19:36:36.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/entry.S 2005-08...
2007 Apr 18
0
[PATCH 11/14] i386 / Eliminate yet another redundant accessor
...fine get_desc_writable(desc) (((desc)->b >> 9) & 1)
+#define get_desc_gran(desc) (((desc)->b >> 23) & 1)
+#define get_desc_present(desc) (((desc)->b >> 15) & 1)
+#define get_desc_usable(desc) (((desc)->b >> 20) & 1)
+
static inline unsigned long get_desc_base(struct desc_struct *desc)
{
unsigned long base;
@@ -36,6 +43,19 @@
return limit;
}
+static inline void convert_desc_to_user(struct desc_struct *desc, struct user_desc *info, int idx)
+{
+ info->entry_number = idx;
+ info->base_addr = get_desc_base(desc);
+ info->limit = get_desc_li...
2007 Apr 18
0
[PATCH 11/14] i386 / Eliminate yet another redundant accessor
...fine get_desc_writable(desc) (((desc)->b >> 9) & 1)
+#define get_desc_gran(desc) (((desc)->b >> 23) & 1)
+#define get_desc_present(desc) (((desc)->b >> 15) & 1)
+#define get_desc_usable(desc) (((desc)->b >> 20) & 1)
+
static inline unsigned long get_desc_base(struct desc_struct *desc)
{
unsigned long base;
@@ -36,6 +43,19 @@
return limit;
}
+static inline void convert_desc_to_user(struct desc_struct *desc, struct user_desc *info, int idx)
+{
+ info->entry_number = idx;
+ info->base_addr = get_desc_base(desc);
+ info->limit = get_desc_li...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...t;
> #define CPU_16BIT_STACK_SIZE 1024
>
> +/* The number of LDT entries per page */
> +#define LDT_ENTRIES_PER_PAGE (PAGE_SIZE / LDT_ENTRY_SIZE)
> +
> #ifndef __ASSEMBLY__
>
> #include <linux/preempt.h>
> @@ -30,7 +33,7 @@
> static inline unsigned long get_desc_base(struct desc_struct *desc)
> {
> unsigned long base;
> - base = ((desc->a >> 16) & 0x0000ffff) |
> + base = (desc->a >> 16) |
Seemingly unrelated.
> ((desc->b << 16) & 0x00ff0000) |
> (desc->b & 0xff000000);
> return base;...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...t;
> #define CPU_16BIT_STACK_SIZE 1024
>
> +/* The number of LDT entries per page */
> +#define LDT_ENTRIES_PER_PAGE (PAGE_SIZE / LDT_ENTRY_SIZE)
> +
> #ifndef __ASSEMBLY__
>
> #include <linux/preempt.h>
> @@ -30,7 +33,7 @@
> static inline unsigned long get_desc_base(struct desc_struct *desc)
> {
> unsigned long base;
> - base = ((desc->a >> 16) & 0x0000ffff) |
> + base = (desc->a >> 16) |
Seemingly unrelated.
> ((desc->b << 16) & 0x00ff0000) |
> (desc->b & 0xff000000);
> return base;...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...semaphore, so
+ * wait to disable preempt since we may take interrupts here.
*/
- if ((regs->xcs & 4) && (current->mm)) {
- lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
- + (char *) current->mm->context.ldt);
- addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
- sizeof(kprobe_opcode_t));
- } else {
- addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
- }
- /* Check we're not actually recursing */
- if (kprobe_running()) {
+ addr = (kprobe_opcode_t *)convert_eip_to_linear(regs,
+ regs->eip - sizeof(kp...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...semaphore, so
+ * wait to disable preempt since we may take interrupts here.
*/
- if ((regs->xcs & 4) && (current->mm)) {
- lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
- + (char *) current->mm->context.ldt);
- addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
- sizeof(kprobe_opcode_t));
- } else {
- addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
- }
- /* Check we're not actually recursing */
- if (kprobe_running()) {
+ addr = (kprobe_opcode_t *)convert_eip_to_linear(regs,
+ regs->eip - sizeof(kp...
2007 Apr 18
2
[PATCH 16/21] i386 Eliminate duplicate segment macros
...inline void set_ldt_desc(unsigned
set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82);
}
+static inline void convert_desc_to_user(struct desc_struct *desc, struct user_desc *info, int idx)
+{
+ info->entry_number = idx;
+ info->base_addr = get_desc_base(desc);
+ info->limit = get_desc_limit(desc);
+ info->seg_32bit = get_desc_32bit(desc);
+ info->contents = get_desc_contents(desc);
+ info->read_exec_only = !get_desc_writable(desc);
+ info->limit_in_pages = get_desc_gran(desc);
+ info->seg_not_present = !get_desc_present(desc);
+...
2007 Apr 18
2
[PATCH 16/21] i386 Eliminate duplicate segment macros
...inline void set_ldt_desc(unsigned
set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82);
}
+static inline void convert_desc_to_user(struct desc_struct *desc, struct user_desc *info, int idx)
+{
+ info->entry_number = idx;
+ info->base_addr = get_desc_base(desc);
+ info->limit = get_desc_limit(desc);
+ info->seg_32bit = get_desc_32bit(desc);
+ info->contents = get_desc_contents(desc);
+ info->read_exec_only = !get_desc_writable(desc);
+ info->limit_in_pages = get_desc_gran(desc);
+ info->seg_not_present = !get_desc_present(desc);
+...