diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-30 16:01:04 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-30 16:01:04 -0500 |
| commit | 66a45cc4cc1c1f7d1ccae4d0fee261eab5560682 (patch) | |
| tree | 208dc2307a2fb9c753026bf17509a0738ada1173 | |
| parent | 8639dad84e4fe83577006e8e2bd9da79c6c2c41e (diff) | |
| parent | b627c8b17ccacba38c975bc0f69a49fc4e5261c9 (diff) | |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: always define DECLARE_PCI_UNMAP* macros
x86: fixup config space size of CPU functions for AMD family 11h
x86, bts: fix wrmsr and spinlock over kmalloc
x86, pebs: fix PEBS record size configuration
x86, bts: turn macro into static inline function
x86, bts: exclude ds.c from build when disabled
arch/x86/kernel/pci-calgary_64.c: change simple_strtol to simple_strtoul
x86: use limited register constraint for setnz
xen: pin correct PGD on suspend
x86: revert irq number limitation
x86: fixing __cpuinit/__init tangle, xsave_cntxt_init()
x86: fix __cpuinit/__init tangle in init_thread_xstate()
oprofile: fix an overflow in ppro code
| -rw-r--r-- | arch/x86/boot/tty.c | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/ds.h | 6 | ||||
| -rw-r--r-- | arch/x86/include/asm/pci_64.h | 14 | ||||
| -rw-r--r-- | arch/x86/kernel/Makefile | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/ds.c | 88 | ||||
| -rw-r--r-- | arch/x86/kernel/i387.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/io_apic.c | 22 | ||||
| -rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/xsave.c | 2 | ||||
| -rw-r--r-- | arch/x86/oprofile/op_model_ppro.c | 2 | ||||
| -rw-r--r-- | arch/x86/pci/fixup.c | 25 | ||||
| -rw-r--r-- | arch/x86/xen/mmu.c | 21 |
12 files changed, 87 insertions, 101 deletions
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c index 0be77b39328a..7e8e8b25f5f6 100644 --- a/arch/x86/boot/tty.c +++ b/arch/x86/boot/tty.c | |||
| @@ -74,7 +74,7 @@ static int kbd_pending(void) | |||
| 74 | { | 74 | { |
| 75 | u8 pending; | 75 | u8 pending; |
| 76 | asm volatile("int $0x16; setnz %0" | 76 | asm volatile("int $0x16; setnz %0" |
| 77 | : "=rm" (pending) | 77 | : "=qm" (pending) |
| 78 | : "a" (0x0100)); | 78 | : "a" (0x0100)); |
| 79 | return pending; | 79 | return pending; |
| 80 | } | 80 | } |
diff --git a/arch/x86/include/asm/ds.h b/arch/x86/include/asm/ds.h index 72c5a190bf48..a95008457ea4 100644 --- a/arch/x86/include/asm/ds.h +++ b/arch/x86/include/asm/ds.h | |||
| @@ -23,12 +23,13 @@ | |||
| 23 | #ifndef _ASM_X86_DS_H | 23 | #ifndef _ASM_X86_DS_H |
| 24 | #define _ASM_X86_DS_H | 24 | #define _ASM_X86_DS_H |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_X86_DS | ||
| 27 | 26 | ||
| 28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
| 29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 30 | 29 | ||
| 31 | 30 | ||
| 31 | #ifdef CONFIG_X86_DS | ||
| 32 | |||
| 32 | struct task_struct; | 33 | struct task_struct; |
| 33 | 34 | ||
| 34 | /* | 35 | /* |
| @@ -232,7 +233,8 @@ extern void ds_free(struct ds_context *context); | |||
| 232 | 233 | ||
| 233 | #else /* CONFIG_X86_DS */ | 234 | #else /* CONFIG_X86_DS */ |
| 234 | 235 | ||
| 235 | #define ds_init_intel(config) do {} while (0) | 236 | struct cpuinfo_x86; |
| 237 | static inline void __cpuinit ds_init_intel(struct cpuinfo_x86 *ignored) {} | ||
| 236 | 238 | ||
| 237 | #endif /* CONFIG_X86_DS */ | 239 | #endif /* CONFIG_X86_DS */ |
| 238 | #endif /* _ASM_X86_DS_H */ | 240 | #endif /* _ASM_X86_DS_H */ |
diff --git a/arch/x86/include/asm/pci_64.h b/arch/x86/include/asm/pci_64.h index 5b28995d664e..d02d936840a3 100644 --- a/arch/x86/include/asm/pci_64.h +++ b/arch/x86/include/asm/pci_64.h | |||
| @@ -34,8 +34,6 @@ extern void pci_iommu_alloc(void); | |||
| 34 | */ | 34 | */ |
| 35 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) | 35 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
| 36 | 36 | ||
| 37 | #if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU) | ||
| 38 | |||
| 39 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | 37 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ |
| 40 | dma_addr_t ADDR_NAME; | 38 | dma_addr_t ADDR_NAME; |
| 41 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | 39 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ |
| @@ -49,18 +47,6 @@ extern void pci_iommu_alloc(void); | |||
| 49 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | 47 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ |
| 50 | (((PTR)->LEN_NAME) = (VAL)) | 48 | (((PTR)->LEN_NAME) = (VAL)) |
| 51 | 49 | ||
| 52 | #else | ||
| 53 | /* No IOMMU */ | ||
| 54 | |||
| 55 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
| 56 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
| 57 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
| 58 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
| 59 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
| 60 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
| 61 | |||
| 62 | #endif | ||
| 63 | |||
| 64 | #endif /* __KERNEL__ */ | 50 | #endif /* __KERNEL__ */ |
| 65 | 51 | ||
| 66 | #endif /* _ASM_X86_PCI_64_H */ | 52 | #endif /* _ASM_X86_PCI_64_H */ |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index e489ff9cb3e2..b62a7667828e 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
| @@ -41,7 +41,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o | |||
| 41 | obj-y += process.o | 41 | obj-y += process.o |
| 42 | obj-y += i387.o xsave.o | 42 | obj-y += i387.o xsave.o |
| 43 | obj-y += ptrace.o | 43 | obj-y += ptrace.o |
| 44 | obj-y += ds.o | 44 | obj-$(CONFIG_X86_DS) += ds.o |
| 45 | obj-$(CONFIG_X86_32) += tls.o | 45 | obj-$(CONFIG_X86_32) += tls.o |
| 46 | obj-$(CONFIG_IA32_EMULATION) += tls.o | 46 | obj-$(CONFIG_IA32_EMULATION) += tls.o |
| 47 | obj-y += step.o | 47 | obj-y += step.o |
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index d1a121443bde..a2d1176c38ee 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | #ifdef CONFIG_X86_DS | ||
| 25 | |||
| 26 | #include <asm/ds.h> | 24 | #include <asm/ds.h> |
| 27 | 25 | ||
| 28 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
| @@ -211,14 +209,15 @@ static DEFINE_PER_CPU(struct ds_context *, system_context); | |||
| 211 | static inline struct ds_context *ds_get_context(struct task_struct *task) | 209 | static inline struct ds_context *ds_get_context(struct task_struct *task) |
| 212 | { | 210 | { |
| 213 | struct ds_context *context; | 211 | struct ds_context *context; |
| 212 | unsigned long irq; | ||
| 214 | 213 | ||
| 215 | spin_lock(&ds_lock); | 214 | spin_lock_irqsave(&ds_lock, irq); |
| 216 | 215 | ||
| 217 | context = (task ? task->thread.ds_ctx : this_system_context); | 216 | context = (task ? task->thread.ds_ctx : this_system_context); |
| 218 | if (context) | 217 | if (context) |
| 219 | context->count++; | 218 | context->count++; |
| 220 | 219 | ||
| 221 | spin_unlock(&ds_lock); | 220 | spin_unlock_irqrestore(&ds_lock, irq); |
| 222 | 221 | ||
| 223 | return context; | 222 | return context; |
| 224 | } | 223 | } |
| @@ -226,55 +225,46 @@ static inline struct ds_context *ds_get_context(struct task_struct *task) | |||
| 226 | /* | 225 | /* |
| 227 | * Same as ds_get_context, but allocates the context and it's DS | 226 | * Same as ds_get_context, but allocates the context and it's DS |
| 228 | * structure, if necessary; returns NULL; if out of memory. | 227 | * structure, if necessary; returns NULL; if out of memory. |
| 229 | * | ||
| 230 | * pre: requires ds_lock to be held | ||
| 231 | */ | 228 | */ |
| 232 | static inline struct ds_context *ds_alloc_context(struct task_struct *task) | 229 | static inline struct ds_context *ds_alloc_context(struct task_struct *task) |
| 233 | { | 230 | { |
| 234 | struct ds_context **p_context = | 231 | struct ds_context **p_context = |
| 235 | (task ? &task->thread.ds_ctx : &this_system_context); | 232 | (task ? &task->thread.ds_ctx : &this_system_context); |
| 236 | struct ds_context *context = *p_context; | 233 | struct ds_context *context = *p_context; |
| 234 | unsigned long irq; | ||
| 237 | 235 | ||
| 238 | if (!context) { | 236 | if (!context) { |
| 239 | spin_unlock(&ds_lock); | ||
| 240 | |||
| 241 | context = kzalloc(sizeof(*context), GFP_KERNEL); | 237 | context = kzalloc(sizeof(*context), GFP_KERNEL); |
| 242 | 238 | if (!context) | |
| 243 | if (!context) { | ||
| 244 | spin_lock(&ds_lock); | ||
| 245 | return NULL; | 239 | return NULL; |
| 246 | } | ||
| 247 | 240 | ||
| 248 | context->ds = kzalloc(ds_cfg.sizeof_ds, GFP_KERNEL); | 241 | context->ds = kzalloc(ds_cfg.sizeof_ds, GFP_KERNEL); |
| 249 | if (!context->ds) { | 242 | if (!context->ds) { |
| 250 | kfree(context); | 243 | kfree(context); |
| 251 | spin_lock(&ds_lock); | ||
| 252 | return NULL; | 244 | return NULL; |
| 253 | } | 245 | } |
| 254 | 246 | ||
| 255 | spin_lock(&ds_lock); | 247 | spin_lock_irqsave(&ds_lock, irq); |
| 256 | /* | 248 | |
| 257 | * Check for race - another CPU could have allocated | ||
| 258 | * it meanwhile: | ||
| 259 | */ | ||
| 260 | if (*p_context) { | 249 | if (*p_context) { |
| 261 | kfree(context->ds); | 250 | kfree(context->ds); |
| 262 | kfree(context); | 251 | kfree(context); |
| 263 | return *p_context; | ||
| 264 | } | ||
| 265 | 252 | ||
| 266 | *p_context = context; | 253 | context = *p_context; |
| 254 | } else { | ||
| 255 | *p_context = context; | ||
| 267 | 256 | ||
| 268 | context->this = p_context; | 257 | context->this = p_context; |
| 269 | context->task = task; | 258 | context->task = task; |
| 270 | 259 | ||
| 271 | if (task) | 260 | if (task) |
| 272 | set_tsk_thread_flag(task, TIF_DS_AREA_MSR); | 261 | set_tsk_thread_flag(task, TIF_DS_AREA_MSR); |
| 273 | 262 | ||
| 274 | if (!task || (task == current)) | 263 | if (!task || (task == current)) |
| 275 | wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0); | 264 | wrmsrl(MSR_IA32_DS_AREA, |
| 276 | 265 | (unsigned long)context->ds); | |
| 277 | get_tracer(task); | 266 | } |
| 267 | spin_unlock_irqrestore(&ds_lock, irq); | ||
| 278 | } | 268 | } |
| 279 | 269 | ||
| 280 | context->count++; | 270 | context->count++; |
| @@ -288,10 +278,12 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task) | |||
| 288 | */ | 278 | */ |
| 289 | static inline void ds_put_context(struct ds_context *context) | 279 | static inline void ds_put_context(struct ds_context *context) |
| 290 | { | 280 | { |
| 281 | unsigned long irq; | ||
| 282 | |||
| 291 | if (!context) | 283 | if (!context) |
| 292 | return; | 284 | return; |
| 293 | 285 | ||
| 294 | spin_lock(&ds_lock); | 286 | spin_lock_irqsave(&ds_lock, irq); |
| 295 | 287 | ||
| 296 | if (--context->count) | 288 | if (--context->count) |
| 297 | goto out; | 289 | goto out; |
| @@ -313,7 +305,7 @@ static inline void ds_put_context(struct ds_context *context) | |||
| 313 | kfree(context->ds); | 305 | kfree(context->ds); |
| 314 | kfree(context); | 306 | kfree(context); |
| 315 | out: | 307 | out: |
| 316 | spin_unlock(&ds_lock); | 308 | spin_unlock_irqrestore(&ds_lock, irq); |
| 317 | } | 309 | } |
| 318 | 310 | ||
| 319 | 311 | ||
| @@ -384,6 +376,7 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
| 384 | struct ds_context *context; | 376 | struct ds_context *context; |
| 385 | unsigned long buffer, adj; | 377 | unsigned long buffer, adj; |
| 386 | const unsigned long alignment = (1 << 3); | 378 | const unsigned long alignment = (1 << 3); |
| 379 | unsigned long irq; | ||
| 387 | int error = 0; | 380 | int error = 0; |
| 388 | 381 | ||
| 389 | if (!ds_cfg.sizeof_ds) | 382 | if (!ds_cfg.sizeof_ds) |
| @@ -398,26 +391,27 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
| 398 | return -EOPNOTSUPP; | 391 | return -EOPNOTSUPP; |
| 399 | 392 | ||
| 400 | 393 | ||
| 401 | spin_lock(&ds_lock); | ||
| 402 | |||
| 403 | error = -ENOMEM; | ||
| 404 | context = ds_alloc_context(task); | 394 | context = ds_alloc_context(task); |
| 405 | if (!context) | 395 | if (!context) |
| 406 | goto out_unlock; | 396 | return -ENOMEM; |
| 397 | |||
| 398 | spin_lock_irqsave(&ds_lock, irq); | ||
| 407 | 399 | ||
| 408 | error = -EPERM; | 400 | error = -EPERM; |
| 409 | if (!check_tracer(task)) | 401 | if (!check_tracer(task)) |
| 410 | goto out_unlock; | 402 | goto out_unlock; |
| 411 | 403 | ||
| 404 | get_tracer(task); | ||
| 405 | |||
| 412 | error = -EALREADY; | 406 | error = -EALREADY; |
| 413 | if (context->owner[qual] == current) | 407 | if (context->owner[qual] == current) |
| 414 | goto out_unlock; | 408 | goto out_put_tracer; |
| 415 | error = -EPERM; | 409 | error = -EPERM; |
| 416 | if (context->owner[qual] != NULL) | 410 | if (context->owner[qual] != NULL) |
| 417 | goto out_unlock; | 411 | goto out_put_tracer; |
| 418 | context->owner[qual] = current; | 412 | context->owner[qual] = current; |
| 419 | 413 | ||
| 420 | spin_unlock(&ds_lock); | 414 | spin_unlock_irqrestore(&ds_lock, irq); |
| 421 | 415 | ||
| 422 | 416 | ||
| 423 | error = -ENOMEM; | 417 | error = -ENOMEM; |
| @@ -465,10 +459,17 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
| 465 | out_release: | 459 | out_release: |
| 466 | context->owner[qual] = NULL; | 460 | context->owner[qual] = NULL; |
| 467 | ds_put_context(context); | 461 | ds_put_context(context); |
| 462 | put_tracer(task); | ||
| 463 | return error; | ||
| 464 | |||
| 465 | out_put_tracer: | ||
| 466 | spin_unlock_irqrestore(&ds_lock, irq); | ||
| 467 | ds_put_context(context); | ||
| 468 | put_tracer(task); | ||
| 468 | return error; | 469 | return error; |
| 469 | 470 | ||
| 470 | out_unlock: | 471 | out_unlock: |
| 471 | spin_unlock(&ds_lock); | 472 | spin_unlock_irqrestore(&ds_lock, irq); |
| 472 | ds_put_context(context); | 473 | ds_put_context(context); |
| 473 | return error; | 474 | return error; |
| 474 | } | 475 | } |
| @@ -818,13 +819,21 @@ static const struct ds_configuration ds_cfg_var = { | |||
| 818 | .sizeof_ds = sizeof(long) * 12, | 819 | .sizeof_ds = sizeof(long) * 12, |
| 819 | .sizeof_field = sizeof(long), | 820 | .sizeof_field = sizeof(long), |
| 820 | .sizeof_rec[ds_bts] = sizeof(long) * 3, | 821 | .sizeof_rec[ds_bts] = sizeof(long) * 3, |
| 822 | #ifdef __i386__ | ||
| 821 | .sizeof_rec[ds_pebs] = sizeof(long) * 10 | 823 | .sizeof_rec[ds_pebs] = sizeof(long) * 10 |
| 824 | #else | ||
| 825 | .sizeof_rec[ds_pebs] = sizeof(long) * 18 | ||
| 826 | #endif | ||
| 822 | }; | 827 | }; |
| 823 | static const struct ds_configuration ds_cfg_64 = { | 828 | static const struct ds_configuration ds_cfg_64 = { |
| 824 | .sizeof_ds = 8 * 12, | 829 | .sizeof_ds = 8 * 12, |
| 825 | .sizeof_field = 8, | 830 | .sizeof_field = 8, |
| 826 | .sizeof_rec[ds_bts] = 8 * 3, | 831 | .sizeof_rec[ds_bts] = 8 * 3, |
| 832 | #ifdef __i386__ | ||
| 827 | .sizeof_rec[ds_pebs] = 8 * 10 | 833 | .sizeof_rec[ds_pebs] = 8 * 10 |
| 834 | #else | ||
| 835 | .sizeof_rec[ds_pebs] = 8 * 18 | ||
| 836 | #endif | ||
| 828 | }; | 837 | }; |
| 829 | 838 | ||
| 830 | static inline void | 839 | static inline void |
| @@ -878,4 +887,3 @@ void ds_free(struct ds_context *context) | |||
| 878 | while (leftovers--) | 887 | while (leftovers--) |
| 879 | ds_put_context(context); | 888 | ds_put_context(context); |
| 880 | } | 889 | } |
| 881 | #endif /* CONFIG_X86_DS */ | ||
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 1f20608d4ca8..b0f61f0dcd0a 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
| @@ -58,7 +58,7 @@ void __cpuinit mxcsr_feature_mask_init(void) | |||
| 58 | stts(); | 58 | stts(); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | void __init init_thread_xstate(void) | 61 | void __cpuinit init_thread_xstate(void) |
| 62 | { | 62 | { |
| 63 | if (!HAVE_HWFP) { | 63 | if (!HAVE_HWFP) { |
| 64 | xstate_size = sizeof(struct i387_soft_struct); | 64 | xstate_size = sizeof(struct i387_soft_struct); |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index c9513e1ff28d..1fec0f9b1508 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
| @@ -3608,27 +3608,7 @@ int __init io_apic_get_redir_entries (int ioapic) | |||
| 3608 | 3608 | ||
| 3609 | int __init probe_nr_irqs(void) | 3609 | int __init probe_nr_irqs(void) |
| 3610 | { | 3610 | { |
| 3611 | int idx; | 3611 | return NR_IRQS; |
| 3612 | int nr = 0; | ||
| 3613 | #ifndef CONFIG_XEN | ||
| 3614 | int nr_min = 32; | ||
| 3615 | #else | ||
| 3616 | int nr_min = NR_IRQS; | ||
| 3617 | #endif | ||
| 3618 | |||
| 3619 | for (idx = 0; idx < nr_ioapics; idx++) | ||
| 3620 | nr += io_apic_get_redir_entries(idx) + 1; | ||
| 3621 | |||
| 3622 | /* double it for hotplug and msi and nmi */ | ||
| 3623 | nr <<= 1; | ||
| 3624 | |||
| 3625 | /* something wrong ? */ | ||
| 3626 | if (nr < nr_min) | ||
| 3627 | nr = nr_min; | ||
| 3628 | if (WARN_ON(nr > NR_IRQS)) | ||
| 3629 | nr = NR_IRQS; | ||
| 3630 | |||
| 3631 | return nr; | ||
| 3632 | } | 3612 | } |
| 3633 | 3613 | ||
| 3634 | /* -------------------------------------------------------------------------- | 3614 | /* -------------------------------------------------------------------------- |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index e1e731d78f38..d28bbdc35e4e 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
| @@ -1567,7 +1567,7 @@ static int __init calgary_parse_options(char *p) | |||
| 1567 | ++p; | 1567 | ++p; |
| 1568 | if (*p == '\0') | 1568 | if (*p == '\0') |
| 1569 | break; | 1569 | break; |
| 1570 | bridge = simple_strtol(p, &endp, 0); | 1570 | bridge = simple_strtoul(p, &endp, 0); |
| 1571 | if (p == endp) | 1571 | if (p == endp) |
| 1572 | break; | 1572 | break; |
| 1573 | 1573 | ||
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index b13acb75e822..15c3e6999182 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c | |||
| @@ -310,7 +310,7 @@ static void __init setup_xstate_init(void) | |||
| 310 | /* | 310 | /* |
| 311 | * Enable and initialize the xsave feature. | 311 | * Enable and initialize the xsave feature. |
| 312 | */ | 312 | */ |
| 313 | void __init xsave_cntxt_init(void) | 313 | void __ref xsave_cntxt_init(void) |
| 314 | { | 314 | { |
| 315 | unsigned int eax, ebx, ecx, edx; | 315 | unsigned int eax, ebx, ecx, edx; |
| 316 | 316 | ||
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 3f1b81a83e2e..716d26f0e5d4 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
| @@ -69,7 +69,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
| 69 | int i; | 69 | int i; |
| 70 | 70 | ||
| 71 | if (!reset_value) { | 71 | if (!reset_value) { |
| 72 | reset_value = kmalloc(sizeof(unsigned) * num_counters, | 72 | reset_value = kmalloc(sizeof(reset_value[0]) * num_counters, |
| 73 | GFP_ATOMIC); | 73 | GFP_ATOMIC); |
| 74 | if (!reset_value) | 74 | if (!reset_value) |
| 75 | return; | 75 | return; |
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 3c27a809393b..2051dc96b8e9 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
| @@ -496,21 +496,24 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015, | |||
| 496 | pci_siemens_interrupt_controller); | 496 | pci_siemens_interrupt_controller); |
| 497 | 497 | ||
| 498 | /* | 498 | /* |
| 499 | * Regular PCI devices have 256 bytes, but AMD Family 10h Opteron ext config | 499 | * Regular PCI devices have 256 bytes, but AMD Family 10h/11h CPUs have |
| 500 | * have 4096 bytes. Even if the device is capable, that doesn't mean we can | 500 | * 4096 bytes configuration space for each function of their processor |
| 501 | * access it. Maybe we don't have a way to generate extended config space | 501 | * configuration space. |
| 502 | * accesses. So check it | ||
| 503 | */ | 502 | */ |
| 504 | static void fam10h_pci_cfg_space_size(struct pci_dev *dev) | 503 | static void amd_cpu_pci_cfg_space_size(struct pci_dev *dev) |
| 505 | { | 504 | { |
| 506 | dev->cfg_size = pci_cfg_space_size_ext(dev); | 505 | dev->cfg_size = pci_cfg_space_size_ext(dev); |
| 507 | } | 506 | } |
| 508 | 507 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, amd_cpu_pci_cfg_space_size); | |
| 509 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, fam10h_pci_cfg_space_size); | 508 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, amd_cpu_pci_cfg_space_size); |
| 510 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, fam10h_pci_cfg_space_size); | 509 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, amd_cpu_pci_cfg_space_size); |
| 511 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, fam10h_pci_cfg_space_size); | 510 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, amd_cpu_pci_cfg_space_size); |
| 512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, fam10h_pci_cfg_space_size); | 511 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, amd_cpu_pci_cfg_space_size); |
| 513 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, fam10h_pci_cfg_space_size); | 512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1300, amd_cpu_pci_cfg_space_size); |
| 513 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1301, amd_cpu_pci_cfg_space_size); | ||
| 514 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1302, amd_cpu_pci_cfg_space_size); | ||
| 515 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1303, amd_cpu_pci_cfg_space_size); | ||
| 516 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1304, amd_cpu_pci_cfg_space_size); | ||
| 514 | 517 | ||
| 515 | /* | 518 | /* |
| 516 | * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from | 519 | * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 688936044dc9..636ef4caa52d 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
| @@ -661,12 +661,11 @@ void xen_set_pgd(pgd_t *ptr, pgd_t val) | |||
| 661 | * For 64-bit, we must skip the Xen hole in the middle of the address | 661 | * For 64-bit, we must skip the Xen hole in the middle of the address |
| 662 | * space, just after the big x86-64 virtual hole. | 662 | * space, just after the big x86-64 virtual hole. |
| 663 | */ | 663 | */ |
| 664 | static int xen_pgd_walk(struct mm_struct *mm, | 664 | static int __xen_pgd_walk(struct mm_struct *mm, pgd_t *pgd, |
| 665 | int (*func)(struct mm_struct *mm, struct page *, | 665 | int (*func)(struct mm_struct *mm, struct page *, |
| 666 | enum pt_level), | 666 | enum pt_level), |
| 667 | unsigned long limit) | 667 | unsigned long limit) |
| 668 | { | 668 | { |
| 669 | pgd_t *pgd = mm->pgd; | ||
| 670 | int flush = 0; | 669 | int flush = 0; |
| 671 | unsigned hole_low, hole_high; | 670 | unsigned hole_low, hole_high; |
| 672 | unsigned pgdidx_limit, pudidx_limit, pmdidx_limit; | 671 | unsigned pgdidx_limit, pudidx_limit, pmdidx_limit; |
| @@ -753,6 +752,14 @@ out: | |||
| 753 | return flush; | 752 | return flush; |
| 754 | } | 753 | } |
| 755 | 754 | ||
| 755 | static int xen_pgd_walk(struct mm_struct *mm, | ||
| 756 | int (*func)(struct mm_struct *mm, struct page *, | ||
| 757 | enum pt_level), | ||
| 758 | unsigned long limit) | ||
| 759 | { | ||
| 760 | return __xen_pgd_walk(mm, mm->pgd, func, limit); | ||
| 761 | } | ||
| 762 | |||
| 756 | /* If we're using split pte locks, then take the page's lock and | 763 | /* If we're using split pte locks, then take the page's lock and |
| 757 | return a pointer to it. Otherwise return NULL. */ | 764 | return a pointer to it. Otherwise return NULL. */ |
| 758 | static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) | 765 | static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) |
| @@ -854,7 +861,7 @@ static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | |||
| 854 | 861 | ||
| 855 | xen_mc_batch(); | 862 | xen_mc_batch(); |
| 856 | 863 | ||
| 857 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { | 864 | if (__xen_pgd_walk(mm, pgd, xen_pin_page, USER_LIMIT)) { |
| 858 | /* re-enable interrupts for flushing */ | 865 | /* re-enable interrupts for flushing */ |
| 859 | xen_mc_issue(0); | 866 | xen_mc_issue(0); |
| 860 | 867 | ||
| @@ -998,7 +1005,7 @@ static void __xen_pgd_unpin(struct mm_struct *mm, pgd_t *pgd) | |||
| 998 | PT_PMD); | 1005 | PT_PMD); |
| 999 | #endif | 1006 | #endif |
| 1000 | 1007 | ||
| 1001 | xen_pgd_walk(mm, xen_unpin_page, USER_LIMIT); | 1008 | __xen_pgd_walk(mm, pgd, xen_unpin_page, USER_LIMIT); |
| 1002 | 1009 | ||
| 1003 | xen_mc_issue(0); | 1010 | xen_mc_issue(0); |
| 1004 | } | 1011 | } |
