1. 07 9月, 2010 1 次提交
  2. 31 8月, 2010 1 次提交
    • K
      x86, iommu: Fix IOMMU_INIT alignment rules · 7ac41ccf
      Konrad Rzeszutek Wilk 提交于
      This boot crash was observed:
      
       DMA-API: preallocated 32768 debug entries
       DMA-API: debugging enabled by kernel config
       BUG: unable to handle kernel paging request at 19da8955
       IP: [<f4ffffff>] 0xf4ffffff
       *pde = 00000000
      
      The crux of the failure was that even if we did not use any
      of the .iommu_table section, the linker would still insert it
      in the vmlinux file. This patch fixes that and also fixes the
      runtime crash where we would try to access the array.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      LKML-Reference: <1283191802-25086-1-git-send-email-konrad.wilk@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7ac41ccf
  3. 28 8月, 2010 1 次提交
  4. 27 8月, 2010 1 次提交
    • K
      x86, iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure · 0444ad93
      Konrad Rzeszutek Wilk 提交于
      This patch set adds a mechanism to "modularize" the IOMMUs we have
      on X86. Currently the count of IOMMUs is up to six and they have a complex
      relationship that requires careful execution order. 'pci_iommu_alloc'
      does that today, but most folks are unhappy with how it does it.
      This patch set addresses this and also paves a mechanism to jettison
      unused IOMMUs during run-time. For details that sparked this, please
      refer to: http://lkml.org/lkml/2010/8/2/282
      
      The first solution that comes to mind is to convert wholesale
      the IOMMU detection routines to be called during initcall
      time frame. Unfortunately that misses the dependency relationship
      that some of the IOMMUs have (for example: for AMD-Vi IOMMU to work,
      GART detection MUST run first, and before all of that SWIOTLB MUST run).
      
      The second solution would be to introduce a registration call wherein
      the IOMMU would provide its detection/init routines and as well on what
      MUST run before it. That would work, except that the 'pci_iommu_alloc'
      which would run through this list, is called during mem_init. This means we
      don't have any memory allocator, and it is so early that we haven't yet
      started running through the initcall_t list.
      
      This solution borrows concepts from the 2nd idea and from how
      MODULE_INIT works. A macro is provided that each IOMMU uses to define
      it's detect function and early_init (before the memory allocate is
      active), and as well what other IOMMU MUST run before us.  Since most IOMMUs
      depend on having SWIOTLB run first ("pci_swiotlb_detect") a convenience macro
      to depends on that is also provided.
      
      This macro is similar in design to MODULE_PARAM macro wherein
      we setup a .iommu_table section in which we populate it with the values
      that match a struct iommu_table_entry. During bootup we will sort
      through the array so that the IOMMUs that MUST run before us are first
      elements in the array. And then we just iterate through them calling the
      detection routine and if appropiate, the init routines.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      LKML-Reference: <1282845485-8991-2-git-send-email-konrad.wilk@oracle.com>
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: Fujita Tomonori <fujita.tomonori@lab.ntt.co.jp>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      0444ad93
  5. 30 3月, 2010 1 次提交
    • Y
      x86: Make smp_locks end with page alignment · 596b711e
      Yinghai Lu 提交于
      Fix:
      
       ------------[ cut here ]------------
       WARNING: at arch/x86/mm/init.c:342 free_init_pages+0x4c/0xfa()
       free_init_pages: range [0x40daf000, 0x40db5c24] is not aligned
       Modules linked in:
       Pid: 0, comm: swapper Not tainted
       2.6.34-rc2-tip-03946-g4f16b23-dirty #50 Call Trace:
        [<40232e9f>] warn_slowpath_common+0x65/0x7c
        [<4021c9f0>] ? free_init_pages+0x4c/0xfa
        [<40881434>] ? _etext+0x0/0x24
        [<40232eea>] warn_slowpath_fmt+0x24/0x27
        [<4021c9f0>] free_init_pages+0x4c/0xfa
        [<40881434>] ? _etext+0x0/0x24
        [<40d3f4bd>] alternative_instructions+0xf6/0x100
        [<40d3fe4f>] check_bugs+0xbd/0xbf
        [<40d398a7>] start_kernel+0x2d5/0x2e4
        [<40d390ce>] i386_start_kernel+0xce/0xd5
       ---[ end trace 4eaa2a86a8e2da22 ]---
      
      Comments in vmlinux.lds.S already said:
      
       |        /*
       |         * smp_locks might be freed after init
       |         * start/end must be page aligned
       |         */
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1269830604-26214-2-git-send-email-yinghai@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      596b711e
  6. 03 3月, 2010 2 次提交
  7. 15 12月, 2009 1 次提交
    • H
      x86: Regex support and known-movable symbols for relocs, fix _end · 873b5271
      H. Peter Anvin 提交于
      This adds a new category of symbols to the relocs program: symbols
      which are known to be relative, even though the linker emits them as
      absolute; this is the case for symbols that live in the linker script,
      which currently applies to _end.
      
      Unfortunately the previous workaround of putting _end in its own empty
      section was defeated by newer binutils, which remove empty sections
      completely.
      
      This patch also changes the symbol matching to use regular expressions
      instead of hardcoded C for specific patterns.
      
      This is a decidedly non-minimal patch: a modified version of the
      relocs program is used as part of the Syslinux build, and this 	is
      basically a backport to Linux of some of those changes; they have
      thus been well tested.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      LKML-Reference: <4AF86211.3070103@zytor.com>
      Acked-by: NMichal Marek <mmarek@suse.cz>
      Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
      873b5271
  8. 19 11月, 2009 1 次提交
    • J
      x86: Eliminate redundant/contradicting cache line size config options · 350f8f56
      Jan Beulich 提交于
      Rather than having X86_L1_CACHE_BYTES and X86_L1_CACHE_SHIFT
      (with inconsistent defaults), just having the latter suffices as
      the former can be easily calculated from it.
      
      To be consistent, also change X86_INTERNODE_CACHE_BYTES to
      X86_INTERNODE_CACHE_SHIFT, and set it to 7 (128 bytes) for NUMA
      to account for last level cache line size (which here matters
      more than L1 cache line size).
      
      Finally, make sure the default value for X86_L1_CACHE_SHIFT,
      when X86_GENERIC is selected, is being seen before that for the
      individual CPU model options (other than on x86-64, where
      GENERIC_CPU is part of the choice construct, X86_GENERIC is a
      separate option on ix86).
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Acked-by: NRavikiran Thirumalai <kiran@scalex86.org>
      Acked-by: NNick Piggin <npiggin@suse.de>
      LKML-Reference: <4AFD5710020000780001F8F0@vpn.id2.novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      350f8f56
  9. 29 10月, 2009 1 次提交
  10. 20 10月, 2009 2 次提交
  11. 16 10月, 2009 1 次提交
    • I
      x86: Document linker script ASSERT() quirk · a5912f6b
      Ingo Molnar 提交于
      Older binutils breaks if ASSERT() is used without a sink
      for the output.
      
      For example 2.14.90.0.6 is known to be broken, the link
      fails with:
      
        LD      .tmp_vmlinux1
        ld:arch/x86/kernel/vmlinux.lds:678: parse error
      
      Document this quirk in all three files that use it.
      
        See:    http://marc.info/?l=linux-kbuild&m=124930110427870&w=2
        See[2]: d2ba8b21 ("x86: Fix assert syntax in vmlinux.lds.S")
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      LKML-Reference: <4AD6523D.5030909@zytor.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a5912f6b
  12. 15 10月, 2009 2 次提交
  13. 21 9月, 2009 1 次提交
  14. 19 9月, 2009 4 次提交
  15. 25 8月, 2009 1 次提交
    • J
      x86: Fix build with older binutils and consolidate linker script · c62e4320
      Jan Beulich 提交于
      binutils prior to 2.17 can't deal with the currently possible
      situation of a new segment following the per-CPU segment, but
      that new segment being empty - objcopy misplaces the .bss (and
      perhaps also the .brk) sections outside of any segment.
      
      However, the current ordering of sections really just appears
      to be the effect of cumulative unrelated changes; re-ordering
      things allows to easily guarantee that the segment following
      the per-CPU one is non-empty, and at once eliminates the need
      for the bogus data.init2 segment.
      
      Once touching this code, also use the various data section
      helper macros from include/asm-generic/vmlinux.lds.h.
      
      -v2: fix !SMP builds.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Cc: <sam@ravnborg.org>
      LKML-Reference: <4A94085D02000078000119A5@vpn.id2.novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c62e4320
  16. 04 8月, 2009 1 次提交
  17. 18 7月, 2009 1 次提交
  18. 09 7月, 2009 1 次提交
    • T
      linker script: unify usage of discard definition · 023bf6f1
      Tejun Heo 提交于
      Discarded sections in different archs share some commonality but have
      considerable differences.  This led to linker script for each arch
      implementing its own /DISCARD/ definition, which makes maintaining
      tedious and adding new entries error-prone.
      
      This patch makes all linker scripts to move discard definitions to the
      end of the linker script and use the common DISCARDS macro.  As ld
      uses the first matching section definition, archs can include default
      discarded sections by including them earlier in the linker script.
      
      ia64 is notable because it first throws away some ia64 specific
      subsections and then include the rest of the sections into the final
      image, so those sections must be discarded before the inclusion.
      
      defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
      alpha, sparc, sparc64 and s390.  Michal Simek tested microblaze.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Tested-by: NMichal Simek <monstr@monstr.eu>
      Cc: linux-arch@vger.kernel.org
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: microblaze-uclinux@itee.uq.edu.au
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Tony Luck <tony.luck@intel.com>
      023bf6f1
  19. 12 6月, 2009 1 次提交
  20. 29 4月, 2009 14 次提交
    • I
      x86, vmlinux.lds: fix relocatable symbols · fd073194
      Ingo Molnar 提交于
      __init_begin/_end symbols should be inside sections as well,
      otherwise the relocatable kernel gets confused when freeing
      init sections in the wrong place.
      
      [ Impact: fix bootup crash ]
      
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <20090429105056.GA28720@uranus.ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fd073194
    • I
      x86, vmlinux.lds: add copyright · 91fd7fe8
      Ingo Molnar 提交于
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-2-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      91fd7fe8
    • S
      x86, vmlinux.lds: unify remaining parts · 091e52c3
      Sam Ravnborg 提交于
      32 bit:
      - explicit page align .bss
      - move ALING() out of .brk output section
      - discard *(.eh_frame)
      
      64 bit:
      - move ALIGN() out of .bss output section
      - move ALIGN() out of .brk output section
      - use a dedicated section to define _end
      
      [ Impact: unify and fix section alignments in linker script ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-13-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      091e52c3
    • S
      x86, vmlinux.lds: unify percpu · 9d16e783
      Sam Ravnborg 提交于
      32 bit:
      - move __init_end outside the .bss output section
        It really did not belong in there
      
      [ Impact: 64-bit: cleanup, 32-bit: refactor linker script ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-12-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9d16e783
    • S
      x86, vmlinux.lds: unify .exit.* and .init.ramfs · bf6a5741
      Sam Ravnborg 提交于
      [ Impact: cleanup ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-11-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bf6a5741
    • S
      x86, vmlinux.lds: unify parainstructions · ae618362
      Sam Ravnborg 提交于
      32 bit:
      
       - increase alignment from 4 to 8 for .parainstructions
       - increase alignment from 4 to 8 for .altinstructions
      
      64 bit:
      
       - move ALIGN() outside output section for .altinstructions
      
      None of the above should result in any functional change.
      
      [ Impact: refactor and unify linker script ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-10-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ae618362
    • S
      x86, vmlinux.lds: unify first part of initdata · e58bdaa8
      Sam Ravnborg 提交于
      32-bit:
      
       - Move definition of __init_begin outside output_section
         because it covers more than one section
       - Move ALIGN() for end-of-section inside .smp_locks output section.
         Same effect but the intent is better documented that
         we need both start and end aligned.
      
      64-bit:
      
       - Move ALIGN() outside output section in .init.setup
       - Deleted unused __smp_alt_* symbols
      
      None of the above should result in any functional change.
      
      [ Impact: refactor and unify linker script ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-9-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e58bdaa8
    • S
      x86, vmlinux.lds: move vsyscall output sections · ff6f87e1
      Sam Ravnborg 提交于
      [ Impact: cleanup ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-8-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ff6f87e1
    • S
      x86, vmlinux.lds: unify data output sections · 1f6397ba
      Sam Ravnborg 提交于
      For 64 bit the following functional changes are introduced:
      
       - .data.page_aligned has moved
       - .data.cacheline_aligned has moved
       - .data.read_mostly has moved
       - ALIGN() moved out of output section for .data.cacheline_aligned
       - ALIGN() moved out of output section for .data.page_aligned
      
      Notice that 32 bit and 64 bit has different location of _edata.
      .data_nosave is 32 bit only as 64 bit is special due to PERCPU.
      
      [ Impact: 32-bit: cleanup, 64-bit: use 32-bit linker script ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-7-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1f6397ba
    • S
      x86, vmlinux.lds: unify exception table · 448bc3ab
      Sam Ravnborg 提交于
      [ Impact: cleanup ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-6-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      448bc3ab
    • S
      x86, vmlinux.lds: unify .text output sections · dfc20895
      Sam Ravnborg 提交于
      32 bit x86 had a dedicated .text.head output section,
      whereas 64 bit had it all in a single output section.
      
      In the unified version the dedicated .text.head output section
      was kept to have full control over the head code.
      
      32 bit:
      
      - Moved definition of _stext to the linker script.
        The definition is located _after_ .text.page_aligned as this
        is what 32 bit did before.
      
      The ALIGN(8) was introduced so we hit the exact same address
      (on the tested config) before and after the move.
      
      I assume that it is a bug that _stext did not cover the
      .text.page_aligned section - if this is true it can be fixed
      in a follow-up patch (and the ugly ALIGN() can be dropped).
      
      [ Impact: 64-bit: cleanup, 32-bit: use the 64-bit linker script ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-5-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dfc20895
    • S
      x86, vmlinux.lds: unify start/end of SECTIONS · 444e0ae4
      Sam Ravnborg 提交于
      [ Impact: cleanup ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-4-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      444e0ae4
    • S
      x86, vmlinux.lds: unify PHDRS · afb8095a
      Sam Ravnborg 提交于
      PHDRS are not equal for the two - so
      use ifdefs to cover up for that.
      
      On the assumption that they may become equal the ifdef
      is inside the PHDRS definiton.
      
      [ Impact: cleanup ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-3-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      afb8095a
    • S
      x86, vmlinux.lds: unify header/footer · 17ce265d
      Sam Ravnborg 提交于
      Merge everything except PHDRS and SECTIONS into
      vmlinux.lds.S.
      
      [ Impact: cleanup ]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@MIT.EDU>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1240991249-27117-2-git-send-email-sam@ravnborg.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      17ce265d
  21. 11 10月, 2007 1 次提交