diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-02-10 19:55:28 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-10 19:55:28 -0500 |
commit | 84abd88a70090cf00f9e45c3a81680874f17626e (patch) | |
tree | 4f58b80057f6e1f5817af1dc33a5458b3dfc9a99 /arch/x86/xen/enlighten.c | |
parent | 13ca0fcaa33f6b1984c4111b6ec5df42689fea6f (diff) | |
parent | e28cab42f384745c8a947a9ccd51e4aae52f5d51 (diff) |
Merge remote branch 'linus/master' into x86/bootmem
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r-- | arch/x86/xen/enlighten.c | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index c5e805d4a788..36daccb68642 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -27,7 +27,9 @@ | |||
27 | #include <linux/page-flags.h> | 27 | #include <linux/page-flags.h> |
28 | #include <linux/highmem.h> | 28 | #include <linux/highmem.h> |
29 | #include <linux/console.h> | 29 | #include <linux/console.h> |
30 | #include <linux/pci.h> | ||
30 | 31 | ||
32 | #include <xen/xen.h> | ||
31 | #include <xen/interface/xen.h> | 33 | #include <xen/interface/xen.h> |
32 | #include <xen/interface/version.h> | 34 | #include <xen/interface/version.h> |
33 | #include <xen/interface/physdev.h> | 35 | #include <xen/interface/physdev.h> |
@@ -138,24 +140,23 @@ static void xen_vcpu_setup(int cpu) | |||
138 | */ | 140 | */ |
139 | void xen_vcpu_restore(void) | 141 | void xen_vcpu_restore(void) |
140 | { | 142 | { |
141 | if (have_vcpu_info_placement) { | 143 | int cpu; |
142 | int cpu; | ||
143 | 144 | ||
144 | for_each_online_cpu(cpu) { | 145 | for_each_online_cpu(cpu) { |
145 | bool other_cpu = (cpu != smp_processor_id()); | 146 | bool other_cpu = (cpu != smp_processor_id()); |
146 | 147 | ||
147 | if (other_cpu && | 148 | if (other_cpu && |
148 | HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) | 149 | HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) |
149 | BUG(); | 150 | BUG(); |
150 | 151 | ||
151 | xen_vcpu_setup(cpu); | 152 | xen_setup_runstate_info(cpu); |
152 | 153 | ||
153 | if (other_cpu && | 154 | if (have_vcpu_info_placement) |
154 | HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) | 155 | xen_vcpu_setup(cpu); |
155 | BUG(); | ||
156 | } | ||
157 | 156 | ||
158 | BUG_ON(!have_vcpu_info_placement); | 157 | if (other_cpu && |
158 | HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) | ||
159 | BUG(); | ||
159 | } | 160 | } |
160 | } | 161 | } |
161 | 162 | ||
@@ -178,6 +179,7 @@ static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0; | |||
178 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, | 179 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, |
179 | unsigned int *cx, unsigned int *dx) | 180 | unsigned int *cx, unsigned int *dx) |
180 | { | 181 | { |
182 | unsigned maskebx = ~0; | ||
181 | unsigned maskecx = ~0; | 183 | unsigned maskecx = ~0; |
182 | unsigned maskedx = ~0; | 184 | unsigned maskedx = ~0; |
183 | 185 | ||
@@ -185,9 +187,16 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
185 | * Mask out inconvenient features, to try and disable as many | 187 | * Mask out inconvenient features, to try and disable as many |
186 | * unsupported kernel subsystems as possible. | 188 | * unsupported kernel subsystems as possible. |
187 | */ | 189 | */ |
188 | if (*ax == 1) { | 190 | switch (*ax) { |
191 | case 1: | ||
189 | maskecx = cpuid_leaf1_ecx_mask; | 192 | maskecx = cpuid_leaf1_ecx_mask; |
190 | maskedx = cpuid_leaf1_edx_mask; | 193 | maskedx = cpuid_leaf1_edx_mask; |
194 | break; | ||
195 | |||
196 | case 0xb: | ||
197 | /* Suppress extended topology stuff */ | ||
198 | maskebx = 0; | ||
199 | break; | ||
191 | } | 200 | } |
192 | 201 | ||
193 | asm(XEN_EMULATE_PREFIX "cpuid" | 202 | asm(XEN_EMULATE_PREFIX "cpuid" |
@@ -197,6 +206,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
197 | "=d" (*dx) | 206 | "=d" (*dx) |
198 | : "0" (*ax), "2" (*cx)); | 207 | : "0" (*ax), "2" (*cx)); |
199 | 208 | ||
209 | *bx &= maskebx; | ||
200 | *cx &= maskecx; | 210 | *cx &= maskecx; |
201 | *dx &= maskedx; | 211 | *dx &= maskedx; |
202 | } | 212 | } |
@@ -1075,6 +1085,8 @@ asmlinkage void __init xen_start_kernel(void) | |||
1075 | * Set up some pagetable state before starting to set any ptes. | 1085 | * Set up some pagetable state before starting to set any ptes. |
1076 | */ | 1086 | */ |
1077 | 1087 | ||
1088 | xen_init_mmu_ops(); | ||
1089 | |||
1078 | /* Prevent unwanted bits from being set in PTEs. */ | 1090 | /* Prevent unwanted bits from being set in PTEs. */ |
1079 | __supported_pte_mask &= ~_PAGE_GLOBAL; | 1091 | __supported_pte_mask &= ~_PAGE_GLOBAL; |
1080 | if (!xen_initial_domain()) | 1092 | if (!xen_initial_domain()) |
@@ -1097,7 +1109,6 @@ asmlinkage void __init xen_start_kernel(void) | |||
1097 | */ | 1109 | */ |
1098 | xen_setup_stackprotector(); | 1110 | xen_setup_stackprotector(); |
1099 | 1111 | ||
1100 | xen_init_mmu_ops(); | ||
1101 | xen_init_irq_ops(); | 1112 | xen_init_irq_ops(); |
1102 | xen_init_cpuid_mask(); | 1113 | xen_init_cpuid_mask(); |
1103 | 1114 | ||
@@ -1140,9 +1151,13 @@ asmlinkage void __init xen_start_kernel(void) | |||
1140 | 1151 | ||
1141 | /* keep using Xen gdt for now; no urgent need to change it */ | 1152 | /* keep using Xen gdt for now; no urgent need to change it */ |
1142 | 1153 | ||
1154 | #ifdef CONFIG_X86_32 | ||
1143 | pv_info.kernel_rpl = 1; | 1155 | pv_info.kernel_rpl = 1; |
1144 | if (xen_feature(XENFEAT_supervisor_mode_kernel)) | 1156 | if (xen_feature(XENFEAT_supervisor_mode_kernel)) |
1145 | pv_info.kernel_rpl = 0; | 1157 | pv_info.kernel_rpl = 0; |
1158 | #else | ||
1159 | pv_info.kernel_rpl = 0; | ||
1160 | #endif | ||
1146 | 1161 | ||
1147 | /* set the limit of our address space */ | 1162 | /* set the limit of our address space */ |
1148 | xen_reserve_top(); | 1163 | xen_reserve_top(); |
@@ -1166,10 +1181,16 @@ asmlinkage void __init xen_start_kernel(void) | |||
1166 | add_preferred_console("xenboot", 0, NULL); | 1181 | add_preferred_console("xenboot", 0, NULL); |
1167 | add_preferred_console("tty", 0, NULL); | 1182 | add_preferred_console("tty", 0, NULL); |
1168 | add_preferred_console("hvc", 0, NULL); | 1183 | add_preferred_console("hvc", 0, NULL); |
1184 | } else { | ||
1185 | /* Make sure ACS will be enabled */ | ||
1186 | pci_request_acs(); | ||
1169 | } | 1187 | } |
1188 | |||
1170 | 1189 | ||
1171 | xen_raw_console_write("about to get started...\n"); | 1190 | xen_raw_console_write("about to get started...\n"); |
1172 | 1191 | ||
1192 | xen_setup_runstate_info(0); | ||
1193 | |||
1173 | /* Start the world */ | 1194 | /* Start the world */ |
1174 | #ifdef CONFIG_X86_32 | 1195 | #ifdef CONFIG_X86_32 |
1175 | i386_start_kernel(); | 1196 | i386_start_kernel(); |