Patches contributed by Eötvös Lorand University


commit 28e93a005b65cc5b4f569642e9c7903618ea5fe1
Merge: caab36b593b4 ed26dbe5ae04
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 21:49:35 2009 +0100

    Merge branch 'x86/mm' into x86/core

commit caab36b593b44c97e3c7707c6a8054b320f8d622
Merge: a1413c89ae6a 73af76dfd1f9
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 21:49:25 2009 +0100

    Merge branch 'x86/mce2' into x86/core

commit a1413c89ae6a4b7a9a43f7768934a81ffb5c629a
Merge: f254f3909efa dd4124a8a06b
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 21:48:31 2009 +0100

    Merge branch 'x86/urgent' into x86/core
    
    Conflicts:
            arch/x86/include/asm/fixmap_64.h
    Semantic merge:
            arch/x86/include/asm/fixmap.h
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --cc arch/x86/include/asm/fixmap.h
index dca8f03da5b2,23696d44a0af..63a79c77d220
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@@ -14,142 -1,11 +14,132 @@@
  #ifndef _ASM_X86_FIXMAP_H
  #define _ASM_X86_FIXMAP_H
  
 +#ifndef __ASSEMBLY__
 +#include <linux/kernel.h>
 +#include <asm/acpi.h>
 +#include <asm/apicdef.h>
 +#include <asm/page.h>
 +#ifdef CONFIG_X86_32
 +#include <linux/threads.h>
 +#include <asm/kmap_types.h>
 +#else
 +#include <asm/vsyscall.h>
