1. 10 May, 2020 2 commits
    • Alexey Kardashevskiy's avatar
      powerpc/pci/of: Parse unassigned resources · c56680ee
      Alexey Kardashevskiy authored
      commit dead1c84 upstream.
      
      The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing
      which reads "assigned-addresses" of every PCI device and initializes
      the device resources. However if the property is missing or zero sized,
      then there is no fallback of any kind and the PCI resources remain
      undiscovered, i.e. pdev->resource[] array remains empty.
      
      This adds a fallback which parses the "reg" property in pretty much same
      way except it marks resources as "unset" which later make Linux assign
      those resources proper addresses.
      
      This has an effect when:
      1. a hypervisor failed to assign any resource for a device;
      2. /chosen/linux,pci-probe-only=0 is in the DT so the system may try
      assigning a resource.
      Neither is likely to happen under PowerVM.
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c56680ee
    • Jia He's avatar
      vhost: vsock: kick send_pkt worker once device is started · a9ca8a3b
      Jia He authored
      commit 0b841030 upstream.
      
      Ning Bo reported an abnormal 2-second gap when booting Kata container [1].
      The unconditional timeout was caused by VSOCK_DEFAULT_CONNECT_TIMEOUT of
      connecting from the client side. The vhost vsock client tries to connect
      an initializing virtio vsock server.
      
      The abnormal flow looks like:
      host-userspace           vhost vsock                       guest vsock
      ==============           ===========                       ============
      connect()     -------->  vhost_transport_send_pkt_work()   initializing
         |                     vq->private_data==NULL
         |                     will not be queued
         V
      schedule_timeout(2s)
                               vhost_vsock_start()  <---------   device ready
                               set vq->private_data
      
      wait for 2s and failed
      connect() again          vq->private_data!=NULL         recv connecting pkt
      
      Details:
      1. Host userspace sends a connect pkt, at that time, guest vsock is under
         initializing, hence the vhost_vsock_start has not been called. So
         vq->private_data==NULL, and the pkt is not been queued to send to guest
      2. Then it sleeps for 2s
      3. After guest vsock finishes initializing, vq->private_data is set
      4. When host userspace wakes up after 2s, send connecting pkt again,
         everything is fine.
      
      As suggested by Stefano Garzarella, this fixes it by additional kicking the
      send_pkt worker in vhost_vsock_start once the virtio device is started. This
      makes the pending pkt sent again.
      
      After this patch, kata-runtime (with vsock enabled) boot time is reduced
      from 3s to 1s on a ThunderX2 arm64 server.
      
      [1] https://github.com/kata-containers/runtime/issues/1917Reported-by: default avatarNing Bo <n.b@live.com>
      Suggested-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarJia He <justin.he@arm.com>
      Link: https://lore.kernel.org/r/20200501043840.186557-1-justin.he@arm.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a9ca8a3b
  2. 06 May, 2020 38 commits