1. 21 7月, 2016 5 次提交
  2. 19 7月, 2016 1 次提交
  3. 17 7月, 2016 7 次提交
  4. 15 7月, 2016 8 次提交
  5. 14 7月, 2016 2 次提交
  6. 13 7月, 2016 2 次提交
  7. 11 7月, 2016 3 次提交
  8. 08 7月, 2016 3 次提交
  9. 07 7月, 2016 2 次提交
    • G
      powerpc/pci: Assign fixed PHB number based on device-tree properties · 63a72284
      Guilherme G. Piccoli 提交于
      The domain/PHB field of PCI addresses has its value obtained from a
      global variable, incremented each time a new domain (represented by
      struct pci_controller) is added on the system. The domain addition
      process happens during boot or due to PHB hotplug add.
      
      As recent kernels are using predictable naming for network interfaces,
      the network stack is more tied to PCI naming. This can be a problem in
      hotplug scenarios, because PCI addresses will change if devices are
      removed and then re-added. This situation seems unusual, but it can
      happen if a user wants to replace a NIC without rebooting the machine,
      for example.
      
      This patch changes the way PCI domain values are generated: now, we use
      device-tree properties to assign fixed PHB numbers to PCI addresses
      when available (meaning pSeries and PowerNV cases). We also use a bitmap
      to allow dynamic PHB numbering when device-tree properties are not
      used. This bitmap keeps track of used PHB numbers and if a PHB is
      released (by hotplug operations for example), it allows the reuse of
      this PHB number, avoiding PCI address to change in case of device remove
      and re-add soon after. No functional changes were introduced.
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
      Reviewed-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NIan Munsie <imunsie@au1.ibm.com>
      Acked-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      [mpe: Drop unnecessary machine_is(pseries) test]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      63a72284
    • M
      powerpc/pci: Fix build with PCI_IOV=y and EEH=n · d468fcaf
      Michael Ellerman 提交于
      Despite attempting to fix this in commit fb36e907 ("powerpc/pci: Fix
      SRIOV not building without EEH enabled"), the build is still broken when
      PCI_IOV=y and EEH=n (eg. g5_defconfig with PCI_IOV=y):
      
        arch/powerpc/kernel/pci_dn.c: In function ‘remove_dev_pci_data’:
        arch/powerpc/kernel/pci_dn.c:230:18: error: unused variable ‘edev’
      
      Incorporate Ben's idea of using __maybe_unused to avoid so many #ifdefs.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      d468fcaf
  10. 05 7月, 2016 5 次提交
    • O
      powerpc/timer: Large Decrementer support · 79901024
      Oliver O'Halloran 提交于
      Power ISAv3 adds a large decrementer (LD) mode which increases the size
      of the decrementer register. The size of the enlarged decrementer
      register is between 32 and 64 bits with the exact size being dependent
      on the implementation. When in LD mode, reads are sign extended to 64
      bits and a decrementer exception is raised when the high bit is set (i.e
      the value goes below zero). Writes however are truncated to the physical
      register width so some care needs to be taken to ensure that the high
      bit is not set when reloading the decrementer. This patch adds support
      for using the LD inside the host kernel on processors that support it.
      
      When LD mode is supported firmware will supply the ibm,dec-bits property
      for CPU nodes to allow the kernel to determine the maximum decrementer
      value. Enabling LD mode is a hypervisor privileged operation so the kernel
      can only enable it manually when running in hypervisor mode. Guests that
      support LD mode can request it using the "ibm,client-architecture-support"
      firmware call (not implemented in this patch) or some other platform
      specific method. If this property is not supplied then the traditional
      decrementer width of 32 bit is assumed and LD mode will not be enabled.
      
      This patch was based on initial work by Jack Miller.
      Signed-off-by: NOliver O'Halloran <oohall@gmail.com>
      Signed-off-by: NBalbir Singh <bsingharora@gmail.com>
      Acked-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      79901024
    • A
      powerpc/rtas: Fix array overrun in ppc_rtas() syscall · a9862c74
      Andrew Donnellan 提交于
      If ppc_rtas() is called with args.nargs == 16 and args.nret == 0,
      args.rets is set to point to &args.args[16], which is beyond the end of
      the args.args array. This results in a minor read overrun of the array
      when we check the first return code (which, per PAPR, is a required
      output of all RTAS calls) to see if there's been a hardware error.
      
      Change the nargs/nret check to ensure nargs is <= 15, allowing room for
      the status code. Users shouldn't be calling with nret == 0, but there's
      no real harm if they do, so we don't stop them.
      Signed-off-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a9862c74
    • C
      powerpc: Send SIGBUS on unaligned copy and paste · ae26b36f
      Chris Smart 提交于
      Calling ISA 3.0 instructions copy, copy_first, paste and paste_last
      generates an alignment fault when copying or pasting unaligned
      data (128 byte). We catch this and send SIGBUS to the userspace
      process that caused it.
      
      We do not emulate these because paste may contain additional metadata
      when pasting to a co-processor and paste_last is the synchronisation
      point for preceding copy/paste sequences.
      
      Thanks to Michael Neuling <mikey@neuling.org> for his help.
      Signed-off-by: NChris Smart <chris@distroguy.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ae26b36f
    • M
      powerpc/perf: factor out power8 __init_pmu code · 393eb79a
      Madhavan Srinivasan 提交于
      Factor out the power8 pmu init functions to share with
      power9. Monitor Mode Control Register S(MMCRS) and
      Monitor Mode Control Register H(MMCRH) registers are
      dropped in Power9. These registers are added to new
      function which are included for power8 init.
      Signed-off-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      393eb79a
    • M
      powerpc/fadump: Fix build error introduced by recent cleanup · b5b1cfc5
      Michael Ellerman 提交于
      We spent so much time bike-shedding the printk() we missed that the next
      line was missing a semi-colon. And it seems none of our defconfigs turn
      on CONFIG_FA_DUMP.
      
      Fixes: 4a03749f ("powerpc/fadump: Trivial fix of spelling mistake, clean up message")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b5b1cfc5
  11. 30 6月, 2016 1 次提交
  12. 29 6月, 2016 1 次提交
    • M
      powerpc/tm: Avoid SLB faults in treclaim/trecheckpoint when RI=0 · 190ce869
      Michael Neuling 提交于
      Currently we have 2 segments that are bolted for the kernel linear
      mapping (ie 0xc000... addresses). This is 0 to 1TB and also the kernel
      stacks. Anything accessed outside of these regions may need to be
      faulted in. (In practice machines with TM always have 1T segments)
      
      If a machine has < 2TB of memory we never fault on the kernel linear
      mapping as these two segments cover all physical memory. If a machine
      has > 2TB of memory, there may be structures outside of these two
      segments that need to be faulted in. This faulting can occur when
      running as a guest as the hypervisor may remove any SLB that's not
      bolted.
      
      When we treclaim and trecheckpoint we have a window where we need to
      run with the userspace GPRs. This means that we no longer have a valid
      stack pointer in r1. For this window we therefore clear MSR RI to
      indicate that any exceptions taken at this point won't be able to be
      handled. This means that we can't take segment misses in this RI=0
      window.
      
      In this RI=0 region, we currently access the thread_struct for the
      process being context switched to or from. This thread_struct access
      may cause a segment fault since it's not guaranteed to be covered by
      the two bolted segment entries described above.
      
      We've seen this with a crash when running as a guest with > 2TB of
      memory on PowerVM:
      
        Unrecoverable exception 4100 at c00000000004f138
        Oops: Unrecoverable exception, sig: 6 [#1]
        SMP NR_CPUS=2048 NUMA pSeries
        CPU: 1280 PID: 7755 Comm: kworker/1280:1 Tainted: G                 X 4.4.13-46-default #1
        task: c000189001df4210 ti: c000189001d5c000 task.ti: c000189001d5c000
        NIP: c00000000004f138 LR: 0000000010003a24 CTR: 0000000010001b20
        REGS: c000189001d5f730 TRAP: 4100   Tainted: G                 X  (4.4.13-46-default)
        MSR: 8000000100001031 <SF,ME,IR,DR,LE>  CR: 24000048  XER: 00000000
        CFAR: c00000000004ed18 SOFTE: 0
        GPR00: ffffffffc58d7b60 c000189001d5f9b0 00000000100d7d00 000000003a738288
        GPR04: 0000000000002781 0000000000000006 0000000000000000 c0000d1f4d889620
        GPR08: 000000000000c350 00000000000008ab 00000000000008ab 00000000100d7af0
        GPR12: 00000000100d7ae8 00003ffe787e67a0 0000000000000000 0000000000000211
        GPR16: 0000000010001b20 0000000000000000 0000000000800000 00003ffe787df110
        GPR20: 0000000000000001 00000000100d1e10 0000000000000000 00003ffe787df050
        GPR24: 0000000000000003 0000000000010000 0000000000000000 00003fffe79e2e30
        GPR28: 00003fffe79e2e68 00000000003d0f00 00003ffe787e67a0 00003ffe787de680
        NIP [c00000000004f138] restore_gprs+0xd0/0x16c
        LR [0000000010003a24] 0x10003a24
        Call Trace:
        [c000189001d5f9b0] [c000189001d5f9f0] 0xc000189001d5f9f0 (unreliable)
        [c000189001d5fb90] [c00000000001583c] tm_recheckpoint+0x6c/0xa0
        [c000189001d5fbd0] [c000000000015c40] __switch_to+0x2c0/0x350
        [c000189001d5fc30] [c0000000007e647c] __schedule+0x32c/0x9c0
        [c000189001d5fcb0] [c0000000007e6b58] schedule+0x48/0xc0
        [c000189001d5fce0] [c0000000000deabc] worker_thread+0x22c/0x5b0
        [c000189001d5fd80] [c0000000000e7000] kthread+0x110/0x130
        [c000189001d5fe30] [c000000000009538] ret_from_kernel_thread+0x5c/0xa4
        Instruction dump:
        7cb103a6 7cc0e3a6 7ca222a6 78a58402 38c00800 7cc62838 08860000 7cc000a6
        38a00006 78c60022 7cc62838 0b060000 <e8c701a0> 7ccff120 e8270078 e8a70098
        ---[ end trace 602126d0a1dedd54 ]---
      
      This fixes this by copying the required data from the thread_struct to
      the stack before we clear MSR RI. Then once we clear RI, we only access
      the stack, guaranteeing there's no segment miss.
      
      We also tighten the region over which we set RI=0 on the treclaim()
      path. This may have a slight performance impact since we're adding an
      mtmsr instruction.
      
      Fixes: 090b9284 ("powerpc/tm: Clear MSR RI in non-recoverable TM code")
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Reviewed-by: NCyril Bur <cyrilbur@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      190ce869