1. 17 Jan, 2018 1 commit
  2. 09 Jan, 2018 1 commit
  3. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      
      
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  4. 02 Sep, 2017 1 commit
    • Cédric Le Goater's avatar
      powerpc/xive: guest exploitation of the XIVE interrupt controller · eac1e731
      Cédric Le Goater authored
      
      
      This is the framework for using XIVE in a PowerVM guest. The support
      is very similar to the native one in a much simpler form.
      
      Each source is associated with an Event State Buffer (ESB). This is a
      two bit state machine which is used to trigger events. The bits are
      named "P" (pending) and "Q" (queued) and can be controlled by MMIO.
      The Guest OS registers event (or notifications) queues on which the HW
      will post event data for a target to notify.
      
      Instead of OPAL calls, a set of Hypervisors call are used to configure
      the interrupt sources and the event/notification queues of the guest:
      
       - H_INT_GET_SOURCE_INFO
      
         used to obtain the address of the MMIO page of the Event State
         Buffer (PQ bits) entry associated with the source.
      
       - H_INT_SET_SOURCE_CONFIG
      
         assigns a source to a "target".
      
       - H_INT_GET_SOURCE_CONFIG
      
         determines to which "target" and "priority" is assigned to a source
      
       - H_INT_GET_QUEUE_INFO
      
         returns the address of the notification management page associated
         with the specified "target" and "priority".
      
       - H_INT_SET_QUEUE_CONFIG
      
         sets or resets the event queue for a given "target" and "priority".
         It is also used to set the notification config associated with the
         queue, only unconditional notification for the moment.  Reset is
         performed with a queue size of 0 and queueing is disabled in that
         case.
      
       - H_INT_GET_QUEUE_CONFIG
      
         returns the queue settings for a given "target" and "priority".
      
       - H_INT_RESET
      
         resets all of the partition's interrupt exploitation structures to
         their initial state, losing all configuration set via the hcalls
         H_INT_SET_SOURCE_CONFIG and H_INT_SET_QUEUE_CONFIG.
      
       - H_INT_SYNC
      
         issue a synchronisation on a source to make sure sure all
         notifications have reached their queue.
      
      As for XICS, the XIVE interface for the guest is described in the
      device tree under the "interrupt-controller" node. A couple of new
      properties are specific to XIVE :
      
       - "reg"
      
         contains the base address and size of the thread interrupt
         managnement areas (TIMA), also called rings, for the User level and
         for the Guest OS level. Only the Guest OS level is taken into
         account today.
      
       - "ibm,xive-eq-sizes"
      
         the size of the event queues. One cell per size supported, contains
         log2 of size, in ascending order.
      
       - "ibm,xive-lisn-ranges"
      
         the interrupt numbers ranges assigned to the guest. These are
         allocated using a simple bitmap.
      
      and also :
      
       - "/ibm,plat-res-int-priorities"
      
         contains a list of priorities that the hypervisor has reserved for
         its own use.
      
      Tested with a QEMU XIVE model for pseries and with the Power hypervisor.
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      eac1e731
  5. 13 Jun, 2017 1 commit
    • Thomas Falcon's avatar
      ibmvnic: Client-initiated failover · 40c9db8a
      Thomas Falcon authored
      
      
      The IBM vNIC protocol provides support for the user to initiate
      a failover from the client LPAR in case the current backing infrastructure
      is deemed inadequate or in an error state.
      
      Support for two H_VIOCTL sub-commands for vNIC devices are required
      to implement this function. These commands are H_GET_SESSION_TOKEN
      and H_SESSION_ERR_DETECTED.
      
      "[H_GET_SESSION_TOKEN] is used to obtain a session token from a VNIC client
      adapter.  This token is opaque to the caller and is intended to be used in
      tandem with the SESSION_ERROR_DETECTED vioctl subfunction."
      
      "[H_SESSION_ERR_DETECTED] is used to report that the currently active
      backing device for a VNIC client adapter is behaving poorly, and that
      the hypervisor should attempt to fail over to a different backing device,
      if one is available."
      
      To provide tools access to this functionality the vNIC driver creates a
      sysfs file that, when written to, will send a request to pHyp to failover
      to a different backing device.
      Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Reviewed-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40c9db8a
  6. 20 Mar, 2017 1 commit
  7. 09 Feb, 2017 1 commit
  8. 31 Jan, 2017 1 commit
    • Paul Mackerras's avatar
      powerpc/64: Enable use of radix MMU under hypervisor on POWER9 · cc3d2940
      Paul Mackerras authored
      
      
      To use radix as a guest, we first need to tell the hypervisor via
      the ibm,client-architecture call first that we support POWER9 and
      architecture v3.00, and that we can do either radix or hash and
      that we would like to choose later using an hcall (the
      H_REGISTER_PROC_TBL hcall).
      
      Then we need to check whether the hypervisor agreed to us using
      radix.  We need to do this very early on in the kernel boot process
      before any of the MMU initialization is done.  If the hypervisor
      doesn't agree, we can't use radix and therefore clear the radix
      MMU feature bit.
      
      Later, when we have set up our process table, which points to the
      radix tree for each process, we need to install that using the
      H_REGISTER_PROC_TBL hcall.
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      cc3d2940
  9. 30 Nov, 2016 1 commit
    • Nicholas Piggin's avatar
      powerpc/pseries: add definitions for new H_SIGNAL_SYS_RESET hcall · 53ce2996
      Nicholas Piggin authored
      
      
      This has not made its way to a PAPR release yet, but we have an hcall
      number assigned.
      
        H_SIGNAL_SYS_RESET = 0x380
      
        Syntax:
          hcall(uint64 H_SIGNAL_SYS_RESET, int64 target);
      
        Generate a system reset NMI on the threads indicated by target.
      
        Values for target:
          -1 = target all online threads including the caller
          -2 = target all online threads except for the caller
          All other negative values: reserved
          Positive values: The thread to be targeted, obtained from the value
          of the "ibm,ppc-interrupt-server#s" property of the CPU in the OF
          device tree.
      
        Semantics:
        - Invalid target: return H_Parameter.
        - Otherwise: Generate a system reset NMI on target thread(s),
          return H_Success.
      
      This will be used by crash/debug code to get stuck CPUs into a known
      state.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      53ce2996
  10. 17 Nov, 2016 1 commit
    • Michael Ellerman's avatar
      powerpc/pseries: Move CMO code from plapr_wrappers.h to platforms/pseries · 8f272a5d
      Michael Ellerman authored
      
      
      Currently there's some CMO (Cooperative Memory Overcommit) code, in
      plpar_wrappers.h. Some of it is #ifdef CONFIG_PSERIES and some of it
      isn't. The end result being if a file includes plpar_wrappers.h it won't
      build with CONFIG_PSERIES=n.
      
      Fix it by moving the CMO code into platforms/pseries. The two hcall
      wrappers can just be moved into their only caller, cmm.c, and the
      accessors can go in pseries.h.
      
      Note we need the accessors because cmm.c can be built as a module, so
      there needs to be a split between the built-in code vs the module, and
      that's achieved by using those accessors.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      8f272a5d
  11. 14 Nov, 2016 1 commit
  12. 21 Jul, 2016 1 commit
  13. 09 Mar, 2016 1 commit
  14. 28 Dec, 2015 1 commit
  15. 28 Jul, 2014 1 commit
    • Michael Neuling's avatar
      KVM: PPC: Book3S HV: Add H_SET_MODE hcall handling · 9642382e
      Michael Neuling authored
      
      
      This adds support for the H_SET_MODE hcall.  This hcall is a
      multiplexer that has several functions, some of which are called
      rarely, and some which are potentially called very frequently.
      Here we add support for the functions that set the debug registers
      CIABR (Completed Instruction Address Breakpoint Register) and
      DAWR/DAWRX (Data Address Watchpoint Register and eXtension),
      since they could be updated by the guest as often as every context
      switch.
      
      This also adds a kvmppc_power8_compatible() function to test to see
      if a guest is compatible with POWER8 or not.  The CIABR and DAWR/X
      only exist on POWER8.
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      9642382e
  16. 23 Mar, 2014 1 commit
  17. 20 Nov, 2013 1 commit
  18. 31 May, 2013 1 commit
  19. 26 Apr, 2013 1 commit
  20. 10 Jan, 2013 1 commit
    • Ian Munsie's avatar
      powerpc: Disable relocation on exceptions whenever PR KVM is active · a413f474
      Ian Munsie authored
      
      
      For PR KVM we allow userspace to map 0xc000000000000000. Because
      transitioning from userspace to the guest kernel may use the relocated
      exception vectors we have to disable relocation on exceptions whenever
      PR KVM is active as we cannot trust that address.
      
      This issue does not apply to HV KVM, since changing from a guest to the
      hypervisor will never use the relocated exception vectors.
      
      Currently the hypervisor interface only allows us to toggle relocation
      on exceptions on a partition wide scope, so we need to globally disable
      relocation on exceptions when the first PR KVM instance is started and
      only re-enable them when all PR KVM instances have been destroyed.
      
      It's a bit heavy handed, but until the hypervisor gives us a lightweight
      way to toggle relocation on exceptions on a single thread it's only real
      option.
      Signed-off-by: default avatarIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a413f474
  21. 15 Nov, 2012 2 commits
  22. 09 Sep, 2012 1 commit
  23. 14 May, 2012 1 commit
  24. 08 Apr, 2012 1 commit
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Make virtual processor area registration more robust · 2e25aa5f
      Paul Mackerras authored
      
      
      The PAPR API allows three sorts of per-virtual-processor areas to be
      registered (VPA, SLB shadow buffer, and dispatch trace log), and
      furthermore, these can be registered and unregistered for another
      virtual CPU.  Currently we just update the vcpu fields pointing to
      these areas at the time of registration or unregistration.  If this
      is done on another vcpu, there is the possibility that the target vcpu
      is using those fields at the time and could end up using a bogus
      pointer and corrupting memory.
      
      This fixes the race by making the target cpu itself do the update, so
      we can be sure that the update happens at a time when the fields
      aren't being used.  Each area now has a struct kvmppc_vpa which is
      used to manage these updates.  There is also a spinlock which protects
      access to all of the kvmppc_vpa structs, other than to the pinned_addr
      fields.  (We could have just taken the spinlock when using the vpa,
      slb_shadow or dtl fields, but that would mean taking the spinlock on
      every guest entry and exit.)
      
      This also changes 'struct dtl' (which was undefined) to 'struct dtl_entry',
      which is what the rest of the kernel uses.
      
      Thanks to Michael Ellerman <michael@ellerman.id.au> for pointing out
      the need to initialize vcpu->arch.vpa_update_lock.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      2e25aa5f
  25. 12 Jul, 2011 1 commit
    • Paul Mackerras's avatar
      KVM: PPC: Handle some PAPR hcalls in the kernel · a8606e20
      Paul Mackerras authored
      
      
      This adds the infrastructure for handling PAPR hcalls in the kernel,
      either early in the guest exit path while we are still in real mode,
      or later once the MMU has been turned back on and we are in the full
      kernel context.  The advantage of handling hcalls in real mode if
      possible is that we avoid two partition switches -- and this will
      become more important when we support SMT4 guests, since a partition
      switch means we have to pull all of the threads in the core out of
      the guest.  The disadvantage is that we can only access the kernel
      linear mapping, not anything vmalloced or ioremapped, since the MMU
      is off.
      
      This also adds code to handle the following hcalls in real mode:
      
      H_ENTER       Add an HPTE to the hashed page table
      H_REMOVE      Remove an HPTE from the hashed page table
      H_READ        Read HPTEs from the hashed page table
      H_PROTECT     Change the protection bits in an HPTE
      H_BULK_REMOVE Remove up to 4 HPTEs from the hashed page table
      H_SET_DABR    Set the data address breakpoint register
      
      Plus code to handle the following hcalls in the kernel:
      
      H_CEDE        Idle the vcpu until an interrupt or H_PROD hcall arrives
      H_PROD        Wake up a ceded vcpu
      H_REGISTER_VPA Register a virtual processor area (VPA)
      
      The code that runs in real mode has to be in the base kernel, not in
      the module, if KVM is compiled as a module.  The real-mode code can
      only access the kernel linear mapping, not vmalloc or ioremap space.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      a8606e20
  26. 26 May, 2011 1 commit
  27. 04 May, 2011 1 commit
  28. 31 Mar, 2011 1 commit
  29. 29 Nov, 2010 2 commits
    • Jesse Larrew's avatar
      powerpc: Add VPHN firmware feature · 36f567b4
      Jesse Larrew authored
      
      
      This simple patch adds the firmware feature for VPHN to the firmware
      features bitmask.
      Signed-off-by: default avatarJesse Larrew <jlarrew@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      36f567b4
    • Vaidyanathan Srinivasan's avatar
      powerpc: Add support for new hcall H_BEST_ENERGY · 5742bd85
      Vaidyanathan Srinivasan authored
      
      
      Create sysfs interface to export data from H_BEST_ENERGY hcall
      that can be used by administrative tools on supported pseries
      platforms for energy management	optimizations.
      
      sys/device/system/cpu/pseries_(de)activate_hint_list and
      sys/device/system/cpu/cpuN/pseries_(de)activate_hint will provide
      hints for activation and deactivation of cpus respectively.
      
      These hints are abstract number given by the hypervisor based
      on the extended knowledge the hypervisor has regarding the
      system topology and resource mappings.
      
      The activate and the deactivate sysfs entry is for the two
      distinct operations that we could do for energy savings.  When
      we have more capacity than required, we could deactivate few
      core to save energy.  The choice of the core to deactivate
      will be based on /sys/devices/system/cpu/deactivate_hint_list.
      The comma separated list of cpus (cores) will be the preferred
      choice.  If we have to activate some of the deactivated cores,
      then /sys/devices/system/cpu/activate_hint_list will be used.
      
      The per-cpu file
      /sys/device/system/cpu/cpuN/pseries_(de)activate_hint further
      provide more fine grain information by exporting the value of
      the hint itself.
      
      Added new driver module
      	arch/powerpc/platforms/pseries/pseries_energy.c
      under new config option CONFIG_PSERIES_ENERGY
      Signed-off-by: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5742bd85
  30. 09 Jul, 2010 1 commit
  31. 21 May, 2010 1 commit
  32. 07 Apr, 2010 1 commit
  33. 24 Nov, 2009 1 commit
  34. 28 Oct, 2009 1 commit
    • Anton Blanchard's avatar
      powerpc: tracing: Add hypervisor call tracepoints · c8cd093a
      Anton Blanchard authored
      
      
      Add hcall_entry and hcall_exit tracepoints.  This replaces the inline
      assembly HCALL_STATS code and converts it to use the new tracepoints.
      
      To keep the disabled case as quick as possible, we embed a status word
      in the TOC so we can get at it with a single load.  By doing so we
      keep the overhead at a minimum.  Time taken for a null hcall:
      
      No tracepoint code:	135.79 cycles
      Disabled tracepoints:	137.95 cycles
      
      For reference, before this patch enabling HCALL_STATS resulted in a null
      hcall of 201.44 cycles!
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      c8cd093a
  35. 18 Aug, 2008 1 commit
  36. 04 Aug, 2008 1 commit
  37. 25 Jul, 2008 2 commits