1. 22 7月, 2010 1 次提交
  2. 09 2月, 2010 1 次提交
  3. 26 11月, 2009 1 次提交
  4. 20 10月, 2009 1 次提交
    • S
      x86-64: preserve large page mapping for 1st 2MB kernel txt with CONFIG_DEBUG_RODATA · b9af7c0d
      Suresh Siddha 提交于
      In the first 2MB, kernel text is co-located with kernel static
      page tables setup by head_64.S.  CONFIG_DEBUG_RODATA chops this
      2MB large page mapping to small 4KB pages as we mark the kernel text as RO,
      leaving the static page tables as RW.
      
      With CONFIG_DEBUG_RODATA disabled, OLTP run on NHM-EP shows 1% improvement
      with 2% reduction in system time and 1% improvement in iowait idle time.
      
      To recover this, move the kernel static page tables to .data section, so that
      we don't have to break the first 2MB of kernel text to small pages with
      CONFIG_DEBUG_RODATA.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      LKML-Reference: <20091014220254.063193621@sbs-t61.sc.intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      b9af7c0d
  5. 21 9月, 2009 1 次提交
  6. 19 9月, 2009 1 次提交
    • T
      x86: convert to use __HEAD and HEAD_TEXT macros. · 4ae59b91
      Tim Abbott 提交于
      This has the consequence of changing the section name use for head
      code from ".text.head" to ".head.text".  It also eliminates the
      ".text.head" output section (instead placing head code at the start of
      the .text output section), which should be harmless.
      
      This patch only changes the sections in the actual kernel, not those
      in the compressed boot loader.
      Signed-off-by: NTim Abbott <tabbott@ksplice.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      4ae59b91
  7. 18 6月, 2009 1 次提交
  8. 25 2月, 2009 2 次提交
  9. 09 2月, 2009 1 次提交
  10. 20 1月, 2009 2 次提交
  11. 16 1月, 2009 4 次提交
    • T
      x86: make pda a percpu variable · b12d8db8
      Tejun Heo 提交于
      [ Based on original patch from Christoph Lameter and Mike Travis. ]
      
      As pda is now allocated in percpu area, it can easily be made a proper
      percpu variable.  Make it so by defining per cpu symbol from linker
      script and declaring it in C code for SMP and simply defining it for
      UP.  This change cleans up code and brings SMP and UP closer a bit.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b12d8db8
    • T
      x86: fold pda into percpu area on SMP · 1a51e3a0
      Tejun Heo 提交于
      [ Based on original patch from Christoph Lameter and Mike Travis. ]
      
      Currently pdas and percpu areas are allocated separately.  %gs points
      to local pda and percpu area can be reached using pda->data_offset.
      This patch folds pda into percpu area.
      
      Due to strange gcc requirement, pda needs to be at the beginning of
      the percpu area so that pda->stack_canary is at %gs:40.  To achieve
      this, a new percpu output section macro - PERCPU_VADDR_PREALLOC() - is
      added and used to reserve pda sized chunk at the start of the percpu
      area.
      
      After this change, for boot cpu, %gs first points to pda in the
      data.init area and later during setup_per_cpu_areas() gets updated to
      point to the actual pda.  This means that setup_per_cpu_areas() need
      to reload %gs for CPU0 while clearing pda area for other cpus as cpu0
      already has modified it when control reaches setup_per_cpu_areas().
      
      This patch also removes now unnecessary get_local_pda() and its call
      sites.
      
      A lot of this patch is taken from Mike Travis' "x86_64: Fold pda into
      per cpu area" patch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1a51e3a0
    • T
      x86: load pointer to pda into %gs while brining up a CPU · f32ff538
      Tejun Heo 提交于
      [ Based on original patch from Christoph Lameter and Mike Travis. ]
      
      CPU startup code in head_64.S loaded address of a zero page into %gs
      for temporary use till pda is loaded but address to the actual pda is
      available at the point.  Load the real address directly instead.
      
      This will help unifying percpu and pda handling later on.
      
      This patch is mostly taken from Mike Travis' "x86_64: Fold pda into
      per cpu area" patch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      f32ff538
    • T
      x86: make percpu symbols zerobased on SMP · 3e5d8f97
      Tejun Heo 提交于
      [ Based on original patch from Christoph Lameter and Mike Travis. ]
      
      This patch makes percpu symbols zerobased on x86_64 SMP by adding
      PERCPU_VADDR() to vmlinux.lds.h which helps setting explicit vaddr on
      the percpu output section and using it in vmlinux_64.lds.S.  A new
      PHDR is added as existing ones cannot contain sections near address
      zero.  PERCPU_VADDR() also adds a new symbol __per_cpu_load which
      always points to the vaddr of the loaded percpu data.init region.
      
      The following adjustments have been made to accomodate the address
      change.
      
      * code to locate percpu gdt_page in head_64.S is updated to add the
        load address to the gdt_page offset.
      
      * __per_cpu_load is used in places where access to the init data area
        is necessary.
      
      * pda->data_offset is initialized soon after C code is entered as zero
        value doesn't work anymore.
      
      This patch is mostly taken from Mike Travis' "x86_64: Base percpu
      variables at zero" patch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3e5d8f97
  12. 04 1月, 2009 1 次提交
  13. 11 10月, 2008 1 次提交
  14. 16 7月, 2008 3 次提交
  15. 08 7月, 2008 5 次提交
    • J
      x86: always set _PAGE_GLOBAL in _PAGE_KERNEL* flags · 8490638c
      Jeremy Fitzhardinge 提交于
      Consistently set _PAGE_GLOBAL in _PAGE_KERNEL flags.  This makes 32-
      and 64-bit code consistent, and removes some special cases where
      __PAGE_KERNEL* did not have _PAGE_GLOBAL set, causing confusion as a
      result of the inconsistencies.
      
      This patch only affects x86-64, which generally always supports PGD.
      The x86-32 patch is next.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8490638c
    • J
      x86: fix CPA self-test for "x86/paravirt: groundwork for 64-bit Xen support" · cd5dce2f
      Jeremy Fitzhardinge 提交于
      Ingo Molnar wrote:
      > -tip auto-testing found pagetable corruption (CPA self-test failure):
      >
      > [   32.956015] CPA self-test:
      > [   32.958822]  4k 2048 large 508 gb 0 x 2556[ffff880000000000-ffff88003fe00000] miss 0
      > [   32.964000] CPA ffff88001d54e000: bad pte 1d4000e3
      > [   32.968000] CPA ffff88001d54e000: unexpected level 2
      > [   32.972000] CPA ffff880022c5d000: bad pte 22c000e3
      > [   32.976000] CPA ffff880022c5d000: unexpected level 2
      > [   32.980000] CPA ffff8800200ce000: bad pte 200000e3
      > [   32.984000] CPA ffff8800200ce000: unexpected level 2
      > [   32.988000] CPA ffff8800210f0000: bad pte 210000e3
      >
      > config and full log can be found at:
      >
      >  http://redhat.com/~mingo/misc/config-Mon_Jun_30_11_11_51_CEST_2008.bad
      >  http://redhat.com/~mingo/misc/log-Mon_Jun_30_11_11_51_CEST_2008.bad
      
      Phew.  OK, I've worked this out.  Short version is that's it's a false
      alarm, and there was no real failure here.  Long version:
      
          * I changed the code to create the physical mapping pagetables to
            reuse any existing mapping rather than replace it.   Specifically,
            reusing an pud pointed to by the pgd caused this symptom to appear.
          * The specific PUD being reused is the one created statically in
            head_64.S, which creates an initial 1GB mapping.
          * That mapping doesn't have _PAGE_GLOBAL set on it, due to the
            inconsistency between __PAGE_* and PAGE_*.
          * The CPA test attempts to clear _PAGE_GLOBAL, and then checks to
            see that the resulting range is 1) shattered into 4k pages, and 2)
            has no _PAGE_GLOBAL.
          * However, since it didn't have _PAGE_GLOBAL on that range to start
            with, change_page_attr_clear() had nothing to do, and didn't
            bother shattering the range,
          * resulting in the reported messages
      
      The simple fix is to set _PAGE_GLOBAL in level2_ident_pgt.
      
      An additional fix to make CPA testing more robust by using some other
      pagetable bit (one of the unused available-to-software ones).  This
      would solve spurious CPA test warnings under Xen which uses _PAGE_GLOBAL
      for its own purposes (ie, not under guest control).
      
      Also, we should revisit the use of _PAGE_GLOBAL in asm-x86/pgtable.h,
      and use it consistently, and drop MAKE_GLOBAL.  The first time I
      proposed it it caused breakages in the very early CPA code; with luck
      that's all fixed now.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Cc: xen-devel <xen-devel@lists.xensource.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Yinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cd5dce2f
    • E
      paravirt/x86, 64-bit: move __PAGE_OFFSET to leave a space for hypervisor · a6523748
      Eduardo Habkost 提交于
      Set __PAGE_OFFSET to the most negative possible address +
      16*PGDIR_SIZE.  The gap is to allow a space for a hypervisor to fit.
      The gap is more or less arbitrary, but it's what Xen needs.
      
      When booting native, kernel/head_64.S has a set of compile-time
      generated pagetables used at boot time.  This patch removes their
      absolutely hard-coded layout, and makes it parameterised on
      __PAGE_OFFSET (and __START_KERNEL_map).
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: xen-devel <xen-devel@lists.xensource.com>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a6523748
    • G
      x86: move x86_64 gdt closer to i386 · a939098a
      Glauber Costa 提交于
      i386 and x86_64 used two different schemes for maintaining the gdt.
      With this patch, x86_64 initial gdt table is defined in a .c file,
      same way as i386 is now. Also, we call it "gdt_page", and the descriptor,
      "early_gdt_descr". This way we achieve common naming, which can allow for
      more code integration.
      Signed-off-by: NGlauber Costa <gcosta@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a939098a
    • G
      x86: use stack_start in x86_64 · 9cf4f298
      Glauber Costa 提交于
      call x86_64's init_rsp stack_start, just as i386 does.
      Put a zeroed stack segment for consistency. With this,
      we can eliminate one ugly ifdef in smpboot.c.
      Signed-off-by: NGlauber Costa <gcosta@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9cf4f298
  16. 05 7月, 2008 1 次提交
  17. 25 5月, 2008 3 次提交
  18. 17 4月, 2008 5 次提交
  19. 26 2月, 2008 2 次提交
    • I
      x86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE · d4afe414
      Ingo Molnar 提交于
      The KERNEL_TEXT_SIZE constant was mis-named, as we not only map the kernel
      text but data, bss and init sections as well.
      
      That name led me on the wrong path with the KERNEL_TEXT_SIZE regression,
      because i knew how big of _text_ my images have and i knew about the 40 MB
      "text" limit so i wrongly thought to be on the safe side of the 40 MB limit
      with my 29 MB of text, while the total image size was slightly above 40 MB.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d4afe414
    • I
      x86: fix spontaneous reboot with allyesconfig bzImage · 88f3aec7
      Ingo Molnar 提交于
      recently the 64-bit allyesconfig bzImage kernel started spontaneously
      rebooting during early bootup.
      
      after a few fun hours spent with early init debugging, it turns out
      that we've got this rather annoying limit on the size of the kernel
      image:
      
            #define KERNEL_TEXT_SIZE  (40*1024*1024)
      
      which limit my vmlinux just happened to pass:
      
             text           data       bss        dec       hex   filename
         29703744        4222751   8646224c   42572719   2899baf   vmlinux
      
      40 MB is 42572719 bytes, so my vmlinux was just 1.5% above this limit :-/
      
      So it happily crashed right in head_64.S, which - as we all know - is
      the most debuggable code in the whole architecture ;-)
      
      So increase the limit to allow an up to 128MB kernel image to be mapped.
      (should anyone be that crazy or lazy)
      
      We have a full 4K of pagetable (level2_kernel_pgt) allocated for these
      mappings already, so there's no RAM overhead and the limit was rather
      pointless and arbitrary.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      88f3aec7
  20. 19 2月, 2008 2 次提交
    • S
      x86: fix section mismatch in head_64.S:initial_code · da5968ae
      Sam Ravnborg 提交于
      initial_code are initially used to hold a function pointer
      from __init and later from __cpuinit. This confuses modpost
      and changing initial_code to REFDATA silence the warning.
      (But now we do not discard the variable anymore).
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      da5968ae
    • T
      x86: zap invalid and unused pmds in early boot · 31eedd82
      Thomas Gleixner 提交于
      The early boot code maps KERNEL_TEXT_SIZE (currently 40MB) starting
      from __START_KERNEL_map. The kernel itself only needs _text to _end
      mapped in the high alias. On relocatible kernels the ASM setup code
      adjusts the compile time created high mappings to the relocation. This
      creates invalid pmd entries for negative offsets:
      
      0xffffffff80000000 -> pmd entry: ffffffffff2001e3
      It points outside of the physical address space and is marked present.
      
      This starts at the virtual address __START_KERNEL_map and goes up to
      the point where the first valid physical address (0x0) is mapped.
      
      Zap the mappings before _text and after _end right away in early
      boot. This removes also the invalid entries.
      
      Furthermore it simplifies the range check for high aliases.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      31eedd82
  21. 07 2月, 2008 1 次提交