diff options
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/acpi/Makefile | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/processor.c | 101 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 32 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_cluster.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_phys.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/amd.c | 53 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/intel.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/cpuid.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/dumpstack.c | 33 | ||||
| -rw-r--r-- | arch/x86/kernel/dumpstack.h | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/e820.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/microcode_core.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/msr.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/stacktrace.c | 18 | ||||
| -rw-r--r-- | arch/x86/kernel/tsc.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/uv_irq.c | 3 |
22 files changed, 87 insertions, 208 deletions
diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile index fd5ca97a2ad5..6f35260bb3ef 100644 --- a/arch/x86/kernel/acpi/Makefile +++ b/arch/x86/kernel/acpi/Makefile | |||
| @@ -4,7 +4,7 @@ obj-$(CONFIG_ACPI) += boot.o | |||
| 4 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o | 4 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o |
| 5 | 5 | ||
| 6 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | 6 | ifneq ($(CONFIG_ACPI_PROCESSOR),) |
| 7 | obj-y += cstate.o processor.o | 7 | obj-y += cstate.o |
| 8 | endif | 8 | endif |
| 9 | 9 | ||
| 10 | $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin | 10 | $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin |
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c deleted file mode 100644 index d85d1b2432ba..000000000000 --- a/arch/x86/kernel/acpi/processor.c +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005 Intel Corporation | ||
| 3 | * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
| 4 | * - Added _PDC for platforms with Intel CPUs | ||
| 5 | */ | ||
| 6 | |||
| 7 | #include <linux/kernel.h> | ||
| 8 | #include <linux/module.h> | ||
| 9 | #include <linux/init.h> | ||
| 10 | #include <linux/acpi.h> | ||
| 11 | |||
| 12 | #include <acpi/processor.h> | ||
| 13 | #include <asm/acpi.h> | ||
| 14 | |||
| 15 | static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) | ||
| 16 | { | ||
| 17 | struct acpi_object_list *obj_list; | ||
| 18 | union acpi_object *obj; | ||
| 19 | u32 *buf; | ||
| 20 | |||
| 21 | /* allocate and initialize pdc. It will be used later. */ | ||
| 22 | obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); | ||
| 23 | if (!obj_list) { | ||
| 24 | printk(KERN_ERR "Memory allocation error\n"); | ||
| 25 | return; | ||
| 26 | } | ||
| 27 | |||
| 28 | obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); | ||
| 29 | if (!obj) { | ||
| 30 | printk(KERN_ERR "Memory allocation error\n"); | ||
| 31 | kfree(obj_list); | ||
| 32 | return; | ||
| 33 | } | ||
| 34 | |||
| 35 | buf = kmalloc(12, GFP_KERNEL); | ||
| 36 | if (!buf) { | ||
| 37 | printk(KERN_ERR "Memory allocation error\n"); | ||
| 38 | kfree(obj); | ||
| 39 | kfree(obj_list); | ||
| 40 | return; | ||
| 41 | } | ||
| 42 | |||
| 43 | buf[0] = ACPI_PDC_REVISION_ID; | ||
| 44 | buf[1] = 1; | ||
| 45 | buf[2] = ACPI_PDC_C_CAPABILITY_SMP; | ||
| 46 | |||
| 47 | /* | ||
| 48 | * The default of PDC_SMP_T_SWCOORD bit is set for intel x86 cpu so | ||
| 49 | * that OSPM is capable of native ACPI throttling software | ||
| 50 | * coordination using BIOS supplied _TSD info. | ||
| 51 | */ | ||
| 52 | buf[2] |= ACPI_PDC_SMP_T_SWCOORD; | ||
| 53 | if (cpu_has(c, X86_FEATURE_EST)) | ||
| 54 | buf[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP; | ||
| 55 | |||
| 56 | if (cpu_has(c, X86_FEATURE_ACPI)) | ||
| 57 | buf[2] |= ACPI_PDC_T_FFH; | ||
| 58 | |||
| 59 | /* | ||
| 60 | * If mwait/monitor is unsupported, C2/C3_FFH will be disabled | ||
| 61 | */ | ||
| 62 | if (!cpu_has(c, X86_FEATURE_MWAIT)) | ||
| 63 | buf[2] &= ~(ACPI_PDC_C_C2C3_FFH); | ||
| 64 | |||
| 65 | obj->type = ACPI_TYPE_BUFFER; | ||
| 66 | obj->buffer.length = 12; | ||
| 67 | obj->buffer.pointer = (u8 *) buf; | ||
| 68 | obj_list->count = 1; | ||
| 69 | obj_list->pointer = obj; | ||
| 70 | pr->pdc = obj_list; | ||
| 71 | |||
| 72 | return; | ||
| 73 | } | ||
| 74 | |||
| 75 | |||
| 76 | /* Initialize _PDC data based on the CPU vendor */ | ||
| 77 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr) | ||
| 78 | { | ||
| 79 | struct cpuinfo_x86 *c = &cpu_data(pr->id); | ||
| 80 | |||
| 81 | pr->pdc = NULL; | ||
| 82 | if (c->x86_vendor == X86_VENDOR_INTEL || | ||
| 83 | c->x86_vendor == X86_VENDOR_CENTAUR) | ||
| 84 | init_intel_pdc(pr, c); | ||
| 85 | |||
| 86 | return; | ||
| 87 | } | ||
| 88 | |||
| 89 | EXPORT_SYMBOL(arch_acpi_processor_init_pdc); | ||
| 90 | |||
| 91 | void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr) | ||
| 92 | { | ||
| 93 | if (pr->pdc) { | ||
| 94 | kfree(pr->pdc->pointer->buffer.pointer); | ||
| 95 | kfree(pr->pdc->pointer); | ||
| 96 | kfree(pr->pdc); | ||
| 97 | pr->pdc = NULL; | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | EXPORT_SYMBOL(arch_acpi_processor_cleanup_pdc); | ||
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index d0c99abc26c3..eacbd2b31d27 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
| @@ -306,10 +306,7 @@ physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 306 | if (cpumask_test_cpu(cpu, cpu_online_mask)) | 306 | if (cpumask_test_cpu(cpu, cpu_online_mask)) |
| 307 | break; | 307 | break; |
| 308 | } | 308 | } |
| 309 | if (cpu < nr_cpu_ids) | 309 | return per_cpu(x86_cpu_to_apicid, cpu); |
| 310 | return per_cpu(x86_cpu_to_apicid, cpu); | ||
| 311 | |||
| 312 | return BAD_APICID; | ||
| 313 | } | 310 | } |
| 314 | 311 | ||
| 315 | struct apic apic_physflat = { | 312 | struct apic apic_physflat = { |
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 38dcecfa5818..cb804c5091b9 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
| @@ -131,10 +131,7 @@ static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 131 | if (cpumask_test_cpu(cpu, cpu_online_mask)) | 131 | if (cpumask_test_cpu(cpu, cpu_online_mask)) |
| 132 | break; | 132 | break; |
| 133 | } | 133 | } |
| 134 | if (cpu < nr_cpu_ids) | 134 | return bigsmp_cpu_to_logical_apicid(cpu); |
| 135 | return bigsmp_cpu_to_logical_apicid(cpu); | ||
| 136 | |||
| 137 | return BAD_APICID; | ||
| 138 | } | 135 | } |
| 139 | 136 | ||
| 140 | static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb) | 137 | static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb) |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 11a5851f1f50..de00c4619a55 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -2276,26 +2276,28 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq | |||
| 2276 | 2276 | ||
| 2277 | /* | 2277 | /* |
| 2278 | * Either sets desc->affinity to a valid value, and returns | 2278 | * Either sets desc->affinity to a valid value, and returns |
| 2279 | * ->cpu_mask_to_apicid of that, or returns BAD_APICID and | 2279 | * ->cpu_mask_to_apicid of that in dest_id, or returns -1 and |
| 2280 | * leaves desc->affinity untouched. | 2280 | * leaves desc->affinity untouched. |
| 2281 | */ | 2281 | */ |
| 2282 | unsigned int | 2282 | unsigned int |
| 2283 | set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask) | 2283 | set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask, |
| 2284 | unsigned int *dest_id) | ||
| 2284 | { | 2285 | { |
| 2285 | struct irq_cfg *cfg; | 2286 | struct irq_cfg *cfg; |
| 2286 | unsigned int irq; | 2287 | unsigned int irq; |
| 2287 | 2288 | ||
| 2288 | if (!cpumask_intersects(mask, cpu_online_mask)) | 2289 | if (!cpumask_intersects(mask, cpu_online_mask)) |
| 2289 | return BAD_APICID; | 2290 | return -1; |
| 2290 | 2291 | ||
| 2291 | irq = desc->irq; | 2292 | irq = desc->irq; |
| 2292 | cfg = desc->chip_data; | 2293 | cfg = desc->chip_data; |
| 2293 | if (assign_irq_vector(irq, cfg, mask)) | 2294 | if (assign_irq_vector(irq, cfg, mask)) |
| 2294 | return BAD_APICID; | 2295 | return -1; |
| 2295 | 2296 | ||
| 2296 | cpumask_copy(desc->affinity, mask); | 2297 | cpumask_copy(desc->affinity, mask); |
| 2297 | 2298 | ||
| 2298 | return apic->cpu_mask_to_apicid_and(desc->affinity, cfg->domain); | 2299 | *dest_id = apic->cpu_mask_to_apicid_and(desc->affinity, cfg->domain); |
| 2300 | return 0; | ||
| 2299 | } | 2301 | } |
| 2300 | 2302 | ||
| 2301 | static int | 2303 | static int |
| @@ -2311,12 +2313,11 @@ set_ioapic_affinity_irq_desc(struct irq_desc *desc, const struct cpumask *mask) | |||
| 2311 | cfg = desc->chip_data; | 2313 | cfg = desc->chip_data; |
| 2312 | 2314 | ||
| 2313 | spin_lock_irqsave(&ioapic_lock, flags); | 2315 | spin_lock_irqsave(&ioapic_lock, flags); |
| 2314 | dest = set_desc_affinity(desc, mask); | 2316 | ret = set_desc_affinity(desc, mask, &dest); |
| 2315 | if (dest != BAD_APICID) { | 2317 | if (!ret) { |
| 2316 | /* Only the high 8 bits are valid. */ | 2318 | /* Only the high 8 bits are valid. */ |
| 2317 | dest = SET_APIC_LOGICAL_ID(dest); | 2319 | dest = SET_APIC_LOGICAL_ID(dest); |
| 2318 | __target_IO_APIC_irq(irq, dest, cfg); | 2320 | __target_IO_APIC_irq(irq, dest, cfg); |
| 2319 | ret = 0; | ||
| 2320 | } | 2321 | } |
| 2321 | spin_unlock_irqrestore(&ioapic_lock, flags); | 2322 | spin_unlock_irqrestore(&ioapic_lock, flags); |
| 2322 | 2323 | ||
| @@ -3351,8 +3352,7 @@ static int set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 3351 | struct msi_msg msg; | 3352 | struct msi_msg msg; |
| 3352 | unsigned int dest; | 3353 | unsigned int dest; |
| 3353 | 3354 | ||
| 3354 | dest = set_desc_affinity(desc, mask); | 3355 | if (set_desc_affinity(desc, mask, &dest)) |
| 3355 | if (dest == BAD_APICID) | ||
| 3356 | return -1; | 3356 | return -1; |
| 3357 | 3357 | ||
| 3358 | cfg = desc->chip_data; | 3358 | cfg = desc->chip_data; |
| @@ -3384,8 +3384,7 @@ ir_set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 3384 | if (get_irte(irq, &irte)) | 3384 | if (get_irte(irq, &irte)) |
| 3385 | return -1; | 3385 | return -1; |
| 3386 | 3386 | ||
| 3387 | dest = set_desc_affinity(desc, mask); | 3387 | if (set_desc_affinity(desc, mask, &dest)) |
| 3388 | if (dest == BAD_APICID) | ||
| 3389 | return -1; | 3388 | return -1; |
| 3390 | 3389 | ||
| 3391 | irte.vector = cfg->vector; | 3390 | irte.vector = cfg->vector; |
| @@ -3567,8 +3566,7 @@ static int dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 3567 | struct msi_msg msg; | 3566 | struct msi_msg msg; |
| 3568 | unsigned int dest; | 3567 | unsigned int dest; |
| 3569 | 3568 | ||
| 3570 | dest = set_desc_affinity(desc, mask); | 3569 | if (set_desc_affinity(desc, mask, &dest)) |
| 3571 | if (dest == BAD_APICID) | ||
| 3572 | return -1; | 3570 | return -1; |
| 3573 | 3571 | ||
| 3574 | cfg = desc->chip_data; | 3572 | cfg = desc->chip_data; |
| @@ -3623,8 +3621,7 @@ static int hpet_msi_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 3623 | struct msi_msg msg; | 3621 | struct msi_msg msg; |
| 3624 | unsigned int dest; | 3622 | unsigned int dest; |
| 3625 | 3623 | ||
| 3626 | dest = set_desc_affinity(desc, mask); | 3624 | if (set_desc_affinity(desc, mask, &dest)) |
| 3627 | if (dest == BAD_APICID) | ||
| 3628 | return -1; | 3625 | return -1; |
| 3629 | 3626 | ||
| 3630 | cfg = desc->chip_data; | 3627 | cfg = desc->chip_data; |
| @@ -3730,8 +3727,7 @@ static int set_ht_irq_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 3730 | struct irq_cfg *cfg; | 3727 | struct irq_cfg *cfg; |
| 3731 | unsigned int dest; | 3728 | unsigned int dest; |
| 3732 | 3729 | ||
| 3733 | dest = set_desc_affinity(desc, mask); | 3730 | if (set_desc_affinity(desc, mask, &dest)) |
| 3734 | if (dest == BAD_APICID) | ||
| 3735 | return -1; | 3731 | return -1; |
| 3736 | 3732 | ||
| 3737 | cfg = desc->chip_data; | 3733 | cfg = desc->chip_data; |
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index a5371ec36776..cf69c59f4910 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
| @@ -148,10 +148,7 @@ x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 148 | break; | 148 | break; |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | if (cpu < nr_cpu_ids) | 151 | return per_cpu(x86_cpu_to_logical_apicid, cpu); |
| 152 | return per_cpu(x86_cpu_to_logical_apicid, cpu); | ||
| 153 | |||
| 154 | return BAD_APICID; | ||
| 155 | } | 152 | } |
| 156 | 153 | ||
| 157 | static unsigned int x2apic_cluster_phys_get_apic_id(unsigned long x) | 154 | static unsigned int x2apic_cluster_phys_get_apic_id(unsigned long x) |
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index a8989aadc99a..8972f38c5ced 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
| @@ -146,10 +146,7 @@ x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 146 | break; | 146 | break; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | if (cpu < nr_cpu_ids) | 149 | return per_cpu(x86_cpu_to_apicid, cpu); |
| 150 | return per_cpu(x86_cpu_to_apicid, cpu); | ||
| 151 | |||
| 152 | return BAD_APICID; | ||
| 153 | } | 150 | } |
| 154 | 151 | ||
| 155 | static unsigned int x2apic_phys_get_apic_id(unsigned long x) | 152 | static unsigned int x2apic_phys_get_apic_id(unsigned long x) |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index b684bb303cbf..d56b0efb2057 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -225,10 +225,7 @@ uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 225 | if (cpumask_test_cpu(cpu, cpu_online_mask)) | 225 | if (cpumask_test_cpu(cpu, cpu_online_mask)) |
| 226 | break; | 226 | break; |
| 227 | } | 227 | } |
| 228 | if (cpu < nr_cpu_ids) | 228 | return per_cpu(x86_cpu_to_apicid, cpu); |
| 229 | return per_cpu(x86_cpu_to_apicid, cpu); | ||
| 230 | |||
| 231 | return BAD_APICID; | ||
| 232 | } | 229 | } |
| 233 | 230 | ||
| 234 | static unsigned int x2apic_get_apic_id(unsigned long x) | 231 | static unsigned int x2apic_get_apic_id(unsigned long x) |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 8dc3ea145c97..e485825130d2 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
| @@ -254,59 +254,36 @@ static int __cpuinit nearby_node(int apicid) | |||
| 254 | 254 | ||
| 255 | /* | 255 | /* |
| 256 | * Fixup core topology information for AMD multi-node processors. | 256 | * Fixup core topology information for AMD multi-node processors. |
| 257 | * Assumption 1: Number of cores in each internal node is the same. | 257 | * Assumption: Number of cores in each internal node is the same. |
| 258 | * Assumption 2: Mixed systems with both single-node and dual-node | ||
| 259 | * processors are not supported. | ||
| 260 | */ | 258 | */ |
| 261 | #ifdef CONFIG_X86_HT | 259 | #ifdef CONFIG_X86_HT |
| 262 | static void __cpuinit amd_fixup_dcm(struct cpuinfo_x86 *c) | 260 | static void __cpuinit amd_fixup_dcm(struct cpuinfo_x86 *c) |
| 263 | { | 261 | { |
| 264 | #ifdef CONFIG_PCI | 262 | unsigned long long value; |
| 265 | u32 t, cpn; | 263 | u32 nodes, cores_per_node; |
| 266 | u8 n, n_id; | ||
| 267 | int cpu = smp_processor_id(); | 264 | int cpu = smp_processor_id(); |
| 268 | 265 | ||
| 266 | if (!cpu_has(c, X86_FEATURE_NODEID_MSR)) | ||
| 267 | return; | ||
| 268 | |||
| 269 | /* fixup topology information only once for a core */ | 269 | /* fixup topology information only once for a core */ |
| 270 | if (cpu_has(c, X86_FEATURE_AMD_DCM)) | 270 | if (cpu_has(c, X86_FEATURE_AMD_DCM)) |
| 271 | return; | 271 | return; |
| 272 | 272 | ||
| 273 | /* check for multi-node processor on boot cpu */ | 273 | rdmsrl(MSR_FAM10H_NODE_ID, value); |
| 274 | t = read_pci_config(0, 24, 3, 0xe8); | 274 | |
| 275 | if (!(t & (1 << 29))) | 275 | nodes = ((value >> 3) & 7) + 1; |
| 276 | if (nodes == 1) | ||
| 276 | return; | 277 | return; |
| 277 | 278 | ||
| 278 | set_cpu_cap(c, X86_FEATURE_AMD_DCM); | 279 | set_cpu_cap(c, X86_FEATURE_AMD_DCM); |
| 280 | cores_per_node = c->x86_max_cores / nodes; | ||
| 279 | 281 | ||
| 280 | /* cores per node: each internal node has half the number of cores */ | 282 | /* store NodeID, use llc_shared_map to store sibling info */ |
| 281 | cpn = c->x86_max_cores >> 1; | 283 | per_cpu(cpu_llc_id, cpu) = value & 7; |
| 282 | 284 | ||
| 283 | /* even-numbered NB_id of this dual-node processor */ | 285 | /* fixup core id to be in range from 0 to (cores_per_node - 1) */ |
| 284 | n = c->phys_proc_id << 1; | 286 | c->cpu_core_id = c->cpu_core_id % cores_per_node; |
| 285 | |||
| 286 | /* | ||
| 287 | * determine internal node id and assign cores fifty-fifty to | ||
| 288 | * each node of the dual-node processor | ||
| 289 | */ | ||
| 290 | t = read_pci_config(0, 24 + n, 3, 0xe8); | ||
| 291 | n = (t>>30) & 0x3; | ||
| 292 | if (n == 0) { | ||
| 293 | if (c->cpu_core_id < cpn) | ||
| 294 | n_id = 0; | ||
| 295 | else | ||
| 296 | n_id = 1; | ||
| 297 | } else { | ||
| 298 | if (c->cpu_core_id < cpn) | ||
| 299 | n_id = 1; | ||
| 300 | else | ||
| 301 | n_id = 0; | ||
| 302 | } | ||
| 303 | |||
| 304 | /* compute entire NodeID, use llc_shared_map to store sibling info */ | ||
| 305 | per_cpu(cpu_llc_id, cpu) = (c->phys_proc_id << 1) + n_id; | ||
| 306 | |||
| 307 | /* fixup core id to be in range from 0 to cpn */ | ||
| 308 | c->cpu_core_id = c->cpu_core_id % cpn; | ||
| 309 | #endif | ||
| 310 | } | 287 | } |
| 311 | #endif | 288 | #endif |
| 312 | 289 | ||
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 9c31e8b09d2c..879666f4d871 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
| @@ -70,7 +70,6 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
| 70 | if (c->x86_power & (1 << 8)) { | 70 | if (c->x86_power & (1 << 8)) { |
| 71 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | 71 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); |
| 72 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); | 72 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); |
| 73 | set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE); | ||
| 74 | sched_clock_stable = 1; | 73 | sched_clock_stable = 1; |
| 75 | } | 74 | } |
| 76 | 75 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 45506d5dd8df..c223b7e895d9 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -2336,6 +2336,7 @@ static const struct stacktrace_ops backtrace_ops = { | |||
| 2336 | .warning_symbol = backtrace_warning_symbol, | 2336 | .warning_symbol = backtrace_warning_symbol, |
| 2337 | .stack = backtrace_stack, | 2337 | .stack = backtrace_stack, |
| 2338 | .address = backtrace_address, | 2338 | .address = backtrace_address, |
| 2339 | .walk_stack = print_context_stack_bp, | ||
| 2339 | }; | 2340 | }; |
| 2340 | 2341 | ||
| 2341 | #include "../dumpstack.h" | 2342 | #include "../dumpstack.h" |
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 7ef24a796992..cb27fd6136c9 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
| @@ -187,7 +187,8 @@ static int __init cpuid_init(void) | |||
| 187 | int i, err = 0; | 187 | int i, err = 0; |
| 188 | i = 0; | 188 | i = 0; |
| 189 | 189 | ||
| 190 | if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) { | 190 | if (__register_chrdev(CPUID_MAJOR, 0, NR_CPUS, |
| 191 | "cpu/cpuid", &cpuid_fops)) { | ||
| 191 | printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n", | 192 | printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n", |
| 192 | CPUID_MAJOR); | 193 | CPUID_MAJOR); |
| 193 | err = -EBUSY; | 194 | err = -EBUSY; |
| @@ -216,7 +217,7 @@ out_class: | |||
| 216 | } | 217 | } |
| 217 | class_destroy(cpuid_class); | 218 | class_destroy(cpuid_class); |
| 218 | out_chrdev: | 219 | out_chrdev: |
| 219 | unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); | 220 | __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid"); |
| 220 | out: | 221 | out: |
| 221 | return err; | 222 | return err; |
| 222 | } | 223 | } |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 0a0aa1cec8f1..c56bc2873030 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
| @@ -109,6 +109,30 @@ print_context_stack(struct thread_info *tinfo, | |||
| 109 | } | 109 | } |
| 110 | return bp; | 110 | return bp; |
| 111 | } | 111 | } |
| 112 | EXPORT_SYMBOL_GPL(print_context_stack); | ||
| 113 | |||
| 114 | unsigned long | ||
| 115 | print_context_stack_bp(struct thread_info *tinfo, | ||
| 116 | unsigned long *stack, unsigned long bp, | ||
| 117 | const struct stacktrace_ops *ops, void *data, | ||
| 118 | unsigned long *end, int *graph) | ||
| 119 | { | ||
| 120 | struct stack_frame *frame = (struct stack_frame *)bp; | ||
| 121 | unsigned long *ret_addr = &frame->return_address; | ||
| 122 | |||
| 123 | while (valid_stack_ptr(tinfo, ret_addr, sizeof(*ret_addr), end)) { | ||
| 124 | unsigned long addr = *ret_addr; | ||
| 125 | |||
| 126 | if (__kernel_text_address(addr)) { | ||
| 127 | ops->address(data, addr, 1); | ||
| 128 | frame = frame->next_frame; | ||
| 129 | ret_addr = &frame->return_address; | ||
| 130 | print_ftrace_graph_addr(addr, data, ops, tinfo, graph); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | return (unsigned long)frame; | ||
| 134 | } | ||
| 135 | EXPORT_SYMBOL_GPL(print_context_stack_bp); | ||
| 112 | 136 | ||
| 113 | 137 | ||
| 114 | static void | 138 | static void |
| @@ -141,10 +165,11 @@ static void print_trace_address(void *data, unsigned long addr, int reliable) | |||
| 141 | } | 165 | } |
| 142 | 166 | ||
| 143 | static const struct stacktrace_ops print_trace_ops = { | 167 | static const struct stacktrace_ops print_trace_ops = { |
| 144 | .warning = print_trace_warning, | 168 | .warning = print_trace_warning, |
| 145 | .warning_symbol = print_trace_warning_symbol, | 169 | .warning_symbol = print_trace_warning_symbol, |
| 146 | .stack = print_trace_stack, | 170 | .stack = print_trace_stack, |
| 147 | .address = print_trace_address, | 171 | .address = print_trace_address, |
| 172 | .walk_stack = print_context_stack, | ||
| 148 | }; | 173 | }; |
| 149 | 174 | ||
| 150 | void | 175 | void |
diff --git a/arch/x86/kernel/dumpstack.h b/arch/x86/kernel/dumpstack.h index 81086c227ab7..4fd1420faffa 100644 --- a/arch/x86/kernel/dumpstack.h +++ b/arch/x86/kernel/dumpstack.h | |||
| @@ -14,12 +14,6 @@ | |||
| 14 | #define get_bp(bp) asm("movq %%rbp, %0" : "=r" (bp) :) | 14 | #define get_bp(bp) asm("movq %%rbp, %0" : "=r" (bp) :) |
| 15 | #endif | 15 | #endif |
| 16 | 16 | ||
| 17 | extern unsigned long | ||
| 18 | print_context_stack(struct thread_info *tinfo, | ||
| 19 | unsigned long *stack, unsigned long bp, | ||
| 20 | const struct stacktrace_ops *ops, void *data, | ||
| 21 | unsigned long *end, int *graph); | ||
| 22 | |||
| 23 | extern void | 17 | extern void |
| 24 | show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, | 18 | show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, |
| 25 | unsigned long *stack, unsigned long bp, char *log_lvl); | 19 | unsigned long *stack, unsigned long bp, char *log_lvl); |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index e0ed4c7abb62..ae775ca47b25 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
| @@ -58,7 +58,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 58 | 58 | ||
| 59 | context = (struct thread_info *) | 59 | context = (struct thread_info *) |
| 60 | ((unsigned long)stack & (~(THREAD_SIZE - 1))); | 60 | ((unsigned long)stack & (~(THREAD_SIZE - 1))); |
| 61 | bp = print_context_stack(context, stack, bp, ops, data, NULL, &graph); | 61 | bp = ops->walk_stack(context, stack, bp, ops, data, NULL, &graph); |
| 62 | 62 | ||
| 63 | stack = (unsigned long *)context->previous_esp; | 63 | stack = (unsigned long *)context->previous_esp; |
| 64 | if (!stack) | 64 | if (!stack) |
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index b13af53883aa..0ad9597073f5 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
| @@ -188,8 +188,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 188 | if (ops->stack(data, id) < 0) | 188 | if (ops->stack(data, id) < 0) |
| 189 | break; | 189 | break; |
| 190 | 190 | ||
| 191 | bp = print_context_stack(tinfo, stack, bp, ops, | 191 | bp = ops->walk_stack(tinfo, stack, bp, ops, |
| 192 | data, estack_end, &graph); | 192 | data, estack_end, &graph); |
| 193 | ops->stack(data, "<EOE>"); | 193 | ops->stack(data, "<EOE>"); |
| 194 | /* | 194 | /* |
| 195 | * We link to the next stack via the | 195 | * We link to the next stack via the |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index f50447d961c0..05ed7ab2ca48 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
| @@ -724,7 +724,7 @@ core_initcall(e820_mark_nvs_memory); | |||
| 724 | /* | 724 | /* |
| 725 | * Early reserved memory areas. | 725 | * Early reserved memory areas. |
| 726 | */ | 726 | */ |
| 727 | #define MAX_EARLY_RES 20 | 727 | #define MAX_EARLY_RES 32 |
| 728 | 728 | ||
| 729 | struct early_res { | 729 | struct early_res { |
| 730 | u64 start, end; | 730 | u64 start, end; |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 844c02c65fcb..0c8632433090 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
| @@ -394,7 +394,7 @@ static enum ucode_state microcode_update_cpu(int cpu) | |||
| 394 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 394 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
| 395 | enum ucode_state ustate; | 395 | enum ucode_state ustate; |
| 396 | 396 | ||
| 397 | if (uci->valid && uci->mc) | 397 | if (uci->valid) |
| 398 | ustate = microcode_resume_cpu(cpu); | 398 | ustate = microcode_resume_cpu(cpu); |
| 399 | else | 399 | else |
| 400 | ustate = microcode_init_cpu(cpu); | 400 | ustate = microcode_init_cpu(cpu); |
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 572b07eee3f4..4bd93c9b2b27 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
| @@ -246,7 +246,7 @@ static int __init msr_init(void) | |||
| 246 | int i, err = 0; | 246 | int i, err = 0; |
| 247 | i = 0; | 247 | i = 0; |
| 248 | 248 | ||
| 249 | if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) { | 249 | if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", &msr_fops)) { |
| 250 | printk(KERN_ERR "msr: unable to get major %d for msr\n", | 250 | printk(KERN_ERR "msr: unable to get major %d for msr\n", |
| 251 | MSR_MAJOR); | 251 | MSR_MAJOR); |
| 252 | err = -EBUSY; | 252 | err = -EBUSY; |
| @@ -274,7 +274,7 @@ out_class: | |||
| 274 | msr_device_destroy(i); | 274 | msr_device_destroy(i); |
| 275 | class_destroy(msr_class); | 275 | class_destroy(msr_class); |
| 276 | out_chrdev: | 276 | out_chrdev: |
| 277 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); | 277 | __unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr"); |
| 278 | out: | 278 | out: |
| 279 | return err; | 279 | return err; |
| 280 | } | 280 | } |
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index c3eb207181fe..922eefbb3f6c 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c | |||
| @@ -53,17 +53,19 @@ save_stack_address_nosched(void *data, unsigned long addr, int reliable) | |||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static const struct stacktrace_ops save_stack_ops = { | 55 | static const struct stacktrace_ops save_stack_ops = { |
| 56 | .warning = save_stack_warning, | 56 | .warning = save_stack_warning, |
| 57 | .warning_symbol = save_stack_warning_symbol, | 57 | .warning_symbol = save_stack_warning_symbol, |
| 58 | .stack = save_stack_stack, | 58 | .stack = save_stack_stack, |
| 59 | .address = save_stack_address, | 59 | .address = save_stack_address, |
| 60 | .walk_stack = print_context_stack, | ||
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | static const struct stacktrace_ops save_stack_ops_nosched = { | 63 | static const struct stacktrace_ops save_stack_ops_nosched = { |
| 63 | .warning = save_stack_warning, | 64 | .warning = save_stack_warning, |
| 64 | .warning_symbol = save_stack_warning_symbol, | 65 | .warning_symbol = save_stack_warning_symbol, |
| 65 | .stack = save_stack_stack, | 66 | .stack = save_stack_stack, |
| 66 | .address = save_stack_address_nosched, | 67 | .address = save_stack_address_nosched, |
| 68 | .walk_stack = print_context_stack, | ||
| 67 | }; | 69 | }; |
| 68 | 70 | ||
| 69 | /* | 71 | /* |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index cd982f48e23e..597683aa5ba0 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
| @@ -763,6 +763,7 @@ void mark_tsc_unstable(char *reason) | |||
| 763 | { | 763 | { |
| 764 | if (!tsc_unstable) { | 764 | if (!tsc_unstable) { |
| 765 | tsc_unstable = 1; | 765 | tsc_unstable = 1; |
| 766 | sched_clock_stable = 0; | ||
| 766 | printk(KERN_INFO "Marking TSC unstable due to %s\n", reason); | 767 | printk(KERN_INFO "Marking TSC unstable due to %s\n", reason); |
| 767 | /* Change only the rating, when not registered */ | 768 | /* Change only the rating, when not registered */ |
| 768 | if (clocksource_tsc.mult) | 769 | if (clocksource_tsc.mult) |
diff --git a/arch/x86/kernel/uv_irq.c b/arch/x86/kernel/uv_irq.c index 61d805df4c91..ece73d8e3240 100644 --- a/arch/x86/kernel/uv_irq.c +++ b/arch/x86/kernel/uv_irq.c | |||
| @@ -215,8 +215,7 @@ static int uv_set_irq_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 215 | unsigned long mmr_offset; | 215 | unsigned long mmr_offset; |
| 216 | unsigned mmr_pnode; | 216 | unsigned mmr_pnode; |
| 217 | 217 | ||
| 218 | dest = set_desc_affinity(desc, mask); | 218 | if (set_desc_affinity(desc, mask, &dest)) |
| 219 | if (dest == BAD_APICID) | ||
| 220 | return -1; | 219 | return -1; |
| 221 | 220 | ||
| 222 | mmr_value = 0; | 221 | mmr_value = 0; |
