1. 13 9月, 2018 4 次提交
  2. 21 8月, 2018 1 次提交
    • H
      s390/zcrypt: hex string mask improvements for apmask and aqmask. · 3d8f60d3
      Harald Freudenberger 提交于
      The sysfs attributes /sys/bus/ap/apmask and /sys/bus/ap/aqmask
      and the kernel command line arguments ap.apm and ap.aqm get
      an improvement of the value parsing with this patch:
      
      The mask values are bitmaps in big endian order starting with bit 0.
      So adapter number 0 is the leftmost bit, mask is 0x8000... The sysfs
      attributes and the kernel command line accept 2 different formats:
       - Absolute hex string starting with 0x like "0x12345678" does set
         the mask starting from left to right. If the given string is shorter
         than the mask it is padded with 0s on the right. If the string is
         longer than the mask an error comes back (EINVAL).
       - Relative format - a concatenation (done with ',') of the terms
         +<bitnr>[-<bitnr>] or -<bitnr>[-<bitnr>]. <bitnr> may be any
         valid number (hex, decimal or octal) in the range 0...255.
         Here are some examples:
           "+0-15,+32,-128,-0xFF"
           "-0-255,+1-16,+0x128"
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      3d8f60d3
  3. 20 8月, 2018 2 次提交
    • H
      s390/zcrypt: AP bus support for alternate driver(s) · 7e0bdbe5
      Harald Freudenberger 提交于
      The current AP bus, AP devices and AP device drivers implementation
      uses a clearly defined mapping for binding AP devices to AP device
      drivers. So for example a CEX6C queue will always be bound to the
      cex4queue device driver.
      
      The Linux Device Driver model has no sensitivity for more than one
      device driver eligible for one device type. If there exist more than
      one drivers matching to the device type, simple all drivers are tried
      consecutively.  There is no way to determine and influence the probing
      order of the drivers.
      
      With KVM there is a need to provide additional device drivers matching
      to the very same type of AP devices. With a simple implementation the
      KVM drivers run in competition to the regular drivers. Whichever
      'wins' a device depends on build order and implementation details
      within the common Linux Device Driver Model and is not
      deterministic. However, a userspace process could figure out which
      device should be bound to which driver and sort out the correct
      binding by manipulating attributes in the sysfs.
      
      If for security reasons a AP device must not get bound to the 'wrong'
      device driver the sorting out has to be done within the Linux kernel
      by the AP bus code. This patch modifies the behavior of the AP bus
      for probing drivers for devices in a way that two sets of drivers are
      usable. Two new bitmasks 'apmask' and 'aqmask' are used to mark a
      subset of the APQN range for 'usable by the ap bus and the default
      drivers' or 'not usable by the default drivers and thus available for
      alternate drivers like vfio-xxx'. So an APQN which is addressed by
      this masking only the default drivers will be probed. In contrary an
      APQN which is not addressed by the masks will never be probed and
      bound to default drivers but onny to alternate drivers.
      
      Eventually the two masks give a way to divide the range of APQNs into
      two pools: one pool of APQNs used by the AP bus and the default
      drivers and thus via zcrypt drivers available to the userspace of the
      system. And another pool where no zcrypt drivers are bound to and
      which can be used by alternate drivers (like vfio-xxx) for their
      needs. This division is hot-plug save and makes sure a APQN assigned
      to an alternate driver is at no time somehow exploitable by the wrong
      party.
      
      The two masks are located in sysfs at /sys/bus/ap/apmask and
      /sys/bus/ap/aqmask.  The mask syntax is exactly the same as the
      already existing mask attributes in the /sys/bus/ap directory (for
      example ap_usage_domain_mask and ap_control_domain_mask).
      
      By default all APQNs belong to the ap bus and the default drivers:
      
        cat /sys/bus/ap/apmask
        0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
        cat /sys/bus/ap/aqmask
        0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
      
      The masks can be changed at boot time with the kernel command line
      like this:
      
        ... ap.apmask=0xffff ap.aqmask=0x40
      
      This would give these two pools:
      
        default drivers pool:    adapter 0 - 15, domain 1
        alternate drivers pool:  adapter 0 - 15, all but domain 1
      			   adapter 16-255, all domains
      
      The sysfs attributes for this two masks are writeable and an
      administrator is able to reconfigure the assignements on the fly by
      writing new mask values into.  With changing the mask(s) a revision of
      the existing queue to driver bindings is done. So all APQNs which are
      bound to the 'wrong' driver are reprobed via kernel function
      device_reprobe() and thus the new correct driver will be assigned with
      respect of the changed apmask and aqmask bits.
      
      The mask values are bitmaps in big endian order starting with bit 0.
      So adapter number 0 is the leftmost bit, mask is 0x8000... The sysfs
      attributes accept 2 different formats:
      - Absolute hex string starting with 0x like "0x12345678" does set
        the mask starting from left to right. If the given string is shorter
        than the mask it is padded with 0s on the right. If the string is
        longer than the mask an error comes back (EINVAL).
      - '+' or '-' followed by a numerical value. Valid examples are "+1",
        "-13", "+0x41", "-0xff" and even "+0" and "-0". Only the addressed
        bit in the mask is switched on ('+') or off ('-').
      
      This patch will also be the base for an upcoming extension to the
      zcrypt drivers to be able to provide additional zcrypt device nodes
      with filtering based on ap and aq masks.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      7e0bdbe5
    • H
      s390/zcrypt: code beautify · ac2b96f3
      Harald Freudenberger 提交于
      Code beautify by following most of the checkpatch suggestions:
       - SPDX license identifier line complains by checkpatch
       - missing space or newline complains by checkpatch
       - octal numbers for permssions complains by checkpatch
       - renaming of static sysfs functions complains by checkpatch
       - fix of block comment complains by checkpatch
       - fix printf like calls where function name instead of %s __func__
         was used
       - __packed instead of __attribute__((packed))
       - init to zero for static variables removed
       - use of DEVICE_ATTR_RO and DEVICE_ATTR_RW macros
      
      No functional code changes or API changes!
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      ac2b96f3
  4. 18 8月, 2018 1 次提交
  5. 16 8月, 2018 1 次提交
  6. 10 8月, 2018 7 次提交
  7. 09 8月, 2018 2 次提交
  8. 31 7月, 2018 1 次提交
  9. 23 7月, 2018 6 次提交
    • T
      s390 cio: Rewrite trace point class s390_class_schib · d1de8633
      Thomas Richter 提交于
      Tools like 'perf stat' parse the trace point format files defined
      in /sys/kernel/debug/tracing/events/s390/.../format to handle
      the print fmt: statement. The kernel provides a library in
      directory linux/tools/lib/traceevent/* for this reason.
      
      This library can not handle structures or unions defined in
      the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
      There is no possibility to extract a structure member
      (which might be a bit field) since there is no packing
      information nor bit field offset by parsing the printf fmt line.
      
      Therefore rewrite the TRACE_EVENT macro and add the
      __field macro for the necessary members.
      Keep the __fieldstruct macro to extract the complete
      structure when dumps are analysed.
      
      Note that the same information is displayed, this is no
      interface change.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      d1de8633
    • T
      s390 cio: Rewrite trace point in s390_cio_tsch · 933df441
      Thomas Richter 提交于
      Tools like 'perf stat' parse the trace point format files defined
      in /sys/kernel/debug/tracing/events/s390/.../format to handle
      the print fmt: statement. The kernel provides a library in
      directory linux/tools/lib/traceevent/* for this reason.
      
      This library can not handle structures or unions defined in
      the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
      There is no possibility to extract a structure member
      (which might be a bit field) since there is no packing
      information nor bit field offset by parsing the printf fmt line.
      
      Therefore rewrite the TRACE_EVENT macro and add the
      __field macro for the necessary members.
      Keep the __fieldstruct macro to extract the complete
      structure when dumps are analysed.
      
      Note that the same information is displayed, this is no
      interface change.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      933df441
    • T
      s390 cio: Rewrite trace point in s390_cio_adapter_int · 27c0620c
      Thomas Richter 提交于
      Tools like 'perf stat' parse the trace point format files defined
      in /sys/kernel/debug/tracing/events/s390/.../format to handle
      the print fmt: statement. The kernel provides a library in
      directory linux/tools/lib/traceevent/* for this reason.
      
      This library can not handle structures or unions defined in
      the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
      There is no possibility to extract a structure member
      (which might be a bit field) since there is no packing
      information nor bit field offset by parsing the printf fmt line.
      
      Therefore rewrite the TRACE_EVENT macro and add the
      __field macro for the necessary members.
      Keep the __fieldstruct macro to extract the complete
      structure when dumps are analysed.
      
      Note that the same information is displayed, this is no
      interface change.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      27c0620c
    • T
      s390 cio: Rewrite trace point in s390_cio_stcrw · 67faae15
      Thomas Richter 提交于
      Tools like 'perf stat' parse the trace point format files defined
      in /sys/kernel/debug/tracing/events/s390/.../format to handle
      the print fmt: statement. The kernel provides a library in
      directory linux/tools/lib/traceevent/* for this reason.
      
      This library can not handle structures or unions defined in
      the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
      There is no possibility to extract a structure member
      (which might be a bit field) since there is no packing
      information nor bit field offset by parsing the printf fmt line.
      
      Therefore rewrite the TRACE_EVENT macro and add the
      the __field macro for the missing members.
      Keep the __fieldstruct macro to extract the complete
      structure when dumps are analysed.
      
      Note that the same information is displayed, this is no
      interface change.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      67faae15
    • T
      s390 cio: Rewrite trace point in s390_cio_tpi · 5925e819
      Thomas Richter 提交于
      Tools like 'perf stat' parse the trace point format files defined
      in /sys/kernel/debug/tracing/events/s390/.../format to handle
      the print fmt: statement. The kernel provides a library in
      directory linux/tools/lib/traceevent/* for this reason.
      
      This library can not handle structures or unions defined in
      the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
      There is no possibility to extract a structure member
      (which might be a bit field) since there is no packing
      information nor bit field offset by parsing the printf fmt line.
      
      Therefore rewrite the TRACE_EVENT macro and add the
      __field macro for the members adapter_IO, isc and type
      of struct tpi_info.
      
      Note that the same information is displayed, this is no
      interface change.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      5925e819
    • T
      s390 cio: Rewrite trace point in s390_cio_interrupt · 661c959b
      Thomas Richter 提交于
      Tools like 'perf stat' parse the trace point format files defined
      in /sys/kernel/debug/tracing/events/s390/.../format to handle
      the print fmt: statement. The kernel provides a library in
      directory linux/tools/lib/traceevent/* for this reason.
      
      This library can not handle structures or unions defined in
      the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
      There is no possibility to extract a structure member
      (which might be a bit field) since there is no packing
      information nor bit field offset by parsing the printf fmt line.
      
      Therefore rewrite the TRACE_EVENT macro and add the
      __field macro for the necessary fields.
      Keep the __fieldstruct macro to extract the complete
      structure when dumps are analysed.
      
      Note that the same information is displayed, this is no
      interface change.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      661c959b
  10. 22 7月, 2018 11 次提交
  11. 19 7月, 2018 4 次提交