diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-12 18:53:58 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-12 18:53:58 -0500 |
| commit | 3e55f1a292583b11ff85952eec77d65a459da2dd (patch) | |
| tree | 78b315b3389b552f38ed14099c1a5a26b944964c | |
| parent | 9b0c474f0a2366d6a9c4e7a0f348875017a841a5 (diff) | |
| parent | 50c668d678fd01284799a6e4f1b91829d83cb9ed (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:
Revert "cpumask: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write"
x86: fix apic.c build error on latest git
x86: fix mpparse.c build error on latest git
x86: avoid theoretical vmalloc fault loop
x86, mtrr: fix types used in userspace exported header
| -rw-r--r-- | arch/x86/include/asm/mach-default/mach_wakecpu.h | 6 | ||||
| -rw-r--r-- | arch/x86/include/asm/mtrr.h | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/apic.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 25 | ||||
| -rw-r--r-- | arch/x86/kernel/mpparse.c | 1 | ||||
| -rw-r--r-- | arch/x86/mm/fault.c | 2 |
6 files changed, 26 insertions, 19 deletions
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h index ceb013660146..89897a6a65b9 100644 --- a/arch/x86/include/asm/mach-default/mach_wakecpu.h +++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h | |||
| @@ -24,7 +24,13 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) | |||
| 24 | { | 24 | { |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #ifdef CONFIG_SMP | ||
| 27 | extern void __inquire_remote_apic(int apicid); | 28 | extern void __inquire_remote_apic(int apicid); |
| 29 | #else /* CONFIG_SMP */ | ||
| 30 | static inline void __inquire_remote_apic(int apicid) | ||
| 31 | { | ||
| 32 | } | ||
| 33 | #endif /* CONFIG_SMP */ | ||
| 28 | 34 | ||
| 29 | static inline void inquire_remote_apic(int apicid) | 35 | static inline void inquire_remote_apic(int apicid) |
| 30 | { | 36 | { |
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h index cb988aab716d..14080d22edb3 100644 --- a/arch/x86/include/asm/mtrr.h +++ b/arch/x86/include/asm/mtrr.h | |||
| @@ -58,15 +58,15 @@ struct mtrr_gentry { | |||
| 58 | #endif /* !__i386__ */ | 58 | #endif /* !__i386__ */ |
| 59 | 59 | ||
| 60 | struct mtrr_var_range { | 60 | struct mtrr_var_range { |
| 61 | u32 base_lo; | 61 | __u32 base_lo; |
| 62 | u32 base_hi; | 62 | __u32 base_hi; |
| 63 | u32 mask_lo; | 63 | __u32 mask_lo; |
| 64 | u32 mask_hi; | 64 | __u32 mask_hi; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | /* In the Intel processor's MTRR interface, the MTRR type is always held in | 67 | /* In the Intel processor's MTRR interface, the MTRR type is always held in |
| 68 | an 8 bit field: */ | 68 | an 8 bit field: */ |
| 69 | typedef u8 mtrr_type; | 69 | typedef __u8 mtrr_type; |
| 70 | 70 | ||
| 71 | #define MTRR_NUM_FIXED_RANGES 88 | 71 | #define MTRR_NUM_FIXED_RANGES 88 |
| 72 | #define MTRR_MAX_VAR_RANGES 256 | 72 | #define MTRR_MAX_VAR_RANGES 256 |
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index 566a08466b19..0f830e4f5675 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #include <asm/proto.h> | 47 | #include <asm/proto.h> |
| 48 | #include <asm/apic.h> | 48 | #include <asm/apic.h> |
| 49 | #include <asm/i8259.h> | 49 | #include <asm/i8259.h> |
| 50 | #include <asm/smp.h> | ||
| 50 | 51 | ||
| 51 | #include <mach_apic.h> | 52 | #include <mach_apic.h> |
| 52 | #include <mach_apicdef.h> | 53 | #include <mach_apicdef.h> |
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 06fcd8f9323c..6f11e029e8c5 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
| @@ -150,9 +150,8 @@ struct drv_cmd { | |||
| 150 | u32 val; | 150 | u32 val; |
| 151 | }; | 151 | }; |
| 152 | 152 | ||
| 153 | static long do_drv_read(void *_cmd) | 153 | static void do_drv_read(struct drv_cmd *cmd) |
| 154 | { | 154 | { |
| 155 | struct drv_cmd *cmd = _cmd; | ||
| 156 | u32 h; | 155 | u32 h; |
| 157 | 156 | ||
| 158 | switch (cmd->type) { | 157 | switch (cmd->type) { |
| @@ -167,12 +166,10 @@ static long do_drv_read(void *_cmd) | |||
| 167 | default: | 166 | default: |
| 168 | break; | 167 | break; |
| 169 | } | 168 | } |
| 170 | return 0; | ||
| 171 | } | 169 | } |
| 172 | 170 | ||
| 173 | static long do_drv_write(void *_cmd) | 171 | static void do_drv_write(struct drv_cmd *cmd) |
| 174 | { | 172 | { |
| 175 | struct drv_cmd *cmd = _cmd; | ||
| 176 | u32 lo, hi; | 173 | u32 lo, hi; |
| 177 | 174 | ||
| 178 | switch (cmd->type) { | 175 | switch (cmd->type) { |
| @@ -189,23 +186,30 @@ static long do_drv_write(void *_cmd) | |||
| 189 | default: | 186 | default: |
| 190 | break; | 187 | break; |
| 191 | } | 188 | } |
| 192 | return 0; | ||
| 193 | } | 189 | } |
| 194 | 190 | ||
| 195 | static void drv_read(struct drv_cmd *cmd) | 191 | static void drv_read(struct drv_cmd *cmd) |
| 196 | { | 192 | { |
| 193 | cpumask_t saved_mask = current->cpus_allowed; | ||
| 197 | cmd->val = 0; | 194 | cmd->val = 0; |
| 198 | 195 | ||
| 199 | work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd); | 196 | set_cpus_allowed_ptr(current, cmd->mask); |
| 197 | do_drv_read(cmd); | ||
| 198 | set_cpus_allowed_ptr(current, &saved_mask); | ||
| 200 | } | 199 | } |
| 201 | 200 | ||
| 202 | static void drv_write(struct drv_cmd *cmd) | 201 | static void drv_write(struct drv_cmd *cmd) |
| 203 | { | 202 | { |
| 203 | cpumask_t saved_mask = current->cpus_allowed; | ||
| 204 | unsigned int i; | 204 | unsigned int i; |
| 205 | 205 | ||
| 206 | for_each_cpu(i, cmd->mask) { | 206 | for_each_cpu(i, cmd->mask) { |
| 207 | work_on_cpu(i, do_drv_write, cmd); | 207 | set_cpus_allowed_ptr(current, cpumask_of(i)); |
| 208 | do_drv_write(cmd); | ||
| 208 | } | 209 | } |
| 210 | |||
| 211 | set_cpus_allowed_ptr(current, &saved_mask); | ||
| 212 | return; | ||
| 209 | } | 213 | } |
| 210 | 214 | ||
| 211 | static u32 get_cur_val(const struct cpumask *mask) | 215 | static u32 get_cur_val(const struct cpumask *mask) |
| @@ -231,15 +235,10 @@ static u32 get_cur_val(const struct cpumask *mask) | |||
| 231 | return 0; | 235 | return 0; |
| 232 | } | 236 | } |
| 233 | 237 | ||
| 234 | if (unlikely(!alloc_cpumask_var(&cmd.mask, GFP_KERNEL))) | ||
| 235 | return 0; | ||
| 236 | |||
| 237 | cpumask_copy(cmd.mask, mask); | 238 | cpumask_copy(cmd.mask, mask); |
| 238 | 239 | ||
| 239 | drv_read(&cmd); | 240 | drv_read(&cmd); |
| 240 | 241 | ||
| 241 | free_cpumask_var(cmd.mask); | ||
| 242 | |||
| 243 | dprintk("get_cur_val = %u\n", cmd.val); | 242 | dprintk("get_cur_val = %u\n", cmd.val); |
| 244 | 243 | ||
| 245 | return cmd.val; | 244 | return cmd.val; |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index c0601c2848a1..a649a4ccad43 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <asm/e820.h> | 27 | #include <asm/e820.h> |
| 28 | #include <asm/trampoline.h> | 28 | #include <asm/trampoline.h> |
| 29 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
| 30 | #include <asm/smp.h> | ||
| 30 | 31 | ||
| 31 | #include <mach_apic.h> | 32 | #include <mach_apic.h> |
| 32 | #ifdef CONFIG_X86_32 | 33 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9e268b6b204e..90dfae511a41 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
| @@ -534,7 +534,7 @@ static int vmalloc_fault(unsigned long address) | |||
| 534 | happen within a race in page table update. In the later | 534 | happen within a race in page table update. In the later |
| 535 | case just flush. */ | 535 | case just flush. */ |
| 536 | 536 | ||
| 537 | pgd = pgd_offset(current->mm ?: &init_mm, address); | 537 | pgd = pgd_offset(current->active_mm, address); |
| 538 | pgd_ref = pgd_offset_k(address); | 538 | pgd_ref = pgd_offset_k(address); |
| 539 | if (pgd_none(*pgd_ref)) | 539 | if (pgd_none(*pgd_ref)) |
| 540 | return -1; | 540 | return -1; |
