1. 13 Nov, 2019 6 commits
    • Tyrel Datwyler's avatar
      PCI: rpaphp: Don't rely on firmware feature to imply drc-info support · 52e2b0f1
      Tyrel Datwyler authored
      In the event that the partition is migrated to a platform with older
      firmware that doesn't support the ibm,drc-info property the device
      tree is modified to remove the ibm,drc-info property and replace it
      with the older style ibm,drc-* properties for types, names, indexes,
      and power-domains. One of the requirements of the drc-info firmware
      feature is that the client is able to handle both the new property,
      and old style properties at runtime. Therefore we can't rely on the
      firmware feature alone to dictate which property is currently
      present in the device tree.
      
      Fix this short coming by checking explicitly for the ibm,drc-info
      property, and falling back to the older ibm,drc-* properties if it
      doesn't exist.
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1573449697-5448-6-git-send-email-tyreld@linux.ibm.com
      52e2b0f1
    • Tyrel Datwyler's avatar
      PCI: rpaphp: Fix up pointer to first drc-info entry · 9723c25f
      Tyrel Datwyler authored
      The first entry of the ibm,drc-info property is an int encoded count
      of the number of drc-info entries that follow. The "value" pointer
      returned by of_prop_next_u32() is still pointing at the this value
      when we call of_read_drc_info_cell(), but the helper function
      expects that value to be pointing at the first element of an entry.
      
      Fix up by incrementing the "value" pointer to point at the first
      element of the first drc-info entry prior.
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1573449697-5448-5-git-send-email-tyreld@linux.ibm.com
      9723c25f
    • Tyrel Datwyler's avatar
      powerpc/pseries: Add cpu DLPAR support for drc-info property · b015f6bc
      Tyrel Datwyler authored
      Older firmwares provided information about Dynamic Reconfig
      Connectors (DRC) through several device tree properties, namely
      ibm,drc-types, ibm,drc-indexes, ibm,drc-names, and
      ibm,drc-power-domains. New firmwares have the ability to present this
      same information in a much condensed format through a device tree
      property called ibm,drc-info.
      
      The existing cpu DLPAR hotplug code only understands the older DRC
      property format when validating the drc-index of a cpu during a
      hotplug add. This updates those code paths to use the ibm,drc-info
      property, when present, instead for validation.
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1573449697-5448-4-git-send-email-tyreld@linux.ibm.com
      b015f6bc
    • Tyrel Datwyler's avatar
      powerpc/pseries: Fix drc-info mappings of logical cpus to drc-index · 775fa495
      Tyrel Datwyler authored
      There are a couple subtle errors in the mapping between cpu-ids and a
      cpus associated drc-index when using the new ibm,drc-info property.
      
      The first is that while drc-info may have been a supported firmware
      feature at boot it is possible we have migrated to a CEC with older
      firmware that doesn't support the ibm,drc-info property. In that case
      the device tree would have been updated after migration to remove the
      ibm,drc-info property and replace it with the older style ibm,drc-*
      properties for types, indexes, names, and power-domains. PAPR even
      goes as far as dictating that if we advertise support for drc-info
      that we are capable of supporting either property type at runtime.
      
      The second is that the first value of the ibm,drc-info property is
      the int encoded count of drc-info entries. As such "value" returned
      by of_prop_next_u32() is pointing at that count, and not the first
      element of the first drc-info entry as is expected by the
      of_read_drc_info_cell() helper.
      
      Fix the first by ignoring DRC-INFO firmware feature and instead
      testing directly for ibm,drc-info, and then falling back to the
      old style ibm,drc-indexes in the case it doesn't exit.
      
      Fix the second by incrementing value to the next element prior to
      parsing drc-info entries.
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1573449697-5448-3-git-send-email-tyreld@linux.ibm.com
      775fa495
    • Tyrel Datwyler's avatar
      powerpc/pseries: Fix bad drc_index_start value parsing of drc-info entry · 57409d4f
      Tyrel Datwyler authored
      The ibm,drc-info property is an array property that contains drc-info
      entries such that each entry is made up of 2 string encoded elements
      followed by 5 int encoded elements. The of_read_drc_info_cell()
      helper contains comments that correctly name the expected elements
      and their encoding. However, the usage of of_prop_next_string() and
      of_prop_next_u32() introduced a subtle skippage of the first u32.
      This is a result of of_prop_next_string() returning a pointer to the
      next property value which is not a string, but actually a (__be32 *).
      As, a result the following call to of_prop_next_u32() passes over the
      current int encoded value and actually stores the next one wrongly.
      
      Simply endian swap the current value in place after reading the first
      two string values. The remaining int encoded values can then be read
      correctly using of_prop_next_u32().
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1573449697-5448-2-git-send-email-tyreld@linux.ibm.com
      57409d4f
    • Michael Ellerman's avatar
      Merge branch 'topic/secureboot' into next · d34a5709
      Michael Ellerman authored
      Merge the secureboot support, as well as the IMA changes needed to
      support it.
      
      From Nayna's cover letter:
        In order to verify the OS kernel on PowerNV systems, secure boot
        requires X.509 certificates trusted by the platform. These are
        stored in secure variables controlled by OPAL, called OPAL secure
        variables. In order to enable users to manage the keys, the secure
        variables need to be exposed to userspace.
      
        OPAL provides the runtime services for the kernel to be able to
        access the secure variables. This patchset defines the kernel
        interface for the OPAL APIs. These APIs are used by the hooks, which
        load these variables to the keyring and expose them to the userspace
        for reading/writing.
      
        Overall, this patchset adds the following support:
          * expose secure variables to the kernel via OPAL Runtime API interface
          * expose secure variables to the userspace via kernel sysfs interface
          * load kernel verification and revocation keys to .platform and
            .blacklist keyring respectively.
      
        The secure variables can be read/written using simple linux
        utilities cat/hexdump.
      
        For example:
        Path to the secure variables is: /sys/firmware/secvar/vars
      
          Each secure variable is listed as directory.
          $ ls -l
          total 0
          drwxr-xr-x. 2 root root 0 Aug 20 21:20 db
          drwxr-xr-x. 2 root root 0 Aug 20 21:20 KEK
          drwxr-xr-x. 2 root root 0 Aug 20 21:20 PK
      
        The attributes of each of the secure variables are (for example: PK):
          $ ls -l
          total 0
          -r--r--r--. 1 root root  4096 Oct  1 15:10 data
          -r--r--r--. 1 root root 65536 Oct  1 15:10 size
          --w-------. 1 root root  4096 Oct  1 15:12 update
      
        The "data" is used to read the existing variable value using
        hexdump. The data is stored in ESL format. The "update" is used to
        write a new value using cat. The update is to be submitted as AUTH
        file.
      d34a5709
  2. 12 Nov, 2019 15 commits
  3. 07 Nov, 2019 7 commits
  4. 06 Nov, 2019 1 commit
  5. 05 Nov, 2019 10 commits
  6. 04 Nov, 2019 1 commit