1. 05 10月, 2018 1 次提交
  2. 28 9月, 2018 16 次提交
  3. 27 9月, 2018 8 次提交
    • T
      KVM: s390: interface to clear CRYCB masks · 42104598
      Tony Krowiak 提交于
      Introduces a new KVM function to clear the APCB0 and APCB1 in the guest's
      CRYCB. This effectively clears all bits of the APM, AQM and ADM masks
      configured for the guest. The VCPUs are taken out of SIE to ensure the
      VCPUs do not get out of sync.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Acked-by: NHalil Pasic <pasic@linux.ibm.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Tested-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Message-Id: <20180925231641.4954-11-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      42104598
    • T
      s390: vfio-ap: sysfs interface to view matrix mdev matrix · 81b2b4b7
      Tony Krowiak 提交于
      Provides a sysfs interface to view the AP matrix configured for the
      mediated matrix device.
      
      The relevant sysfs structures are:
      
      /sys/devices/vfio_ap/matrix/
      ...... [mdev_supported_types]
      ......... [vfio_ap-passthrough]
      ............ [devices]
      ...............[$uuid]
      .................. matrix
      
      To view the matrix configured for the mediated matrix device,
      print the matrix file:
      
      	cat matrix
      
      Below are examples of the output from the above command:
      
      Example 1: Adapters and domains assigned
      	Assignments:
      		Adapters 5 and 6
      		Domains 4 and 71 (0x47)
      
      	Output
      		05.0004
      		05.0047
      		06.0004
      	06.0047
      
      Examples 2: Only adapters assigned
      	Assignments:
      		Adapters 5 and 6
      
      	Output:
      		05.
      		06.
      
      Examples 3: Only domains assigned
      	Assignments:
      		Domains 4 and 71 (0x47)
      
      	Output:
      		.0004
      		.0047
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Tested-by: NPierre Morel <pmorel@linux.ibm.com>
      Message-Id: <20180925231641.4954-10-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      81b2b4b7
    • T
      s390: vfio-ap: sysfs interfaces to configure control domains · 3b1eab7f
      Tony Krowiak 提交于
      Provides the sysfs interfaces for:
      
      1. Assigning AP control domains to the mediated matrix device
      
      2. Unassigning AP control domains from a mediated matrix device
      
      3. Displaying the control domains assigned to a mediated matrix
         device
      
      The IDs of the AP control domains assigned to the mediated matrix
      device are stored in an AP domain mask (ADM). The bits in the ADM,
      from most significant to least significant bit, correspond to
      AP domain numbers 0 to 255. On some systems, the maximum allowable
      domain number may be less than 255 - depending upon the host's
      AP configuration - and assignment may be rejected if the input
      domain ID exceeds the limit.
      
      When a control domain is assigned, the bit corresponding its domain
      ID will be set in the ADM. Likewise, when a domain is unassigned,
      the bit corresponding to its domain ID will be cleared in the ADM.
      
      The relevant sysfs structures are:
      
      /sys/devices/vfio_ap/matrix/
      ...... [mdev_supported_types]
      ......... [vfio_ap-passthrough]
      ............ [devices]
      ...............[$uuid]
      .................. assign_control_domain
      .................. unassign_control_domain
      
      To assign a control domain to the $uuid mediated matrix device's
      ADM, write its domain number to the assign_control_domain file.
      To unassign a domain, write its domain number to the
      unassign_control_domain file. The domain number is specified
      using conventional semantics: If it begins with 0x the number
      will be parsed as a hexadecimal (case insensitive) number;
      if it begins with 0, it is parsed as an octal number;
      otherwise, it will be parsed as a decimal number.
      
      For example, to assign control domain 173 (0xad) to the mediated
      matrix device $uuid:
      
      	echo 173 > assign_control_domain
      
      	or
      
      	echo 0255 > assign_control_domain
      
      	or
      
      	echo 0xad > assign_control_domain
      
      To unassign control domain 173 (0xad):
      
      	echo 173 > unassign_control_domain
      
      	or
      
      	echo 0255 > unassign_control_domain
      
      	or
      
      	echo 0xad > unassign_control_domain
      
      The assignment will be rejected if the APQI exceeds the maximum
      value for an AP domain:
        * If the AP Extended Addressing (APXA) facility is installed,
          the max value is 255
        * Else the max value is 15
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Tested-by: NPierre Morel <pmorel@linux.ibm.com>
      Message-Id: <20180925231641.4954-9-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      3b1eab7f
    • T
      s390: vfio-ap: sysfs interfaces to configure domains · 3211da0c
      Tony Krowiak 提交于
      Introduces two new sysfs attributes for the VFIO mediated
      matrix device for assigning AP domains to and unassigning
      AP domains from a mediated matrix device. The IDs of the
      AP domains assigned to the mediated matrix device will be
      stored in an AP queue mask (AQM).
      
      The bits in the AQM, from most significant to least
      significant bit, correspond to AP queue index (APQI) 0 to
      255 (note that an APQI is synonymous with with a domain ID).
      On some systems, the maximum allowable domain number may be
      less than 255 - depending upon the host's AP configuration -
      and assignment may be rejected if the input domain ID exceeds
      the limit.
      
      When a domain is assigned, the bit corresponding to the APQI
      will be set in the AQM. Likewise, when a domain is unassigned,
      the bit corresponding to the APQI will be cleared from the AQM.
      
      In order to successfully assign a domain, the APQNs derived from
      the domain ID being assigned and the adapter numbers of all
      adapters previously assigned:
      
      1. Must be bound to the vfio_ap device driver.
      
      2. Must not be assigned to any other mediated matrix device.
      
      If there are no adapters assigned to the mdev, then there must
      be an AP queue bound to the vfio_ap device driver with an
      APQN containing the domain ID (i.e., APQI), otherwise all
      adapters subsequently assigned will fail because there will be no
      AP queues bound with an APQN containing the APQI.
      
      Assigning or un-assigning an AP domain will also be rejected if
      a guest using the mediated matrix device is running.
      
      The relevant sysfs structures are:
      
      /sys/devices/vfio_ap/matrix/
      ...... [mdev_supported_types]
      ......... [vfio_ap-passthrough]
      ............ [devices]
      ...............[$uuid]
      .................. assign_domain
      .................. unassign_domain
      
      To assign a domain to the $uuid mediated matrix device,
      write the domain's ID to the assign_domain file. To
      unassign a domain, write the domain's ID to the
      unassign_domain file. The ID is specified using
      conventional semantics: If it begins with 0x, the number
      will be parsed as a hexadecimal (case insensitive) number;
      if it begins with 0, it will be parsed as an octal number;
      otherwise, it will be parsed as a decimal number.
      
      For example, to assign domain 173 (0xad) to the mediated matrix
      device $uuid:
      
      	echo 173 > assign_domain
      
      	or
      
      	echo 0255 > assign_domain
      
      	or
      
      	echo 0xad > assign_domain
      
      To unassign domain 173 (0xad):
      
      	echo 173 > unassign_domain
      
      	or
      
      	echo 0255 > unassign_domain
      
      	or
      
      	echo 0xad > unassign_domain
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Tested-by: NPierre Morel <pmorel@linux.ibm.com>
      Message-Id: <20180925231641.4954-8-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      3211da0c
    • T
      s390: vfio-ap: sysfs interfaces to configure adapters · 96d152bd
      Tony Krowiak 提交于
      Introduces two new sysfs attributes for the VFIO mediated
      matrix device for assigning AP adapters to and unassigning
      AP adapters from a mediated matrix device. The IDs of the
      AP adapters assigned to the mediated matrix device will be
      stored in an AP mask (APM).
      
      The bits in the APM, from most significant to least significant
      bit, correspond to AP adapter IDs (APID) 0 to 255. On
      some systems, the maximum allowable adapter number may be less
      than 255 - depending upon the host's AP configuration - and
      assignment may be rejected if the input adapter ID exceeds the
      limit.
      
      When an adapter is assigned, the bit corresponding to the APID
      will be set in the APM. Likewise, when an adapter is
      unassigned, the bit corresponding to the APID will be cleared
      from the APM.
      
      In order to successfully assign an adapter, the APQNs derived from
      the adapter ID being assigned and the queue indexes of all domains
      previously assigned:
      
      1. Must be bound to the vfio_ap device driver.
      
      2. Must not be assigned to any other mediated matrix device
      
      If there are no domains assigned to the mdev, then there must
      be an AP queue bound to the vfio_ap device driver with an
      APQN containing the APID, otherwise all domains
      subsequently assigned will fail because there will be no
      AP queues bound with an APQN containing the adapter ID.
      
      Assigning or un-assigning an AP adapter will be rejected if
      a guest using the mediated matrix device is running.
      
      The relevant sysfs structures are:
      
      /sys/devices/vfio_ap/matrix/
      ...... [mdev_supported_types]
      ......... [vfio_ap-passthrough]
      ............ [devices]
      ...............[$uuid]
      .................. assign_adapter
      .................. unassign_adapter
      
      To assign an adapter to the $uuid mediated matrix device's APM,
      write the APID to the assign_adapter file. To unassign an adapter,
      write the APID to the unassign_adapter file. The APID is specified
      using conventional semantics: If it begins with 0x the number will
      be parsed as a hexadecimal number; if it begins with a 0 the number
      will be parsed as an octal number; otherwise, it will be parsed as a
      decimal number.
      
      For example, to assign adapter 173 (0xad) to the mediated matrix
      device $uuid:
      
      	echo 173 > assign_adapter
      
      	or
      
      	echo 0xad > assign_adapter
      
      	or
      
      	echo 0255 > assign_adapter
      
      To unassign adapter 173 (0xad):
      
      	echo 173 > unassign_adapter
      
      	or
      
      	echo 0xad > unassign_adapter
      
      	or
      
      	echo 0255 > unassign_adapter
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Tested-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Message-Id: <20180925231641.4954-7-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      96d152bd
    • T
      s390: vfio-ap: register matrix device with VFIO mdev framework · 65f06713
      Tony Krowiak 提交于
      Registers the matrix device created by the VFIO AP device
      driver with the VFIO mediated device framework.
      Registering the matrix device will create the sysfs
      structures needed to create mediated matrix devices
      each of which will be used to configure the AP matrix
      for a guest and connect it to the VFIO AP device driver.
      
      Registering the matrix device with the VFIO mediated device
      framework will create the following sysfs structures:
      
      /sys/devices/vfio_ap/matrix/
      ...... [mdev_supported_types]
      ......... [vfio_ap-passthrough]
      ............ create
      
      To create a mediated device for the AP matrix device, write a UUID
      to the create file:
      
      	uuidgen > create
      
      A symbolic link to the mediated device's directory will be created in the
      devices subdirectory named after the generated $uuid:
      
      /sys/devices/vfio_ap/matrix/
      ...... [mdev_supported_types]
      ......... [vfio_ap-passthrough]
      ............ [devices]
      ............... [$uuid]
      
      A symbolic link to the mediated device will also be created
      in the vfio_ap matrix's directory:
      
      /sys/devices/vfio_ap/matrix/[$uuid]
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Message-Id: <20180925231641.4954-6-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      65f06713
    • T
      s390: vfio-ap: base implementation of VFIO AP device driver · 1fde5734
      Tony Krowiak 提交于
      Introduces a new AP device driver. This device driver
      is built on the VFIO mediated device framework. The framework
      provides sysfs interfaces that facilitate passthrough
      access by guests to devices installed on the linux host.
      
      The VFIO AP device driver will serve two purposes:
      
      1. Provide the interfaces to reserve AP devices for exclusive
         use by KVM guests. This is accomplished by unbinding the
         devices to be reserved for guest usage from the zcrypt
         device driver and binding them to the VFIO AP device driver.
      
      2. Implements the functions, callbacks and sysfs attribute
         interfaces required to create one or more VFIO mediated
         devices each of which will be used to configure the AP
         matrix for a guest and serve as a file descriptor
         for facilitating communication between QEMU and the
         VFIO AP device driver.
      
      When the VFIO AP device driver is initialized:
      
      * It registers with the AP bus for control of type 10 (CEX4
        and newer) AP queue devices. This limitation was imposed
        due to:
      
        1. A desire to keep the code as simple as possible;
      
        2. Some older models are no longer supported by the kernel
           and others are getting close to end of service.
      
        3. A lack of older systems on which to test older devices.
      
        The probe and remove callbacks will be provided to support
        the binding/unbinding of AP queue devices to/from the VFIO
        AP device driver.
      
      * Creates a matrix device, /sys/devices/vfio_ap/matrix,
        to serve as the parent of the mediated devices created, one
        for each guest, and to hold the APQNs of the AP devices bound to
        the VFIO AP device driver.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Message-Id: <20180925231641.4954-5-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      1fde5734
    • T
      KVM: s390: refactor crypto initialization · e585b24a
      Tony Krowiak 提交于
      This patch refactors the code that initializes and sets up the
      crypto configuration for a guest. The following changes are
      implemented via this patch:
      
      1. Introduces a flag indicating AP instructions executed on
         the guest shall be interpreted by the firmware. This flag
         is used to set a bit in the guest's state description
         indicating AP instructions are to be interpreted.
      
      2. Replace code implementing AP interfaces with code supplied
         by the AP bus to query the AP configuration.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: NJanosch Frank <frankja@linux.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Message-Id: <20180925231641.4954-4-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      e585b24a
  4. 26 9月, 2018 2 次提交
  5. 17 9月, 2018 2 次提交
  6. 16 9月, 2018 4 次提交
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 27c5a778
      Linus Torvalds 提交于
      Pull x86 fixes from Ingol Molnar:
       "Misc fixes:
      
         - EFI crash fix
      
         - Xen PV fixes
      
         - do not allow PTI on 2-level 32-bit kernels for now
      
         - documentation fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/APM: Fix build warning when PROC_FS is not enabled
        Revert "x86/mm/legacy: Populate the user page-table with user pgd's"
        x86/efi: Load fixmap GDT in efi_call_phys_epilog() before setting %cr3
        x86/xen: Disable CPU0 hotplug for Xen PV
        x86/EISA: Don't probe EISA bus for Xen PV guests
        x86/doc: Fix Documentation/x86/earlyprintk.txt
      27c5a778
    • L
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4314daa5
      Linus Torvalds 提交于
      Pull scheduler fixes from Ingo Molnar:
       "Misc fixes: various scheduler metrics corner case fixes, a
        sched_features deadlock fix, and a topology fix for certain NUMA
        systems"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: Fix kernel-doc notation warning
        sched/fair: Fix load_balance redo for !imbalance
        sched/fair: Fix scale_rt_capacity() for SMT
        sched/fair: Fix vruntime_normalized() for remote non-migration wakeup
        sched/pelt: Fix update_blocked_averages() for RT and DL classes
        sched/topology: Set correct NUMA topology type
        sched/debug: Fix potential deadlock when writing to sched_features
      4314daa5
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c0be92b5
      Linus Torvalds 提交于
      Pull perf fixes from Ingo Molnar:
       "Mostly tooling fixes, but also breakpoint and x86 PMU driver fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
        perf tools: Fix maps__find_symbol_by_name()
        tools headers uapi: Update tools's copy of linux/if_link.h
        tools headers uapi: Update tools's copy of linux/vhost.h
        tools headers uapi: Update tools's copies of kvm headers
        tools headers uapi: Update tools's copy of drm/drm.h
        tools headers uapi: Update tools's copy of asm-generic/unistd.h
        tools headers uapi: Update tools's copy of linux/perf_event.h
        perf/core: Force USER_DS when recording user stack data
        perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use
        perf/x86/intel: Add support/quirk for the MISPREDICT bit on Knights Landing CPUs
        perf annotate: Fix parsing aarch64 branch instructions after objdump update
        perf probe powerpc: Ignore SyS symbols irrespective of endianness
        perf event-parse: Use fixed size string for comms
        perf util: Fix bad memory access in trace info.
        perf tools: Streamline bpf examples and headers installation
        perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx()
        perf arm64: Fix include path for asm-generic/unistd.h
        perf/hw_breakpoint: Simplify breakpoint enable in perf_event_modify_breakpoint
        perf/hw_breakpoint: Enable breakpoint in modify_user_hw_breakpoint
        perf/hw_breakpoint: Remove superfluous bp->attr.disabled = 0
        ...
      c0be92b5
    • L
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ca062f8d
      Linus Torvalds 提交于
      Pull locking fixes from Ingo Molnar:
       "Misc fixes: liblockdep fixes and ww_mutex fixes"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/ww_mutex: Fix spelling mistake "cylic" -> "cyclic"
        locking/lockdep: Delete unnecessary #include
        tools/lib/lockdep: Add dummy task_struct state member
        tools/lib/lockdep: Add empty nmi.h
        tools/lib/lockdep: Update Sasha Levin email to MSFT
        jump_label: Fix typo in warning message
        locking/mutex: Fix mutex debug call and ww_mutex documentation
      ca062f8d
  7. 15 9月, 2018 7 次提交