1. 17 5月, 2017 7 次提交
    • E
      qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable · e90f2a8c
      Eduardo Habkost 提交于
      cannot_instantiate_with_device_add_yet was introduced by commit
      efec3dd6 to replace no_user. It was
      supposed to be a temporary measure.
      
      When it was introduced, we had 54
      cannot_instantiate_with_device_add_yet=true lines in the code.
      Today (3 years later) this number has not shrunk: we now have
      57 cannot_instantiate_with_device_add_yet=true lines. I think it
      is safe to say it is not a temporary measure, and we won't see
      the flag go away soon.
      
      Instead of a long field name that misleads people to believe it
      is temporary, replace it a shorter and less misleading field:
      user_creatable.
      
      Except for code comments, changes were generated using the
      following Coccinelle patch:
      
        @@
        expression DC;
        @@
        (
        -DC->cannot_instantiate_with_device_add_yet = false;
        +DC->user_creatable = true;
        |
        -DC->cannot_instantiate_with_device_add_yet = true;
        +DC->user_creatable = false;
        )
      
        @@
        typedef ObjectClass;
        expression dc;
        identifier class, data;
        @@
         static void device_class_init(ObjectClass *class, void *data)
         {
         ...
         dc->hotpluggable = true;
        +dc->user_creatable = true;
         ...
         }
      
        @@
        @@
         struct DeviceClass {
         ...
        -bool cannot_instantiate_with_device_add_yet;
        +bool user_creatable;
         ...
        }
      
        @@
        expression DC;
        @@
        (
        -!DC->cannot_instantiate_with_device_add_yet
        +DC->user_creatable
        |
        -DC->cannot_instantiate_with_device_add_yet
        +!DC->user_creatable
        )
      
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: NAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-2-ehabkost@redhat.com>
      [ehabkost: kept "TODO remove once we're there" comment]
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e90f2a8c
    • S
      Merge remote-tracking branch 'sstabellini/tags/xen-20170516-tag' into staging · 599c9cb6
      Stefan Hajnoczi 提交于
      Xen 2017/05/16
      
      # gpg: Signature made Tue 16 May 2017 08:18:32 PM BST
      # gpg:                using RSA key 0x894F8F4870E1AE90
      # gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"
      # gpg:                 aka "Stefano Stabellini <sstabellini@kernel.org>"
      # Primary key fingerprint: D04E 33AB A51F 67BA 07D3  0AEA 894F 8F48 70E1 AE90
      
      * sstabellini/tags/xen-20170516-tag:
        xen: call qemu_set_cloexec instead of fcntl
        xen/9pfs: fix two resource leaks on error paths, discovered by Coverity
        configure: Remove -lxencall for Xen detection
        xen/mapcache: store dma information in revmapcache entries for debugging
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      599c9cb6
    • S
      Merge remote-tracking branch 'jtc/tags/block-pull-request' into staging · fefb28a4
      Stefan Hajnoczi 提交于
      # gpg: Signature made Tue 16 May 2017 04:47:09 PM BST
      # gpg:                using RSA key 0xBDBE7B27C0DE3057
      # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
      # gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
      # gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"
      # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057
      
      * jtc/tags/block-pull-request:
        curl: do not do aio_poll when waiting for a free CURLState
        curl: convert readv to coroutines
        curl: convert CURLAIOCB to byte values
        curl: split curl_find_state/curl_init_state
        curl: avoid recursive locking of BDRVCURLState mutex
        curl: never invoke callbacks with s->mutex held
        curl: strengthen assertion in curl_clean_state
        block: curl: Allow passing cookies via QCryptoSecret
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fefb28a4
    • S
      xen: call qemu_set_cloexec instead of fcntl · 01cd90b6
      Stefano Stabellini 提交于
      Use the common utility function, which contains checks on return values
      and first calls F_GETFD as recommended by POSIX.1-2001, instead of
      manually calling fcntl.
      
      CID: 1374831
      Signed-off-by: NStefano Stabellini <sstabellini@kernel.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      CC: anthony.perard@citrix.com
      CC: groug@kaod.org
      CC: aneesh.kumar@linux.vnet.ibm.com
      CC: Eric Blake <eblake@redhat.com>
      01cd90b6
    • S
      xen/9pfs: fix two resource leaks on error paths, discovered by Coverity · c0c24b95
      Stefano Stabellini 提交于
      CID: 1374836
      Signed-off-by: NStefano Stabellini <sstabellini@kernel.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      CC: anthony.perard@citrix.com
      CC: groug@kaod.org
      CC: aneesh.kumar@linux.vnet.ibm.com
      c0c24b95
    • A
      configure: Remove -lxencall for Xen detection · d9506cab
      Anthony PERARD 提交于
      QEMU does not depends on libxencall, it was added because it was a
      missing link dependency of libxendevicemodel, but now the later should
      be built properly.
      Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
      Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
      d9506cab
    • S
      xen/mapcache: store dma information in revmapcache entries for debugging · 1ff7c598
      Stefano Stabellini 提交于
      The Xen mapcache is able to create long term mappings, they are called
      "locked" mappings. The third parameter of the xen_map_cache call
      specifies if a mapping is a "locked" mapping.
      
      >From the QEMU point of view there are two kinds of long term mappings:
      
      [a] device memory mappings, such as option roms and video memory
      [b] dma mappings, created by dma_memory_map & friends
      
      After certain operations, ballooning a VM in particular, Xen asks QEMU
      kindly to destroy all mappings. However, certainly [a] mappings are
      present and cannot be removed. That's not a problem as they are not
      affected by balloonning. The *real* problem is that if there are any
      mappings of type [b], any outstanding dma operations could fail. This is
      a known shortcoming. In other words, when Xen asks QEMU to destroy all
      mappings, it is an error if any [b] mappings exist.
      
      However today we have no way of distinguishing [a] from [b]. Because of
      that, we cannot even print a decent warning.
      
      This patch introduces a new "dma" bool field to MapCacheRev entires, to
      remember if a given mapping is for dma or is a long term device memory
      mapping. When xen_invalidate_map_cache is called, we print a warning if
      any [b] mappings exist. We ignore [a] mappings.
      
      Mappings created by qemu_map_ram_ptr are assumed to be [a], while
      mappings created by address_space_map->qemu_ram_ptr_length are assumed
      to be [b].
      
      The goal of the patch is to make debugging and system understanding
      easier.
      Signed-off-by: NStefano Stabellini <sstabellini@kernel.org>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Acked-by: NAnthony PERARD <anthony.perard@citrix.com>
      1ff7c598
  2. 16 5月, 2017 14 次提交
  3. 15 5月, 2017 6 次提交
    • S
      Merge remote-tracking branch 'kraxel/tags/pull-usb-20170512-1' into staging · 8a813c98
      Stefan Hajnoczi 提交于
      usb: bugfixes, doc update
      
      # gpg: Signature made Fri 12 May 2017 01:20:29 PM BST
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * kraxel/tags/pull-usb-20170512-1:
        hw/usb/dev-serial: Do not try to set vendorid or productid properties
        xhci: relax link check
        usb-hub: clear PORT_STAT_SUSPEND on wakeup
        xhci: fix logging
        usb-redir: fix stack overflow in usbredir_log_data
        qemu-doc: Update to use the new way of attaching USB devices
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      8a813c98
    • S
      Merge remote-tracking branch 'kraxel/tags/pull-ui-20170512-1' into staging · 384d9d55
      Stefan Hajnoczi 提交于
      ui: add egl-headless
      ui: some vnc cleanups
      ui: absolute events for input-linux
      
      # gpg: Signature made Fri 12 May 2017 12:50:07 PM BST
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * kraxel/tags/pull-ui-20170512-1:
        vnc: replace hweight_long() with ctpopl()
        vnc: simple clean up
        opengl: add egl-headless display
        egl: explicitly ask for core context
        egl-helpers: add missing error check
        egl-helpers: fix display init for x11
        egl-helpers: drop support for gles and debug logging
        virtio-gpu: move virtio_gpu_gl_block
        ui: input-linux: Add absolute event support
        ui: Support non-zero minimum values for absolute input axes
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      384d9d55
    • G
      9pfs: local: forbid client access to metadata (CVE-2017-7493) · 7a95434e
      Greg Kurz 提交于
      When using the mapped-file security mode, we shouldn't let the client mess
      with the metadata. The current code already tries to hide the metadata dir
      from the client by skipping it in local_readdir(). But the client can still
      access or modify it through several other operations. This can be used to
      escalate privileges in the guest.
      
      Affected backend operations are:
      - local_mknod()
      - local_mkdir()
      - local_open2()
      - local_symlink()
      - local_link()
      - local_unlinkat()
      - local_renameat()
      - local_rename()
      - local_name_to_path()
      
      Other operations are safe because they are only passed a fid path, which
      is computed internally in local_name_to_path().
      
      This patch converts all the functions listed above to fail and return
      EINVAL when being passed the name of the metadata dir. This may look
      like a poor choice for errno, but there's no such thing as an illegal
      path name on Linux and I could not think of anything better.
      
      This fixes CVE-2017-7493.
      Reported-by: NLeo Gaspard <leo@gaspard.io>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      7a95434e
    • S
      Merge remote-tracking branch 'ehabkost/tags/x86-and-machine-pull-request' into staging · ba9915e1
      Stefan Hajnoczi 提交于
      x86 and machine queue, 2017-05-11
      
      Highlights:
      * New "-numa cpu" option
      * NUMA distance configuration
      * migration/i386 vmstatification
      
      # gpg: Signature made Thu 11 May 2017 08:16:07 PM BST
      # gpg:                using RSA key 0x2807936F984DC5A6
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
      # gpg: Note: This key has expired!
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * ehabkost/tags/x86-and-machine-pull-request: (29 commits)
        migration/i386: Remove support for pre-0.12 formats
        vmstatification: i386 FPReg
        migration/i386: Remove old non-softfloat 64bit FP support
        tests: check -numa node,cpu=props_list usecase
        numa: add '-numa cpu,...' option for property based node mapping
        numa: remove node_cpu bitmaps as they are no longer used
        numa: use possible_cpus for not mapped CPUs check
        machine: call machine init from wrapper
        numa: remove no longer need numa_post_machine_init()
        tests: numa: add case for QMP command query-cpus
        QMP: include CpuInstanceProperties into query_cpus output output
        virt-arm: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu()
        spapr: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu()
        pc: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu()
        numa: do default mapping based on possible_cpus instead of node_cpu bitmaps
        numa: mirror cpu to node mapping in MachineState::possible_cpus
        numa: add check that board supports cpu_index to node mapping
        virt-arm: add node-id property to CPU
        pc: add node-id property to CPU
        spapr: add node-id property to sPAPR core
        ...
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ba9915e1
    • S
      Merge remote-tracking branch 'kraxel/tags/pull-vga-20170511-1' into staging · 43ad494c
      Stefan Hajnoczi 提交于
      make display updates thread safe, batch #2
      
      # gpg: Signature made Thu 11 May 2017 03:41:51 PM BST
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * kraxel/tags/pull-vga-20170511-1:
        vga: fix display update region calculation
        sm501: make display updates thread safe
        tcx: make display updates thread safe
        cg3: make display updates thread safe
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      43ad494c
    • S
      Merge remote-tracking branch 'dgibson/tags/ppc-for-2.10-20170511' into staging · 2f77ec73
      Stefan Hajnoczi 提交于
      ppc patch queue for 2017-05-11
      
      This pull request supersedes the one from yesterday (20170510), fixing
      an important style bug in one patch, and adding an extra couple of
      simple patches.
      
      Highlights of this set:
        * Some fixes for POWER9
        * TCG support for POWER9 radix MMU
        * VGA rom for Mac machine types
        * Fixes for the XICS interrupt controller
        * MTTCG support for ppc targets
      
      As suggested by Paolo, I've tried to add the Docker tests to my
      standard pre-pull-request tests.  I haven't wholly suceeded; this has
      been tested with some of the Docker images, but others I haven't
      managed due to problems that as best I can tell are not due to
      problems in this patch series.  I'll continue working on this for
      future pull requests.  Specifically, 'travis', 'fedora', and 'centos6'
      seem to work.  'min-glib' jammed while gtesting moxie, which seems
      very unlikely to be caused by this series.  'ubuntu', 'debian' and
      'debian-bootstrap' hit build errors almost immediately that look like
      problems with the container configuration, and 'debian-*-cross' hit
      build errors later on which also look like missing dependencies from
      the container.
      
      # gpg: Signature made Thu 11 May 2017 05:13:46 AM BST
      # gpg:                using RSA key 0x6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * dgibson/tags/ppc-for-2.10-20170511: (23 commits)
        target/ppc: Avoid printing wrong aliases in CPU help text
        pnv: Fix build failures on some host platforms
        target/ppc: Allow workarounds for POWER9 DD1
        spapr: Don't accidentally advertise HTM support on POWER9
        ppc: xics: fix compilation with CentOS 6
        target/ppc: Enable RADIX mmu mode for pseries TCG guest
        target/ppc: Implement ISA V3.00 radix page fault handler
        target/ppc: Change tlbie invalid fields for POWER9 support
        target/ppc: Update tlbie to check privilege level based on GTSE
        target/ppc: Set UPRT and GTSE on all cpus in H_REGISTER_PROCESS_TABLE
        ppc: add qemu_vga.ndrv ROM to fw_cfg interface for NewWorld Macs
        ppc: add qemu_vga.ndrv ROM to fw_cfg interface for OldWorld Macs
        Add QemuMacDrivers qemu_vga.ndrv revision d4e7d7a built as submodule
        Add QemuMacDrivers as submodule
        ppc/xics: preserve P and Q bits for KVM IRQs
        ppc/xics: Fix stale irq->status bits after get
        target/ppc: do not reset reserve_addr in exec_enter
        tcg: enable MTTCG by default for PPC64 on x86
        cpus: Fix CPU unplug for MTTCG
        target/ppc: Generate fence operations
        ...
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2f77ec73
  4. 13 5月, 2017 13 次提交