1. 14 4月, 2016 1 次提交
  2. 22 11月, 2015 2 次提交
    • H
      parisc: Add Huge Page and HUGETLBFS support · 736d2169
      Helge Deller 提交于
      This patch adds huge page support to allow userspace to allocate huge
      pages and to use hugetlbfs filesystem on 32- and 64-bit Linux kernels.
      A later patch will add kernel support to map kernel text and data on
      huge pages.
      
      The only requirement is, that the kernel needs to be compiled for a
      PA8X00 CPU (PA2.0 architecture). Older PA1.X CPUs do not support
      variable page sizes. 64bit Kernels are compiled for PA2.0 by default.
      
      Technically on parisc multiple physical huge pages may be needed to
      emulate standard 2MB huge pages.
      Signed-off-by: NHelge Deller <deller@gmx.de>
      736d2169
    • H
      parisc: Initialize the fault vector earlier in the boot process. · 4182d0cd
      Helge Deller 提交于
      A fault vector on parisc needs to be 2K aligned.  Furthermore the
      checksum of the fault vector needs to sum up to 0 which is being
      calculated and written at runtime.
      
      Up to now we aligned both PA20 and PA11 fault vectors on the same 4K
      page in order to easily write the checksum after having mapped the
      kernel read-only (by mapping this page only as read-write).
      But when we want to map the kernel text and data on huge pages this
      makes things harder.
      So, simplify it by aligning both fault vectors on 2K boundries and write
      the checksum before we map the page read-only.
      Signed-off-by: NHelge Deller <deller@gmx.de>
      4182d0cd
  3. 11 7月, 2015 1 次提交
    • J
      parisc: Fix some PTE/TLB race conditions and optimize __flush_tlb_range based on timing results · 01ab6057
      John David Anglin 提交于
      The increased use of pdtlb/pitlb instructions seemed to increase the
      frequency of random segmentation faults building packages. Further, we
      had a number of cases where TLB inserts would repeatedly fail and all
      forward progress would stop. The Haskell ghc package caused a lot of
      trouble in this area. The final indication of a race in pte handling was
      this syslog entry on sibaris (C8000):
      
       swap_free: Unused swap offset entry 00000004
       BUG: Bad page map in process mysqld  pte:00000100 pmd:019bbec5
       addr:00000000ec464000 vm_flags:00100073 anon_vma:0000000221023828 mapping: (null) index:ec464
       CPU: 1 PID: 9176 Comm: mysqld Not tainted 4.0.0-2-parisc64-smp #1 Debian 4.0.5-1
       Backtrace:
        [<0000000040173eb0>] show_stack+0x20/0x38
        [<0000000040444424>] dump_stack+0x9c/0x110
        [<00000000402a0d38>] print_bad_pte+0x1a8/0x278
        [<00000000402a28b8>] unmap_single_vma+0x3d8/0x770
        [<00000000402a4090>] zap_page_range+0xf0/0x198
        [<00000000402ba2a4>] SyS_madvise+0x404/0x8c0
      
      Note that the pte value is 0 except for the accessed bit 0x100. This bit
      shouldn't be set without the present bit.
      
      It should be noted that the madvise system call is probably a trigger for many
      of the random segmentation faults.
      
      In looking at the kernel code, I found the following problems:
      
      1) The pte_clear define didn't take TLB lock when clearing a pte.
      2) We didn't test pte present bit inside lock in exception support.
      3) The pte and tlb locks needed to merged in order to ensure consistency
      between page table and TLB. This also has the effect of serializing TLB
      broadcasts on SMP systems.
      
      The attached change implements the above and a few other tweaks to try
      to improve performance. Based on the timing code, TLB purges are very
      slow (e.g., ~ 209 cycles per page on rp3440). Thus, I think it
      beneficial to test the split_tlb variable to avoid duplicate purges.
      Probably, all PA 2.0 machines have combined TLBs.
      
      I dropped using __flush_tlb_range in flush_tlb_mm as I realized all
      applications and most threads have a stack size that is too large to
      make this useful. I added some comments to this effect.
      
      Since implementing 1 through 3, I haven't had any random segmentation
      faults on mx3210 (rp3440) in about one week of building code and running
      as a Debian buildd.
      Signed-off-by: NJohn David Anglin <dave.anglin@bell.net>
      Cc: stable@vger.kernel.org # v3.18+
      Signed-off-by: NHelge Deller <deller@gmx.de>
      01ab6057
  4. 15 4月, 2015 1 次提交
  5. 17 2月, 2015 1 次提交
  6. 25 5月, 2013 1 次提交
    • J
      parisc: make interrupt and interruption stack allocation reentrant · b63a2bbc
      John David Anglin 提交于
      The get_stack_use_cr30 and get_stack_use_r30 macros allocate a stack
      frame for external interrupts and interruptions requiring a stack frame.
      They are currently not reentrant in that they save register context
      before the stack is set or adjusted.
      
      I have observed a number of system crashes where there was clear
      evidence of stack corruption during interrupt processing, and as a
      result register corruption. Some interruptions can still occur during
      interruption processing, however external interrupts are disabled and
      data TLB misses don't occur for absolute accesses. So, it's not entirely
      clear what triggers this issue. Also, if an interruption occurs when
      Q=0, it is generally not possible to recover as the shadowed registers
      are not copied.
      
      The attached patch reworks the get_stack_use_cr30 and get_stack_use_r30
      macros to allocate stack before doing register saves. The new code is a
      couple of instructions shorter than the old implementation. Thus, it's
      an improvement even if it doesn't fully resolve the stack corruption
      issue. Based on limited testing, it improves SMP system stability.
      Signed-off-by: NJohn David Anglin <dave.anglin@bell.net>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      b63a2bbc
  7. 12 5月, 2013 1 次提交
  8. 08 5月, 2013 2 次提交
    • H
      parisc: implement irq stacks · 200c8804
      Helge Deller 提交于
      Default kernel stack size on parisc is 16k.  During tests we found that the
      kernel stack can easily grow beyond 13k, which leaves 3k left for irq
      processing.
      
      This patch adds the possibility to activate an additional stack of 16k per CPU
      which is being used during irq processing.  This implementation does not yet
      uses this irq stack for the irq bh handler.
      
      The assembler code for call_on_stack was heavily cleaned up by John
      David Anglin.
      
      CC: John David Anglin <dave.anglin@bell.net>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      200c8804
    • J
      parisc: only re-enable interrupts if we need to schedule or deliver signals... · c207a76b
      John David Anglin 提交于
      parisc: only re-enable interrupts if we need to schedule or deliver signals when returning to userspace
      
      Helge and I have found that we have a kernel stack overflow problem
      which causes a variety of random failures.
      Currently, we re-enable interrupts when returning from an external
      interrupt incase we need to schedule or delivery
      signals.  As a result, a potentially unlimited number of interrupts
      can occur while we are running on the kernel
      stack.  It is very limited in space (currently, 16k).  This change
      defers enabling interrupts until we have
      actually decided to schedule or delivery signals.  This only occurs
      when we about to return to userspace.  This
      limits the number of interrupts on the kernel stack to one.  In other
      cases, interrupts remain disabled until the
      final return from interrupt (rfi).
      Signed-off-by: NJohn David Anglin  <dave.anglin@bell.net>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      c207a76b
  9. 07 5月, 2013 2 次提交
    • J
      parisc: use long branch in fork_like macro · bbbfde78
      John David Anglin 提交于
      The "b" branch instruction used in the fork_like macro only can handle
      17-bit pc-relative offsets.
      This fails with an out of range offset with some .config files.
      Rewrite to use the "be" instruction which
      can branch to any address in a space.
      Signed-off-by: NJohn David Anglin  <dave.anglin@bell.net>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      bbbfde78
    • H
      parisc: fix partly 16/64k PAGE_SIZE boot · 6a45716a
      Helge Deller 提交于
      This patch fixes partly PAGE_SIZEs of 16K or 64K by adjusting the
      assembler PTE lookup code and the assembler TEMPALIAS code.  Furthermore
      some data alignments for PAGE_SIZE have been limited to 4K (or less) to
      not waste too much memory with greater page sizes. As a side note, the
      palo loader can (currently) only handle up to 10 ELF segments which is
      fixed with tighter aligning as well.
      
      My testings indicated that the ldci command in the sba iommu coding
      needed adjustment by the PAGE_SHIFT value and that the I/O PDIR Page
      size was only set to 4K for my machine (C3000).
      
      All this fixes partly the boot, but there are still quite some caching
      problems left.  Examples are e.g. the symbios logic driver which is
      failing:
      
      sym0: <896> rev 0x7 at pci 0000:00:0f.0 irq 69
      sym0: PA-RISC Firmware, ID 7, Fast-40, SE, parity checking
      CACHE TEST FAILED: DMA error (dstat=0x81).sym0: CACHE INCORRECTLY CONFIGURED.
      
      and the tulip network driver which doesn't seem to work correctly
      either:
      
      Sending BOOTP requests .net eth0: Setting full-duplex based on MII#1
      link partner capability of 05e1
      ..... timed out!
      
      Beside those kernel fixes glibc will need fixes too to be able to handle
      >4K page sizes.
      Signed-off-by: NHelge Deller <deller@gmx.de>
      6a45716a
  10. 21 2月, 2013 1 次提交
  11. 04 2月, 2013 1 次提交
  12. 08 1月, 2013 1 次提交
    • J
      parisc: improve ptrace support for gdb single-step · 34360f08
      John David Anglin 提交于
      Various GCC tests use gdb to simulate a multithreaded application. Many of
      these tests have been failing on parisc linux.
      
      GCC does this by using gdb to single-step the application, then gdb is used to
      call other test specific code. Where this fails is when the application is
      stepped into the delay slot of a taken branch. This sets the PSW B bit. When
      the test specific code is executed, this usually clears the PSW B bit.
      Currently, gdb is not allowed to set the B bit. So, the code falls through what
      should be a taken branch.
      
      The attached patch adds the PSW B bit to the set of bits that gdb is allowed to
      set. In order to set the B bit, the trace system call must return using an
      interrupt restore. The patch also modifies this code to use the saved IAOQ
      values when they are saved by a ptrace syscall or interruption.
      Signed-off-by: NJohn David Anglin <dave.anglin@bell.net>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      34360f08
  13. 29 11月, 2012 1 次提交
  14. 22 10月, 2012 1 次提交
  15. 15 10月, 2012 4 次提交
  16. 02 6月, 2012 1 次提交
  17. 25 5月, 2012 1 次提交
    • J
      [PARISC] fix TLB fault path on PA2.0 narrow systems · 2f649c1f
      James Bottomley 提交于
      commit 5e185581
      Author: James Bottomley <JBottomley@Parallels.com>
      
          [PARISC] fix PA1.1 oops on boot
      
      Didn't quite fix the crash on boot.  It moved it from PA1.1 processors to
      PA2.0 narrow kernels.  The final fix is to make sure the [id]tlb_miss_20 paths
      also work.  Even on narrow systems, these paths require using the wide
      instructions becuase the tlb insertion format is wide.  Fix this by
      conditioning the dep[wd],z on whether we're being called from _11 or _20[w]
      paths.
      Tested-by: NHelge Deller <deller@gmx.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      2f649c1f
  18. 24 5月, 2012 1 次提交
  19. 16 5月, 2012 1 次提交
    • J
      [PARISC] fix PA1.1 oops on boot · 5e185581
      James Bottomley 提交于
      All PA1.1 systems have been oopsing on boot since
      
      commit f311847c
      Author: James Bottomley <James.Bottomley@HansenPartnership.com>
      Date:   Wed Dec 22 10:22:11 2010 -0600
      
          parisc: flush pages through tmpalias space
      
      because a PA2.0 instruction was accidentally introduced into the PA1.1 TLB
      insertion interruption path when it was consolidated with the do_alias macro.
      Fix the do_alias macro only to use PA2.0 instructions if compiled for 64 bit.
      Cc: stable@vger.kernel.org  #2.6.39+
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      5e185581
  20. 16 4月, 2011 1 次提交
    • J
      [PARISC] only make executable areas executable · d7dd2ff1
      James Bottomley 提交于
      Currently parisc has the whole kernel marked as RWX, meaning any
      kernel page at all is eligible to be executed.  This can cause a
      theoretical problem on systems with combined I/D TLB because the act
      of referencing a page causes a TLB insertion with an executable bit.
      This TLB entry may be used by the CPU as the basis for speculating the
      page into the I-Cache.  If this speculated page is subsequently used
      for a user process, there is the possibility we will get a stale
      I-cache line picked up as the binary executes.
      
      As a point of good practise, only mark actual kernel text pages as
      executable.  The same has to be done for init_text pages, but they're
      converted to data pages (and the I-Cache flushed) when the init memory
      is released.
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      d7dd2ff1
  21. 31 3月, 2011 1 次提交
  22. 15 1月, 2011 2 次提交
    • J
      eliminate special FLUSH flag from page table · 8b4ae334
      James Bottomley 提交于
      This was used to flush a region even if the page table entry had been
      cleared.  In theory this was never necessary, but now we've switched to
      alias based flushing, the whole set of code associated with it can be dumped.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      8b4ae334
    • J
      parisc: flush pages through tmpalias space · f311847c
      James Bottomley 提交于
      The kernel has an 8M tmpailas space (originally designed for copying
      and clearing pages but now only used for clearing).  The idea is
      to place zeros into the cache above a physical page rather than into
      the physical page and flush the cache, because often the zeros end up
      being replaced quickly anyway.
      
      We can also use the tmpalias space for flushing a page.  The difference
      here is that we have to do tmpalias processing in the non access data and
      instruction traps.  The principle is the same: as long as we know the physical
      address and have a virtual address congruent to the real one, the flush will
      be effective.
      
      In order to use the tmpalias space, the icache miss path has to be enhanced to
      check for the alias region to make the fic instruction effective.
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      f311847c
  23. 30 5月, 2010 3 次提交
  24. 28 9月, 2009 1 次提交
  25. 02 9月, 2009 1 次提交
  26. 02 8月, 2009 1 次提交
  27. 31 3月, 2009 3 次提交
  28. 13 3月, 2009 1 次提交
  29. 13 6月, 2008 1 次提交