/[pkg-src]/trunk/kernel26-xen/patches-2.6.25-r1/1104-2.6.25-xen-Make-load_gs_index-a-paravirt-operation.patch |
Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1104-2.6.25-xen-Make-load_gs_index-a-paravirt-operation.patch
Parent Directory | Revision Log
Revision 606 -
(show annotations)
(download)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 3265 byte(s)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 3265 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | From 9c896a8941d4b979db0b63a7d477054afddeef76 Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> |
3 | Date: Fri, 4 Jan 2008 12:33:43 -0200 |
4 | Subject: [PATCH] Make load_gs_index() a paravirt operation |
5 | |
6 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> |
7 | --- |
8 | arch/x86/kernel/entry_64.S | 4 ++-- |
9 | arch/x86/kernel/paravirt.c | 3 +++ |
10 | include/asm-x86/paravirt.h | 10 +++++++++- |
11 | include/asm-x86/system.h | 3 ++- |
12 | 4 files changed, 16 insertions(+), 4 deletions(-) |
13 | |
14 | diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S |
15 | index 9f31c00..9952c3f 100644 |
16 | --- a/arch/x86/kernel/entry_64.S |
17 | +++ b/arch/x86/kernel/entry_64.S |
18 | @@ -967,7 +967,7 @@ KPROBE_END(error_entry) |
19 | |
20 | /* Reload gs selector with exception handling */ |
21 | /* edi: new selector */ |
22 | -ENTRY(load_gs_index) |
23 | +ENTRY(native_load_gs_index) |
24 | CFI_STARTPROC |
25 | pushf |
26 | CFI_ADJUST_CFA_OFFSET 8 |
27 | @@ -981,7 +981,7 @@ gs_change: |
28 | CFI_ADJUST_CFA_OFFSET -8 |
29 | ret |
30 | CFI_ENDPROC |
31 | -ENDPROC(load_gs_index) |
32 | +ENDPROC(native_load_gs_index) |
33 | |
34 | .section __ex_table,"a" |
35 | .align 8 |
36 | diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c |
37 | index 47f42bf..3f75e88 100644 |
38 | --- a/arch/x86/kernel/paravirt.c |
39 | +++ b/arch/x86/kernel/paravirt.c |
40 | @@ -340,6 +340,9 @@ struct pv_cpu_ops pv_cpu_ops = { |
41 | .store_idt = native_store_idt, |
42 | .store_tr = native_store_tr, |
43 | .load_tls = native_load_tls, |
44 | +#ifdef CONFIG_X86_64 |
45 | + .load_gs_index = native_load_gs_index, |
46 | +#endif |
47 | .write_ldt_entry = native_write_ldt_entry, |
48 | .write_gdt_entry = native_write_gdt_entry, |
49 | .write_idt_entry = native_write_idt_entry, |
50 | diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h |
51 | index 7edbeda..292db13 100644 |
52 | --- a/include/asm-x86/paravirt.h |
53 | +++ b/include/asm-x86/paravirt.h |
54 | @@ -118,6 +118,9 @@ struct pv_cpu_ops { |
55 | #endif |
56 | unsigned long (*store_tr)(void); |
57 | void (*load_tls)(struct thread_struct *t, unsigned int cpu); |
58 | +#ifdef CONFIG_X86_64 |
59 | + void (*load_gs_index)(unsigned int idx); |
60 | +#endif |
61 | void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum, |
62 | const void *desc); |
63 | void (*write_gdt_entry)(struct desc_struct *, |
64 | @@ -798,7 +801,12 @@ static inline void load_TLS(struct thread_struct *t, unsigned cpu) |
65 | { |
66 | PVOP_VCALL2(pv_cpu_ops.load_tls, t, cpu); |
67 | } |
68 | - |
69 | +#ifdef CONFIG_X86_64 |
70 | +static inline void load_gs_index(unsigned int idx) |
71 | +{ |
72 | + PVOP_VCALL1(pv_cpu_ops.load_gs_index, idx); |
73 | +} |
74 | +#endif |
75 | static inline void write_ldt_entry(struct desc_struct *dt, int entry, |
76 | const void *desc) |
77 | { |
78 | diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h |
79 | index 9cff02f..d6623cb 100644 |
80 | --- a/include/asm-x86/system.h |
81 | +++ b/include/asm-x86/system.h |
82 | @@ -114,7 +114,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ |
83 | #define set_base(ldt, base) _set_base(((char *)&(ldt)) , (base)) |
84 | #define set_limit(ldt, limit) _set_limit(((char *)&(ldt)) , ((limit)-1)) |
85 | |
86 | -extern void load_gs_index(unsigned); |
87 | +extern void native_load_gs_index(unsigned); |
88 | |
89 | /* |
90 | * Load a segment. Fall back on loading the zero |
91 | @@ -260,6 +260,7 @@ static inline void native_wbinvd(void) |
92 | #ifdef CONFIG_X86_64 |
93 | #define read_cr8() (native_read_cr8()) |
94 | #define write_cr8(x) (native_write_cr8(x)) |
95 | +#define load_gs_index native_load_gs_index |
96 | #endif |
97 | |
98 | /* Clear the 'TS' bit */ |
99 | -- |
100 | 1.5.4.1 |
101 |