1. 11 11月, 2011 3 次提交
  2. 01 11月, 2011 5 次提交
  3. 24 10月, 2011 1 次提交
  4. 23 10月, 2011 2 次提交
  5. 21 10月, 2011 1 次提交
  6. 17 10月, 2011 15 次提交
  7. 15 10月, 2011 1 次提交
  8. 08 10月, 2011 1 次提交
  9. 02 10月, 2011 3 次提交
  10. 26 9月, 2011 2 次提交
  11. 21 9月, 2011 6 次提交
    • R
      ARM: fix vmlinux.lds.S discarding sections · 6760b109
      Russell King 提交于
      We are seeing linker errors caused by sections being discarded, despite
      the linker script trying to keep them.  The result is (eg):
      
      `.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
      `.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
      
      This is the relevent part of the linker script (reformatted to make it
      clearer):
      | SECTIONS
      | {
      | /*
      | * unwind exit sections must be discarded before the rest of the
      | * unwind sections get included.
      | */
      | /DISCARD/ : {
      | *(.ARM.exidx.exit.text)
      | *(.ARM.extab.exit.text)
      | }
      | ...
      | .exit.text : {
      | *(.exit.text)
      | *(.memexit.text)
      | }
      | ...
      | /DISCARD/ : {
      | *(.exit.text)
      | *(.memexit.text)
      | *(.exit.data)
      | *(.memexit.data)
      | *(.memexit.rodata)
      | *(.exitcall.exit)
      | *(.discard)
      | *(.discard.*)
      | }
      | }
      
      Now, this is what the linker manual says about discarded output sections:
      
      |    The special output section name `/DISCARD/' may be used to discard
      | input sections.  Any input sections which are assigned to an output
      | section named `/DISCARD/' are not included in the output file.
      
      No questions, no exceptions. It doesn't say "unless they are listed
      before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
      says:
      | /*
      |  * Default discarded sections.
      |  *
      |  * Some archs want to discard exit text/data at runtime rather than
      |  * link time due to cross-section references such as alt instructions,
      |  * bug table, eh_frame, etc. DISCARDS must be the last of output
      |  * section definitions so that such archs put those in earlier section
      |  * definitions.
      |  */
      
      And guess what - the list _always_ includes .exit.text etc.
      
      Now, what's actually happening is that the linker is reading the script,
      and it finds the first /DISCARD/ output section at the beginning of the
      script. It continues reading the script, and finds the 'DISCARD' macro
      at the end, which having been postprocessed results in another
      /DISCARD/ output section. As the linker already contains the earlier
      /DISCARD/ output section, it adds it to that existing section, so it
      effectively is placed at the start. This can be seen by using the -M
      option to ld:
      
      | Linker script and memory map
      |
      |                 0xc037c080                jiffies = jiffies_64
      |
      | /DISCARD/
      |  *(.ARM.exidx.exit.text)
      |  *(.ARM.extab.exit.text)
      |  *(.exit.text)
      |  *(.memexit.text)
      |  *(.exit.data)
      |  *(.memexit.data)
      |  *(.memexit.rodata)
      |  *(.exitcall.exit)
      |  *(.discard)
      |  *(.discard.*)
      |
      |                 0xc0008000                . = 0xc0008000
      |
      | .head.text      0xc0008000      0x1d0
      |                 0xc0008000                _text = .
      |  *(.head.text)
      |  .head.text     0xc0008000      0x1d0 arch/arm/kernel/head.o
      |                 0xc0008000                stext
      |
      | .text           0xc0008200   0x2d78d0
      |                 0xc0008200                _stext = .
      |                 0xc0008200                __exception_text_start = .
      |  *(.exception.text)
      |  .exception.text
      | ...
      
      As you can see, all the discarded sections are grouped together - and
      as a result of it being the first output section, they all appear before
      any other section.
      
      The result is that not only is the unwind information discarded (as
      intended), but also the .exit.text, despite us wanting to have the
      .exit.text preserved.
      
      We can't move the unwind information elsewhere, because it'll then be
      included even when we do actually discard the .exit.text (and similar)
      sections.
      
      So, work around this by avoiding the generic DISCARDS macro, and instead
      conditionalize the sections to be discarded ourselves.  This avoids the
      ambiguity in how the linker assigns input sections to output sections,
      making our script less dependent on undocumented linker behaviour.
      Reported-by: NRob Herring <robherring2@gmail.com>
      Tested-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6760b109
    • R
      ARM: pm: add L2 cache cleaning for suspend · 8e6f83bb
      Russell King 提交于
      We need to ensure that state is pushed out from the L2 cache when
      suspending so that the resume paths can access their data before the
      MMU and caches have been re-initialized.  Add the necessary calls to
      __cpu_suspend_save().
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Tested-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      8e6f83bb
    • R
      ARM: pm: convert some assembly to C · abda1bd5
      Russell King 提交于
      Convert some of the sleep.S guts to C code, which makes it easier to
      use our macros and to add L2 cache handling.  We provide a helper
      function, __cpu_suspend_save(), which deals with saving the common
      state, setting up for resume, and flushing caches.
      
      The remainder left as assembly code is the saving of the CPU general
      purpose registers, and allocating space on the stack to save the CPU
      specific registers and resume state.
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Tested-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      abda1bd5
    • R
      ARM: pm: get rid of cpu_resume_turn_mmu_on · 62b2d07c
      Russell King 提交于
      We don't require cpu_resume_turn_mmu_on as we can combine the ldr
      instruction with the following code provided we ensure that
      cpu_resume_mmu is aligned for older CPUs.  Note that we also align
      to a 32-byte boundary to ensure that the code can't cross a section
      boundary.
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Tested-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      62b2d07c
    • R
      ARM: pm: only use preallocated page table during resume · de8e71ca
      Russell King 提交于
      Only use the preallocated page table during the resume, not while
      suspending.  This avoids the overhead of having to switch unnecessarily
      to the resume page table in the suspend path.
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Tested-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      de8e71ca
    • R
      ARM: pm: preallocate a page table for suspend/resume · e8ce0eb5
      Russell King 提交于
      Preallocate a page table and setup an identity mapping for the MMU
      enable code.  This means we don't have to "borrow" a page table to
      do this, avoiding complexities with L2 cache coherency.
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Tested-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      e8ce0eb5