1. 30 1月, 2018 6 次提交
  2. 29 1月, 2018 15 次提交
    • P
      Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging · 0d144291
      Peter Maydell 提交于
      # gpg: Signature made Mon 29 Jan 2018 08:14:19 GMT
      # gpg:                using RSA key 0xEF04965B398D6211
      # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
      
      * remotes/jasowang/tags/net-pull-request:
        MAINTAINERS: update Dmitry Fleytman email
        qemu-doc: Get rid of "vlan=X" example in the documentation
        net: Allow netdevs to be used with 'hostfwd_add' and 'hostfwd_remove'
        net: Allow hubports to connect to other netdevs
        colo: compare the packet based on the tcp sequence number
        colo: modified the payload compare function
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0d144291
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.12-20180129' into staging · fccfcc63
      Peter Maydell 提交于
      ppc patch queue 2018-01-29
      
      Here's another batch of patches for ppc, spapr and related things.
      Higlights:
      
        * Implement (with a bunch of necessary infrastructure) a hypercall
          to let guests properly apply Spectre and Meltdown workarounds.
        * Convert a number of old devices to trace events
        * Fix some bugs
      
      # gpg: Signature made Mon 29 Jan 2018 03:27:30 GMT
      # gpg:                using RSA key 0x6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.12-20180129:
        target/ppc/spapr: Add H-Call H_GET_CPU_CHARACTERISTICS
        target/ppc/spapr_caps: Add new tristate cap safe_indirect_branch
        target/ppc/spapr_caps: Add new tristate cap safe_bounds_check
        target/ppc/spapr_caps: Add new tristate cap safe_cache
        target/ppc/spapr_caps: Add support for tristate spapr_capabilities
        target/ppc/kvm: Add cap_ppc_safe_[cache/bounds_check/indirect_branch]
        spapr_pci: fix MSI/MSIX selection
        input: add missing newline from trace-events
        uninorth: convert to trace-events
        grackle: convert to trace-events
        ppc: Deprecate qemu-system-ppcemb
        ppc/pnv: fix PnvChip redefinition in <hw/ppc/pnv_xscom.h>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      fccfcc63
    • P
      MAINTAINERS: update Dmitry Fleytman email · bf4835a4
      Philippe Mathieu-Daudé 提交于
      gently asked by his automatic reply :)
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      bf4835a4
    • T
      qemu-doc: Get rid of "vlan=X" example in the documentation · 74f78b99
      Thomas Huth 提交于
      The vlan concept is marked as deprecated, so we should not use
      this for examples in the documentation anymore.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      74f78b99
    • T
      net: Allow netdevs to be used with 'hostfwd_add' and 'hostfwd_remove' · 93653066
      Thomas Huth 提交于
      It does not make much sense to limit these commands to the legacy 'vlan'
      concept only, they should work with the modern netdevs, too. So now
      it is possible to use this command with one, two or three parameters.
      
      With one parameter, the command installs a hostfwd rule on the default
      "user" network:
          hostfwd_add tcp:...
      
      With two parameters, the command installs a hostfwd rule on a netdev
      (that's the new way of using this command):
          hostfwd_add netdev_id tcp:...
      
      With three parameters, the command installs a rule on a 'vlan' (aka hub):
          hostfwd_add hub_id name tcp:...
      
      Same applies to the hostfwd_remove command now.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      93653066
    • T
      net: Allow hubports to connect to other netdevs · 18d65d22
      Thomas Huth 提交于
      QEMU can emulate hubs to connect NICs and netdevs. This is currently
      primarily used for the mis-named 'vlan' feature of the networking
      subsystem. Now the 'vlan' feature has been marked as deprecated, since
      its name is rather confusing and the users often rather mis-configure
      their network when trying to use it. But while the 'vlan' parameter
      should be removed at one point in time, the basic idea of emulating
      a hub in QEMU is still good: It's useful for bundling up the output of
      multiple NICs into one single l2tp netdev for example.
      
      Now to be able to use the hubport feature without 'vlan's, there is one
      missing piece: The possibility to connect a hubport to a netdev, too.
      This patch adds this possibility by introducing a new "netdev=..."
      parameter to the hubports.
      
      To bundle up the output of multiple NICs into one socket netdev, you can
      now run QEMU with these parameters for example:
      
      qemu-system-ppc64 ... -netdev socket,id=s1,connect=:11122 \
          -netdev hubport,hubid=1,id=h1,netdev=s1 \
          -netdev hubport,hubid=1,id=h2 -device e1000,netdev=h2 \
          -netdev hubport,hubid=1,id=h3 -device virtio-net-pci,netdev=h3
      
      For using the socket netdev, you have got to start another QEMU as the
      receiving side first, for example with network dumping enabled:
      
      qemu-system-x86_64 -M isapc -netdev socket,id=s0,listen=:11122 \
          -device ne2k_isa,netdev=s0 \
          -object filter-dump,id=f1,netdev=s0,file=/tmp/dump.dat
      
      After the ppc64 guest tried to boot from both NICs, you can see in the
      dump file (using Wireshark, for example), that the output of both NICs
      (the e1000 and the virtio-net-pci) has been successfully transfered
      via the socket netdev in this case.
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      18d65d22
    • M
      colo: compare the packet based on the tcp sequence number · f449c9e5
      Mao Zhongyi 提交于
      Packet size some time different or when network is busy.
      Based on same payload size, but TCP protocol can not
      guarantee send the same one packet in the same way,
      
      like that:
      We send this payload:
      ------------------------------
      | header |1|2|3|4|5|6|7|8|9|0|
      ------------------------------
      
      primary:
      ppkt1:
      ----------------
      | header |1|2|3|
      ----------------
      ppkt2:
      ------------------------
      | header |4|5|6|7|8|9|0|
      ------------------------
      
      secondary:
      spkt1:
      ------------------------------
      | header |1|2|3|4|5|6|7|8|9|0|
      ------------------------------
      
      In the original method, ppkt1 and ppkt2 are different in size and
      spkt1, so they can't compare and trigger the checkpoint.
      
      I have tested FTP get 200M and 1G file many times, I found that
      the performance was less than 1% of the native.
      
      Now I reconstructed the comparison of TCP packets based on the
      TCP sequence number. first of all, ppkt1 and spkt1 have the same
      starting sequence number, so they can compare, even though their
      length is different. And then ppkt1 with a smaller payload length
      is used as the comparison length, if the payload is same, send
      out the ppkt1 and record the offset(the length of ppkt1 payload)
      in spkt1. The next comparison, ppkt2 and spkt1 can be compared
      from the recorded position of spkt1.
      
      like that:
      ----------------
      | header |1|2|3| ppkt1
      ---------|-----|
               |     |
      ---------v-----v--------------
      | header |1|2|3|4|5|6|7|8|9|0| spkt1
      ---------------|\------------|
                     | \offset     |
            ---------v-------------v
            | header |4|5|6|7|8|9|0| ppkt2
            ------------------------
      
      In this way, the performance can reach native 20% in my multiple
      tests.
      
      Cc: Zhang Chen <zhangckid@gmail.com>
      Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: NMao Zhongyi <maozy.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NZhang Chen <zhangckid@gmail.com>
      Reviewed-by: NZhang Chen <zhangckid@gmail.com>
      Tested-by: NZhang Chen <zhangckid@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      f449c9e5
    • M
      colo: modified the payload compare function · 9394133f
      Mao Zhongyi 提交于
      Modified the function colo_packet_compare_common to prepare for the
      tcp packet comparison in the next patch.
      
      Cc: Zhang Chen <zhangckid@gmail.com>
      Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: NMao Zhongyi <maozy.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NZhang Chen <zhangckid@gmail.com>
      Reviewed-by: NZhang Chen <zhangckid@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      9394133f
    • S
      target/ppc/spapr: Add H-Call H_GET_CPU_CHARACTERISTICS · c59704b2
      Suraj Jitindar Singh 提交于
      The new H-Call H_GET_CPU_CHARACTERISTICS is used by the guest to query
      behaviours and available characteristics of the cpu.
      
      Implement the handler for this new H-Call which formulates its response
      based on the setting of the spapr_caps cap-cfpc, cap-sbbc and cap-ibs.
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      c59704b2
    • S
      target/ppc/spapr_caps: Add new tristate cap safe_indirect_branch · 4be8d4e7
      Suraj Jitindar Singh 提交于
      Add new tristate cap cap-ibs to represent the indirect branch
      serialisation capability.
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      4be8d4e7
    • S
      target/ppc/spapr_caps: Add new tristate cap safe_bounds_check · 09114fd8
      Suraj Jitindar Singh 提交于
      Add new tristate cap cap-sbbc to represent the speculation barrier
      bounds checking capability.
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      09114fd8
    • S
      target/ppc/spapr_caps: Add new tristate cap safe_cache · 8f38eaf8
      Suraj Jitindar Singh 提交于
      Add new tristate cap cap-cfpc to represent the cache flush on privilege
      change capability.
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      8f38eaf8
    • S
      target/ppc/spapr_caps: Add support for tristate spapr_capabilities · 6898aed7
      Suraj Jitindar Singh 提交于
      spapr_caps are used to represent the level of support for various
      capabilities related to the spapr machine type. Currently there is
      only support for boolean capabilities.
      
      Add support for tristate capabilities by implementing their get/set
      functions. These capabilities can have the values 0, 1 or 2
      corresponding to broken, workaround and fixed.
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      6898aed7
    • S
      target/ppc/kvm: Add cap_ppc_safe_[cache/bounds_check/indirect_branch] · 8acc2ae5
      Suraj Jitindar Singh 提交于
      Add three new kvm capabilities used to represent the level of host support
      for three corresponding workarounds.
      
      Host support for each of the capabilities is queried through the
      new ioctl KVM_PPC_GET_CPU_CHAR which returns four uint64 quantities. The
      first two, character and behaviour, represent the available
      characteristics of the cpu and the behaviour of the cpu respectively.
      The second two, c_mask and b_mask, represent the mask of known bits for
      the character and beheviour dwords respectively.
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      [dwg: Correct some compile errors due to name change in final kernel
       patch version]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      8acc2ae5
    • G
      spapr_pci: fix MSI/MSIX selection · 9cbe305b
      Greg Kurz 提交于
      In various place we don't correctly check if the device supports MSI or
      MSI-X. This can cause devices to be advertised with MSI support, even
      if they only support MSI-X (like virtio-pci-* devices for example):
      
                      ethernet@0 {
                              ibm,req#msi = <0x1>; <--- wrong!
      			.
      			ibm,loc-code = "qemu_virtio-net-pci:0000:00:00.0";
      			.
      			ibm,req#msi-x = <0x3>;
                      };
      
      Worse, this can also cause the "ibm,change-msi" RTAS call to corrupt the
      PCI status and cause migration to fail:
      
        qemu-system-ppc64: get_pci_config_device: Bad config data: i=0x6
          read: 0 device: 10 cmask: 10 wmask: 0 w1cmask:0
                                    ^^
                 PCI_STATUS_CAP_LIST bit which is assumed to be constant
      
      This patch changes spapr_populate_pci_child_dt() to properly check for
      MSI support using msi_present(): this ensures that PCIDevice::msi_cap
      was set by msi_init() and that msi_nr_vectors_allocated() will look at
      the right place in the config space.
      
      Checking PCIDevice::msix_entries_nr is enough for MSI-X but let's add
      a call to msix_present() there as well for consistency.
      
      It also changes rtas_ibm_change_msi() to select the appropriate MSI
      type in Function 1 instead of always selecting plain MSI. This new
      behaviour is compliant with LoPAPR 1.1, as described in "Table 71.
      ibm,change-msi Argument Call Buffer":
      
        Function 1: If Number Outputs is equal to 3, request to set to a new
                 number of MSIs (including set to 0).
                 If the “ibm,change-msix-capable” property exists and Number
                 Outputs is equal to 4, request is to set to a new number of
                 MSI or MSI-X (platform choice) interrupts (including set to
                 0).
      
      Since MSI is the the platform default (LoPAPR 6.2.3 MSI Option), let's
      check for MSI support first.
      
      And finally, it checks the input parameters are valid, as described in
      LoPAPR 1.1 "R1–7.3.10.5.1–3":
      
        For the MSI option: The platform must return a Status of -3 (Parameter
        error) from ibm,change-msi, with no change in interrupt assignments if
        the PCI configuration address does not support MSI and Function 3 was
        requested (that is, the “ibm,req#msi” property must exist for the PCI
        configuration address in order to use Function 3), or does not support
        MSI-X and Function 4 is requested (that is, the “ibm,req#msi-x” property
        must exist for the PCI configuration address in order to use Function 4),
        or if neither MSIs nor MSI-Xs are supported and Function 1 is requested.
      
      This ensures that the ret_intr_type variable contains a valid MSI type
      for this device, and that spapr_msi_setmsg() won't corrupt the PCI status.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      9cbe305b
  3. 27 1月, 2018 6 次提交
  4. 26 1月, 2018 13 次提交