- #ifdef CONFIG_EFI
- #include <asm/efi.h>
- #endif
 +#endif
 +
 +/*
 + * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall
 + * uses fixmaps that relies on FIXADDR_TOP for proper address calculation.
 + * Because of this, FIXADDR_TOP x86 integration was left as later work.
 + */
 +#ifdef CONFIG_X86_32
 +/* used by vmalloc.c, vsyscall.lds.S.
 + *
 + * Leave one empty page between vmalloc'ed areas and
 + * the start of the fixmap.
 + */
 +extern unsigned long __FIXADDR_TOP;
 +#define FIXADDR_TOP	((unsigned long)__FIXADDR_TOP)
 +
 +#define FIXADDR_USER_START     __fix_to_virt(FIX_VDSO)
 +#define FIXADDR_USER_END       __fix_to_virt(FIX_VDSO - 1)
 +#else
 +#define FIXADDR_TOP	(VSYSCALL_END-PAGE_SIZE)
 +
 +/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
 +#define FIXADDR_USER_START	((unsigned long)VSYSCALL32_VSYSCALL)
 +#define FIXADDR_USER_END	(FIXADDR_USER_START + PAGE_SIZE)
 +#endif
 +
 +
 +/*
 + * Here we define all the compile-time 'special' virtual
 + * addresses. The point is to have a constant address at
 + * compile time, but to set the physical address only
 + * in the boot process.
 + * for x86_32: We allocate these special addresses
 + * from the end of virtual memory (0xfffff000) backwards.
 + * Also this lets us do fail-safe vmalloc(), we
 + * can guarantee that these special addresses and
 + * vmalloc()-ed addresses never overlap.
 + *
 + * These 'compile-time allocated' memory buffers are
 + * fixed-size 4k pages (or larger if used with an increment
 + * higher than 1). Use set_fixmap(idx,phys) to associate
 + * physical memory with fixmap indices.
 + *
 + * TLB entries of such buffers will not be flushed across
 + * task switches.
 + */
 +enum fixed_addresses {
  #ifdef CONFIG_X86_32
 -# include "fixmap_32.h"
 +	FIX_HOLE,
 +	FIX_VDSO,
  #else
 -# include "fixmap_64.h"
 +	VSYSCALL_LAST_PAGE,
 +	VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
 +			    + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
 +	VSYSCALL_HPET,
  #endif
 +	FIX_DBGP_BASE,
 +	FIX_EARLYCON_MEM_BASE,
 +#ifdef CONFIG_X86_LOCAL_APIC
 +	FIX_APIC_BASE,	/* local (CPU) APIC) -- required for SMP or not */
 +#endif
 +#ifdef CONFIG_X86_IO_APIC
 +	FIX_IO_APIC_BASE_0,
 +	FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
 +#endif
- #ifdef CONFIG_X86_64
- #ifdef CONFIG_EFI
- 	FIX_EFI_IO_MAP_LAST_PAGE,
- 	FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
- 				  + MAX_EFI_IO_PAGES - 1,
- #endif
- #endif
 +#ifdef CONFIG_X86_VISWS_APIC
 +	FIX_CO_CPU,	/* Cobalt timer */
 +	FIX_CO_APIC,	/* Cobalt APIC Redirection Table */
 +	FIX_LI_PCIA,	/* Lithium PCI Bridge A */
 +	FIX_LI_PCIB,	/* Lithium PCI Bridge B */
 +#endif
 +#ifdef CONFIG_X86_F00F_BUG
 +	FIX_F00F_IDT,	/* Virtual mapping for IDT */
 +#endif
 +#ifdef CONFIG_X86_CYCLONE_TIMER
 +	FIX_CYCLONE_TIMER, /*cyclone timer register*/
 +#endif
 +#ifdef CONFIG_X86_32
 +	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */
 +	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 +#ifdef CONFIG_PCI_MMCONFIG
 +	FIX_PCIE_MCFG,
 +#endif
 +#endif
 +#ifdef CONFIG_PARAVIRT
 +	FIX_PARAVIRT_BOOTMAP,
 +#endif
 +	__end_of_permanent_fixed_addresses,
 +#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
 +	FIX_OHCI1394_BASE,
 +#endif
 +	/*
 +	 * 256 temporary boot-time mappings, used by early_ioremap(),
 +	 * before ioremap() is functional.
 +	 *
 +	 * We round it up to the next 256 pages boundary so that we
 +	 * can have a single pgd entry and a single pte table:
 +	 */
 +#define NR_FIX_BTMAPS		64
 +#define FIX_BTMAPS_SLOTS	4
 +	FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
 +			(__end_of_permanent_fixed_addresses & 255),
 +	FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
 +#ifdef CONFIG_X86_32
 +	FIX_WP_TEST,
 +#endif
 +	__end_of_fixed_addresses
 +};
 +
 +
 +extern void reserve_top_address(unsigned long reserve);
 +
 +#define FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 +#define FIXADDR_BOOT_SIZE	(__end_of_fixed_addresses << PAGE_SHIFT)
 +#define FIXADDR_START		(FIXADDR_TOP - FIXADDR_SIZE)
 +#define FIXADDR_BOOT_START	(FIXADDR_TOP - FIXADDR_BOOT_SIZE)
  
  extern int fixmaps_set;
  

commit b2b352590d94651579e6914ecdb08d30b2cb5f19
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 15:15:44 2009 +0100

    x86: UV, SGI RTC: add generic system vector, build fix on UP
    
    Make ack_APIC_irq() build on !SMP && !APIC too.
    
    Cc: Dimitri Sivanich <sivanich@sgi.com>
    LKML-Reference: <20090304185605.GA24419@sgi.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 4ef949c1972e..394d177d721b 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -379,6 +379,7 @@ static inline u32 safe_apic_wait_icr_idle(void)
 
 static inline void ack_APIC_irq(void)
 {
+#ifdef CONFIG_X86_LOCAL_APIC
 	/*
 	 * ack_APIC_irq() actually gets compiled as a single instruction
 	 * ... yummie.
@@ -386,6 +387,7 @@ static inline void ack_APIC_irq(void)
 
 	/* Docs say use 0 for future compatibility */
 	apic_write(APIC_EOI, 0);
+#endif
 }
 
 static inline unsigned default_get_apic_id(unsigned long x)

