Commit 3e55f1a2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

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
parents 9b0c474f 50c668d6
......@@ -24,7 +24,13 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
{
}
#ifdef CONFIG_SMP
extern void __inquire_remote_apic(int apicid);
#else /* CONFIG_SMP */
static inline void __inquire_remote_apic(int apicid)
{
}
#endif /* CONFIG_SMP */
static inline void inquire_remote_apic(int apicid)
{
......
......@@ -58,15 +58,15 @@ struct mtrr_gentry {
#endif /* !__i386__ */
struct mtrr_var_range {
u32 base_lo;
u32 base_hi;
u32 mask_lo;
u32 mask_hi;
__u32 base_lo;
__u32 base_hi;
__u32 mask_lo;
__u32 mask_hi;
};
/* In the Intel processor's MTRR interface, the MTRR type is always held in
an 8 bit field: */
typedef u8 mtrr_type;
typedef __u8 mtrr_type;
#define MTRR_NUM_FIXED_RANGES 88
#define MTRR_MAX_VAR_RANGES 256
......
......@@ -47,6 +47,7 @@
#include <asm/proto.h>
#include <asm/apic.h>
#include <asm/i8259.h>
#include <asm/smp.h>
#include <mach_apic.h>
#include <mach_apicdef.h>
......
......@@ -150,9 +150,8 @@ struct drv_cmd {
u32 val;
};
static long do_drv_read(void *_cmd)
static void do_drv_read(struct drv_cmd *cmd)
{
struct drv_cmd *cmd = _cmd;
u32 h;
switch (cmd->type) {
......@@ -167,12 +166,10 @@ static long do_drv_read(void *_cmd)
default:
break;
}
return 0;
}
static long do_drv_write(void *_cmd)
static void do_drv_write(struct drv_cmd *cmd)
{
struct drv_cmd *cmd = _cmd;
u32 lo, hi;
switch (cmd->type) {
......@@ -189,23 +186,30 @@ static long do_drv_write(void *_cmd)
default:
break;
}
return 0;
}
static void drv_read(struct drv_cmd *cmd)
{
cpumask_t saved_mask = current->cpus_allowed;
cmd->val = 0;
work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd);
set_cpus_allowed_ptr(current, cmd->mask);
do_drv_read(cmd);
set_cpus_allowed_ptr(current, &saved_mask);
}
static void drv_write(struct drv_cmd *cmd)
{
cpumask_t saved_mask = current->cpus_allowed;
unsigned int i;
for_each_cpu(i, cmd->mask) {
work_on_cpu(i, do_drv_write, cmd);
set_cpus_allowed_ptr(current, cpumask_of(i));
do_drv_write(cmd);
}
set_cpus_allowed_ptr(current, &saved_mask);
return;
}
static u32 get_cur_val(const struct cpumask *mask)
......@@ -231,15 +235,10 @@ static u32 get_cur_val(const struct cpumask *mask)
return 0;
}
if (unlikely(!alloc_cpumask_var(&cmd.mask, GFP_KERNEL)))
return 0;
cpumask_copy(cmd.mask, mask);
drv_read(&cmd);
free_cpumask_var(cmd.mask);
dprintk("get_cur_val = %u\n", cmd.val);
return cmd.val;
......
......@@ -27,6 +27,7 @@
#include <asm/e820.h>
#include <asm/trampoline.h>
#include <asm/setup.h>
#include <asm/smp.h>
#include <mach_apic.h>
#ifdef CONFIG_X86_32
......
......@@ -534,7 +534,7 @@ static int vmalloc_fault(unsigned long address)
happen within a race in page table update. In the later
case just flush. */
pgd = pgd_offset(current->mm ?: &init_mm, address);
pgd = pgd_offset(current->active_mm, address);
pgd_ref = pgd_offset_k(address);
if (pgd_none(*pgd_ref))
return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment