Commit b8256b45 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:
  x86: add linux kernel support for YMM state
  x86: fix wrong section of pat_disable & make it static
  x86: Fix section mismatches in mpparse
  x86: fix set_fixmap to use phys_addr_t
  x86: Document get_user_pages_fast()
  x86, intr-remap: fix eoi for interrupt remapping without x2apic
parents 8255309b a30469e7
...@@ -193,8 +193,10 @@ extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size); ...@@ -193,8 +193,10 @@ extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);
*/ */
extern void early_ioremap_init(void); extern void early_ioremap_init(void);
extern void early_ioremap_reset(void); extern void early_ioremap_reset(void);
extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); extern void __iomem *early_ioremap(resource_size_t phys_addr,
extern void __iomem *early_memremap(unsigned long offset, unsigned long size); unsigned long size);
extern void __iomem *early_memremap(resource_size_t phys_addr,
unsigned long size);
extern void early_iounmap(void __iomem *addr, unsigned long size); extern void early_iounmap(void __iomem *addr, unsigned long size);
#define IO_SPACE_LIMIT 0xffff #define IO_SPACE_LIMIT 0xffff
......
...@@ -352,6 +352,11 @@ struct i387_soft_struct { ...@@ -352,6 +352,11 @@ struct i387_soft_struct {
u32 entry_eip; u32 entry_eip;
}; };
struct ymmh_struct {
/* 16 * 16 bytes for each YMMH-reg = 256 bytes */
u32 ymmh_space[64];
};
struct xsave_hdr_struct { struct xsave_hdr_struct {
u64 xstate_bv; u64 xstate_bv;
u64 reserved1[2]; u64 reserved1[2];
...@@ -361,6 +366,7 @@ struct xsave_hdr_struct { ...@@ -361,6 +366,7 @@ struct xsave_hdr_struct {
struct xsave_struct { struct xsave_struct {
struct i387_fxsave_struct i387; struct i387_fxsave_struct i387;
struct xsave_hdr_struct xsave_hdr; struct xsave_hdr_struct xsave_hdr;
struct ymmh_struct ymmh;
/* new processor state extensions will go here */ /* new processor state extensions will go here */
} __attribute__ ((packed, aligned (64))); } __attribute__ ((packed, aligned (64)));
......
...@@ -269,6 +269,11 @@ struct _xsave_hdr { ...@@ -269,6 +269,11 @@ struct _xsave_hdr {
__u64 reserved2[5]; __u64 reserved2[5];
}; };
struct _ymmh_state {
/* 16 * 16 bytes for each YMMH-reg */
__u32 ymmh_space[64];
};
/* /*
* Extended state pointed by the fpstate pointer in the sigcontext. * Extended state pointed by the fpstate pointer in the sigcontext.
* In addition to the fpstate, information encoded in the xstate_hdr * In addition to the fpstate, information encoded in the xstate_hdr
...@@ -278,6 +283,7 @@ struct _xsave_hdr { ...@@ -278,6 +283,7 @@ struct _xsave_hdr {
struct _xstate { struct _xstate {
struct _fpstate fpstate; struct _fpstate fpstate;
struct _xsave_hdr xstate_hdr; struct _xsave_hdr xstate_hdr;
struct _ymmh_state ymmh;
/* new processor state extensions go here */ /* new processor state extensions go here */
}; };
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#define XSTATE_FP 0x1 #define XSTATE_FP 0x1
#define XSTATE_SSE 0x2 #define XSTATE_SSE 0x2
#define XSTATE_YMM 0x4
#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE) #define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
/* /*
* These are the features that the OS can handle currently. * These are the features that the OS can handle currently.
*/ */
#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE) #define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
#define REX_PREFIX "0x48, " #define REX_PREFIX "0x48, "
......
...@@ -2524,7 +2524,6 @@ static void irq_complete_move(struct irq_desc **descp) ...@@ -2524,7 +2524,6 @@ static void irq_complete_move(struct irq_desc **descp)
static inline void irq_complete_move(struct irq_desc **descp) {} static inline void irq_complete_move(struct irq_desc **descp) {}
#endif #endif
#ifdef CONFIG_X86_X2APIC
static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg) static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
{ {
int apic, pin; int apic, pin;
...@@ -2558,6 +2557,7 @@ eoi_ioapic_irq(struct irq_desc *desc) ...@@ -2558,6 +2557,7 @@ eoi_ioapic_irq(struct irq_desc *desc)
spin_unlock_irqrestore(&ioapic_lock, flags); spin_unlock_irqrestore(&ioapic_lock, flags);
} }
#ifdef CONFIG_X86_X2APIC
static void ack_x2apic_level(unsigned int irq) static void ack_x2apic_level(unsigned int irq)
{ {
struct irq_desc *desc = irq_to_desc(irq); struct irq_desc *desc = irq_to_desc(irq);
...@@ -2634,6 +2634,9 @@ static void ack_apic_level(unsigned int irq) ...@@ -2634,6 +2634,9 @@ static void ack_apic_level(unsigned int irq)
*/ */
ack_APIC_irq(); ack_APIC_irq();
if (irq_remapped(irq))
eoi_ioapic_irq(desc);
/* Now we can move and renable the irq */ /* Now we can move and renable the irq */
if (unlikely(do_unmask_irq)) { if (unlikely(do_unmask_irq)) {
/* Only migrate the irq if the ack has been received. /* Only migrate the irq if the ack has been received.
......
...@@ -679,7 +679,7 @@ void __init get_smp_config(void) ...@@ -679,7 +679,7 @@ void __init get_smp_config(void)
__get_smp_config(0); __get_smp_config(0);
} }
static void smp_reserve_bootmem(struct mpf_intel *mpf) static void __init smp_reserve_bootmem(struct mpf_intel *mpf)
{ {
unsigned long size = get_mpc_size(mpf->physptr); unsigned long size = get_mpc_size(mpf->physptr);
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
...@@ -838,7 +838,7 @@ static int __init get_MP_intsrc_index(struct mpc_intsrc *m) ...@@ -838,7 +838,7 @@ static int __init get_MP_intsrc_index(struct mpc_intsrc *m)
static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM]; static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
static void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) static void __init check_irq_src(struct mpc_intsrc *m, int *nr_m_spare)
{ {
int i; int i;
...@@ -866,7 +866,8 @@ static void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) ...@@ -866,7 +866,8 @@ static void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare)
} }
} }
#else /* CONFIG_X86_IO_APIC */ #else /* CONFIG_X86_IO_APIC */
static inline void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) {} static
inline void __init check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) {}
#endif /* CONFIG_X86_IO_APIC */ #endif /* CONFIG_X86_IO_APIC */
static int check_slot(unsigned long mpc_new_phys, unsigned long mpc_new_length, static int check_slot(unsigned long mpc_new_phys, unsigned long mpc_new_length,
......
...@@ -324,7 +324,7 @@ void __ref xsave_cntxt_init(void) ...@@ -324,7 +324,7 @@ void __ref xsave_cntxt_init(void)
} }
/* /*
* for now OS knows only about FP/SSE * Support only the state known to OS.
*/ */
pcntxt_mask = pcntxt_mask & XCNTXT_MASK; pcntxt_mask = pcntxt_mask & XCNTXT_MASK;
xsave_init(); xsave_init();
......
...@@ -219,6 +219,22 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end, ...@@ -219,6 +219,22 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
return 1; return 1;
} }
/**
* get_user_pages_fast() - pin user pages in memory
* @start: starting user address
* @nr_pages: number of pages from start to pin
* @write: whether pages will be written to
* @pages: array that receives pointers to the pages pinned.
* Should be at least nr_pages long.
*
* Attempt to pin user pages in memory without taking mm->mmap_sem.
* If not successful, it will fall back to taking the lock and
* calling get_user_pages().
*
* Returns number of pages pinned. This may be fewer than the number
* requested. If nr_pages is 0 or negative, returns 0. If no pages
* were pinned, returns -errno.
*/
int get_user_pages_fast(unsigned long start, int nr_pages, int write, int get_user_pages_fast(unsigned long start, int nr_pages, int write,
struct page **pages) struct page **pages)
{ {
......
...@@ -547,7 +547,7 @@ void __init early_ioremap_reset(void) ...@@ -547,7 +547,7 @@ void __init early_ioremap_reset(void)
} }
static void __init __early_set_fixmap(enum fixed_addresses idx, static void __init __early_set_fixmap(enum fixed_addresses idx,
unsigned long phys, pgprot_t flags) phys_addr_t phys, pgprot_t flags)
{ {
unsigned long addr = __fix_to_virt(idx); unsigned long addr = __fix_to_virt(idx);
pte_t *pte; pte_t *pte;
...@@ -566,7 +566,7 @@ static void __init __early_set_fixmap(enum fixed_addresses idx, ...@@ -566,7 +566,7 @@ static void __init __early_set_fixmap(enum fixed_addresses idx,
} }
static inline void __init early_set_fixmap(enum fixed_addresses idx, static inline void __init early_set_fixmap(enum fixed_addresses idx,
unsigned long phys, pgprot_t prot) phys_addr_t phys, pgprot_t prot)
{ {
if (after_paging_init) if (after_paging_init)
__set_fixmap(idx, phys, prot); __set_fixmap(idx, phys, prot);
...@@ -607,9 +607,10 @@ static int __init check_early_ioremap_leak(void) ...@@ -607,9 +607,10 @@ static int __init check_early_ioremap_leak(void)
late_initcall(check_early_ioremap_leak); late_initcall(check_early_ioremap_leak);
static void __init __iomem * static void __init __iomem *
__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
{ {
unsigned long offset, last_addr; unsigned long offset;
resource_size_t last_addr;
unsigned int nrpages; unsigned int nrpages;
enum fixed_addresses idx0, idx; enum fixed_addresses idx0, idx;
int i, slot; int i, slot;
...@@ -625,15 +626,15 @@ __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) ...@@ -625,15 +626,15 @@ __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
} }
if (slot < 0) { if (slot < 0) {
printk(KERN_INFO "early_iomap(%08lx, %08lx) not found slot\n", printk(KERN_INFO "early_iomap(%08llx, %08lx) not found slot\n",
phys_addr, size); (u64)phys_addr, size);
WARN_ON(1); WARN_ON(1);
return NULL; return NULL;
} }
if (early_ioremap_debug) { if (early_ioremap_debug) {
printk(KERN_INFO "early_ioremap(%08lx, %08lx) [%d] => ", printk(KERN_INFO "early_ioremap(%08llx, %08lx) [%d] => ",
phys_addr, size, slot); (u64)phys_addr, size, slot);
dump_stack(); dump_stack();
} }
...@@ -680,13 +681,15 @@ __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) ...@@ -680,13 +681,15 @@ __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
} }
/* Remap an IO device */ /* Remap an IO device */
void __init __iomem *early_ioremap(unsigned long phys_addr, unsigned long size) void __init __iomem *
early_ioremap(resource_size_t phys_addr, unsigned long size)
{ {
return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO); return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO);
} }
/* Remap memory */ /* Remap memory */
void __init __iomem *early_memremap(unsigned long phys_addr, unsigned long size) void __init __iomem *
early_memremap(resource_size_t phys_addr, unsigned long size)
{ {
return __early_ioremap(phys_addr, size, PAGE_KERNEL); return __early_ioremap(phys_addr, size, PAGE_KERNEL);
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#ifdef CONFIG_X86_PAT #ifdef CONFIG_X86_PAT
int __read_mostly pat_enabled = 1; int __read_mostly pat_enabled = 1;
void __cpuinit pat_disable(const char *reason) static inline void pat_disable(const char *reason)
{ {
pat_enabled = 0; pat_enabled = 0;
printk(KERN_INFO "%s\n", reason); printk(KERN_INFO "%s\n", reason);
......
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