Magellan Linux

Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1017-2.6.25-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 606 - (show annotations) (download)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 4006 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 9376fdccd81414dacc8db02b81bba632da0efad1 Mon Sep 17 00:00:00 2001
2 From: Mark McLoughlin <markmc@redhat.com>
3 Date: Tue, 25 Mar 2008 11:56:43 +0000
4 Subject: [PATCH] xen x86_64: Only define load_user_cs_desc() on 32 bit
5
6 load_user_cs_desc() is only used on 32 bit, so only
7 define it in that case.
8
9 Fixes compile failure in native_load_user_cs_desc()
10 since mm_context_t->user_cs is only available on
11 32 bit.
12
13 Signed-off-by: Mark McLoughlin <markmc@redhat.com>
14 ---
15 arch/x86/kernel/paravirt.c | 2 ++
16 arch/x86/xen/enlighten.c | 4 ++++
17 include/asm-x86/desc.h | 4 ++++
18 include/asm-x86/paravirt.h | 4 ++++
19 4 files changed, 14 insertions(+), 0 deletions(-)
20
21 diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
22 index d59db07..c845947 100644
23 --- a/arch/x86/kernel/paravirt.c
24 +++ b/arch/x86/kernel/paravirt.c
25 @@ -331,7 +331,9 @@ struct pv_cpu_ops pv_cpu_ops = {
26 .read_tscp = native_read_tscp,
27 .load_tr_desc = native_load_tr_desc,
28 .set_ldt = native_set_ldt,
29 +#ifdef CONFIG_X86_32
30 .load_user_cs_desc = native_load_user_cs_desc,
31 +#endif
32 .load_gdt = native_load_gdt,
33 .load_idt = native_load_idt,
34 .store_gdt = native_store_gdt,
35 diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
36 index a5b111d..907567d 100644
37 --- a/arch/x86/xen/enlighten.c
38 +++ b/arch/x86/xen/enlighten.c
39 @@ -291,6 +291,7 @@ static void xen_set_ldt(const void *addr, unsigned entries)
40 xen_mc_issue(PARAVIRT_LAZY_CPU);
41 }
42
43 +#ifdef CONFIG_X86_32
44 static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
45 {
46 void *gdt;
47 @@ -306,6 +307,7 @@ static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
48
49 HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
50 }
51 +#endif
52
53 static void xen_load_gdt(const struct desc_ptr *dtr)
54 {
55 @@ -1015,7 +1017,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
56
57 .load_tr_desc = paravirt_nop,
58 .set_ldt = xen_set_ldt,
59 +#ifdef CONFIG_X86_32
60 .load_user_cs_desc = xen_load_user_cs_desc,
61 +#endif
62 .load_gdt = xen_load_gdt,
63 .load_idt = xen_load_idt,
64 .load_tls = xen_load_tls,
65 diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
66 index ec3a84a..9b280be 100644
67 --- a/include/asm-x86/desc.h
68 +++ b/include/asm-x86/desc.h
69 @@ -95,7 +95,9 @@ static inline int desc_empty(const void *ptr)
70
71 #define load_TLS(t, cpu) native_load_tls(t, cpu)
72 #define set_ldt native_set_ldt
73 +#ifdef CONFIG_X86_32
74 #define load_user_cs_desc native_load_user_cs_desc
75 +#endif
76
77 #define write_ldt_entry(dt, entry, desc) \
78 native_write_ldt_entry(dt, entry, desc)
79 @@ -362,10 +364,12 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
80 desc->b = (limit & 0xf0000) | 0x00c0fb00;
81 }
82
83 +#ifdef CONFIG_X86_32
84 static inline void native_load_user_cs_desc(int cpu, struct mm_struct *mm)
85 {
86 get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
87 }
88 +#endif
89
90 #ifdef CONFIG_X86_32
91 extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
92 diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
93 index ff8d218..7d7070a 100644
94 --- a/include/asm-x86/paravirt.h
95 +++ b/include/asm-x86/paravirt.h
96 @@ -113,7 +113,9 @@ struct pv_cpu_ops {
97 void (*store_gdt)(struct desc_ptr *);
98 void (*store_idt)(struct desc_ptr *);
99 void (*set_ldt)(const void *desc, unsigned entries);
100 +#ifdef CONFIG_X86_32
101 void (*load_user_cs_desc)(int cpu, struct mm_struct *mm);
102 +#endif
103 unsigned long (*store_tr)(void);
104 void (*load_tls)(struct thread_struct *t, unsigned int cpu);
105 void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
106 @@ -755,11 +757,13 @@ static inline void set_ldt(const void *addr, unsigned entries)
107 {
108 PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
109 }
110 +#ifdef CONFIG_X86_32
111 static inline void load_user_cs_desc(unsigned int cpu,
112 struct mm_struct *mm)
113 {
114 PVOP_VCALL2(pv_cpu_ops.load_user_cs_desc, cpu, mm);
115 }
116 +#endif
117 static inline void store_gdt(struct desc_ptr *dtr)
118 {
119 PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
120 --
121 1.5.4.1
122