commit 62436fe9ee10f5e0dd087b106d69d93c9549935a
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 14:39:03 2009 +0100

    x86: move init_memory_mapping() to common mm/init.c, build fix on 32-bit PAE
    
    Impact: build fix
    
    Cc: Pekka Enberg <penberg@cs.helsinki.fi>
    Cc: Yinghai Lu <yinghai@kernel.org>
    LKML-Reference: <1236257708-27269-14-git-send-email-penberg@cs.helsinki.fi>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 4d258ad76a0f..b8238dc8786d 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -273,6 +273,7 @@ typedef struct page *pgtable_t;
 
 extern pteval_t __supported_pte_mask;
 extern int nx_enabled;
+extern void set_nx(void);
 
 #define pgprot_writecombine	pgprot_writecombine
 extern pgprot_t pgprot_writecombine(pgprot_t prot);
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 1669693e97de..5e5126e0d544 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -605,7 +605,7 @@ static int __init noexec_setup(char *str)
 }
 early_param("noexec", noexec_setup);
 
-static void __init set_nx(void)
+void __init set_nx(void)
 {
 	unsigned int v[4], l, h;
 

commit 0bd5c4f7c874cf48ff7904dcf8a59988c8fea0e8
Merge: 7df4edb07cf5 ff2c8a4167eb
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 12:47:34 2009 +0100

    Merge branch 'iommu/fixes-2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into core/iommu

diff --cc arch/x86/kernel/amd_iommu.c
index 008e522b9536,d7a7c4c063ff..c5962fe3796f
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@@ -22,11 -22,8 +22,9 @@@
  #include <linux/bitops.h>
  #include <linux/debugfs.h>
  #include <linux/scatterlist.h>
 +#include <linux/dma-mapping.h>
  #include <linux/iommu-helper.h>
- #ifdef CONFIG_IOMMU_API
  #include <linux/iommu.h>
- #endif
  #include <asm/proto.h>
  #include <asm/iommu.h>
  #include <asm/gart.h>

commit 7df4edb07cf54a4868b9a750424c0d2aa68f8d66
Merge: 0d688da5505d 559595a985e1
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 12:47:28 2009 +0100

    Merge branch 'linus' into core/iommu

diff --cc arch/ia64/hp/common/sba_iommu.c
index 129b62eb39e5,6d5e6c5630e3..56ceb68eb99d
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@@ -907,15 -906,13 +907,15 @@@ sba_mark_invalid(struct ioc *ioc, dma_a
   * @dir:  R/W or both.
   * @attrs: optional dma attributes
   *
-  * See Documentation/DMA-mapping.txt
+  * See Documentation/PCI/PCI-DMA-mapping.txt
   */
 -dma_addr_t
 -sba_map_single_attrs(struct device *dev, void *addr, size_t size, int dir,
 -		     struct dma_attrs *attrs)
 +static dma_addr_t sba_map_page(struct device *dev, struct page *page,
 +			       unsigned long poff, size_t size,
 +			       enum dma_data_direction dir,
 +			       struct dma_attrs *attrs)
  {
  	struct ioc *ioc;
 +	void *addr = page_address(page) + poff;
  	dma_addr_t iovp;
  	dma_addr_t offset;
  	u64 *pdir_start;
@@@ -1034,10 -1024,10 +1034,10 @@@ sba_mark_clean(struct ioc *ioc, dma_add
   * @dir:  R/W or both.
   * @attrs: optional dma attributes
   *
-  * See Documentation/DMA-mapping.txt
+  * See Documentation/PCI/PCI-DMA-mapping.txt
   */
 -void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
 -			    int dir, struct dma_attrs *attrs)
 +static void sba_unmap_page(struct device *dev, dma_addr_t iova, size_t size,
 +			   enum dma_data_direction dir, struct dma_attrs *attrs)
  {
  	struct ioc *ioc;
  #if DELAYED_RESOURCE_CNT > 0
@@@ -1117,9 -1102,9 +1117,9 @@@ void sba_unmap_single_attrs(struct devi
   * @size:  number of bytes mapped in driver buffer.
   * @dma_handle:  IOVA of new buffer.
   *
-  * See Documentation/DMA-mapping.txt
+  * See Documentation/PCI/PCI-DMA-mapping.txt
   */
 -void *
 +static void *
  sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags)
  {
  	struct ioc *ioc;
@@@ -1180,10 -1165,9 +1180,10 @@@
   * @vaddr:  virtual address IOVA of "consistent" buffer.
   * @dma_handler:  IO virtual address of "consistent" buffer.
   *
-  * See Documentation/DMA-mapping.txt
+  * See Documentation/PCI/PCI-DMA-mapping.txt
   */
 -void sba_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
 +static void sba_free_coherent (struct device *dev, size_t size, void *vaddr,
 +			       dma_addr_t dma_handle)
  {
  	sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL);
  	free_pages((unsigned long) vaddr, get_order(size));
@@@ -1436,11 -1420,10 +1436,11 @@@ sba_coalesce_chunks(struct ioc *ioc, st
   * @dir:  R/W or both.
   * @attrs: optional dma attributes
   *
-  * See Documentation/DMA-mapping.txt
+  * See Documentation/PCI/PCI-DMA-mapping.txt
   */
 -int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
 -		     int dir, struct dma_attrs *attrs)
 +static int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist,
 +			    int nents, enum dma_data_direction dir,
 +			    struct dma_attrs *attrs)
  {
  	struct ioc *ioc;
  	int coalesced, filled = 0;
@@@ -1528,11 -1512,10 +1528,11 @@@
   * @dir:  R/W or both.
   * @attrs: optional dma attributes
   *
-  * See Documentation/DMA-mapping.txt
+  * See Documentation/PCI/PCI-DMA-mapping.txt
   */
 -void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
 -			int nents, int dir, struct dma_attrs *attrs)
 +static void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
 +			       int nents, enum dma_data_direction dir,
 +			       struct dma_attrs *attrs)
  {
  #ifdef ASSERT_PDIR_SANITY
  	struct ioc *ioc;
diff --cc include/linux/intel-iommu.h
index 43412aeddb53,d2e3cbfba14f..4d6a0a2c00b0
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@@ -328,6 -329,13 +329,6 @@@ extern int qi_flush_iotlb(struct intel_
  			  unsigned int size_order, u64 type,
  			  int non_present_entry_flush);
  
- extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
+ extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
  
 -extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t);
 -extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t);
 -extern dma_addr_t intel_map_single(struct device *, phys_addr_t, size_t, int);
 -extern void intel_unmap_single(struct device *, dma_addr_t, size_t, int);
 -extern int intel_map_sg(struct device *, struct scatterlist *, int, int);
 -extern void intel_unmap_sg(struct device *, struct scatterlist *, int, int);
 -
  #endif

commit 2485e5184452ccbda34ff83883883d9107800dff
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 12:33:16 2009 +0100

    perfcounters: fix reserved bits sizing
    
    The sum of bits is 65 currently not 64 - so reduce the # of reserved bits
    from 55 to 54.
    
    Cc: Paul Mackerras <paulus@samba.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index c42455ab1558..dde564517b66 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -83,7 +83,7 @@ struct perf_counter_hw_event {
 				exclude_hv     :  1, /* ditto hypervisor      */
 				exclude_idle   :  1, /* don't count when idle */
 
-				__reserved_1 : 55;
+				__reserved_1   : 54;
 
 	__u32			extra_config_len;
 	__u32			__reserved_4;

commit 49d2d266adff27793fed247a2e9e672d59b6ddc6
Merge: 5512b3ece0cb fec6c6fec3e2
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 11:59:10 2009 +0100

    Merge commit 'v2.6.29-rc7' into sched/core

commit a140feab42d1cfd811930ab76104559c19dfc4b0
Merge: 1075414b0610 fec6c6fec3e2
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Mar 5 11:45:22 2009 +0100

    Merge commit 'v2.6.29-rc7' into core/locking