1. 30 4月, 2018 15 次提交
  2. 27 4月, 2018 25 次提交
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180427-pull-request' into staging · 6f0c4706
      Peter Maydell 提交于
      usb: ccid bugfix, misc small improvements.
      
      # gpg: Signature made Fri 27 Apr 2018 11:20:18 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # 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
      
      * remotes/kraxel/tags/usb-20180427-pull-request:
        ccid-card: include libcacard.h only
        Fix libusb-1.0.22 deprecated libusb_set_debug with libusb_set_option
        ccid: Fix dwProtocols advertisement of T=0
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6f0c4706
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180427-pull-request' into staging · 10f4718b
      Peter Maydell 提交于
      vnc: fix use-after-free.
      sdl2: gles support.
      vfio-display: add reset support.
      
      # gpg: Signature made Fri 27 Apr 2018 10:54:17 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # 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
      
      * remotes/kraxel/tags/ui-20180427-pull-request:
        ui: introduce vfio_display_reset
        console: introduce dpy_gfx_update_full
        sdl: Allow OpenGL ES context creation
        sdl: Move DisplayOptions global to sdl2_console
        qapi: Parameter gl of DisplayType now accept an enum
        vnc: fix use-after-free
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      10f4718b
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.13-20180427' into staging · dcbd26f8
      Peter Maydell 提交于
      ppc patch queue 2018-04-27
      
      Here's the first batch of ppc patches for 2.13.  This has a lot of
      stuff that's accumulated during the 2.12 freeze.  Highlights are:
      
          * Many improvements for the Uninorth PCI host bridge for Mac
            machine types
          * Preliminary helpers improve handling of multiple backing
            pagesizes (not strictly ppc related, but have acks and aimed to
            allow future ppc changes)
          * Cleanups to pseries cpu initialization
          * Cleanups to hash64 MMU handling
          * Assorted bugfixes and improvements
      
      # gpg: Signature made Fri 27 Apr 2018 10:20:30 BST
      # gpg:                using RSA key 6C38CACA20D9B392
      # 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.13-20180427: (49 commits)
        Clear mem_path if we fall back to anonymous RAM allocation
        spapr: Set compatibility mode before the rest of spapr_cpu_reset()
        target/ppc: Don't bother with MSR_EP in cpu_ppc_set_papr()
        spapr: Support ibm,dynamic-memory-v2 property
        ppc: e500: switch E500 based machines to full machine definition
        spapr: Add ibm,max-associativity-domains property
        target/ppc: Fold slb_nr into PPCHash64Options
        target/ppc: Get rid of POWERPC_MMU_VER() macros
        target/ppc: Remove unnecessary POWERPC_MMU_V3 flag from mmu_model
        target/ppc: Fold ci_large_pages flag into PPCHash64Options
        target/ppc: Move 1T segment and AMR options to PPCHash64Options
        target/ppc: Make hash64_opts field mandatory for 64-bit hash MMUs
        target/ppc: Split page size information into a separate allocation
        target/ppc: Move page size setup to helper function
        target/ppc: Remove fallback 64k pagesize information
        target/ppc: Avoid taking "env" parameter to mmu-hash64 functions
        target/ppc: Pass cpu instead of env to ppc_create_page_sizes_prop()
        target/ppc: Simplify cpu valid check in ppc_cpu_realize
        target/ppc: Standardize instance_init and realize function names
        spapr: drop useless dynamic sysbus device sanity check
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      dcbd26f8
    • T
      ui: introduce vfio_display_reset · 8983e3e3
      Tina Zhang 提交于
      During guest OS reboot, guest framebuffer is invalid. It will cause
      bugs, if the invalid guest framebuffer is still used by host.
      
      This patch is to introduce vfio_display_reset which is invoked
      during vfio display reset. This vfio_display_reset function is used
      to release the invalid display resource, disable scanout mode and
      replace the invalid surface with QemuConsole's DisplaySurafce.
      
      This patch can fix the GPU hang issue caused by gd_egl_draw during
      guest OS reboot.
      
      Changes v3->v4:
       - Move dma-buf based display check into the vfio_display_reset().
         (Gerd)
      
      Changes v2->v3:
       - Limit vfio_display_reset to dma-buf based vfio display. (Gerd)
      
      Changes v1->v2:
       - Use dpy_gfx_update_full() update screen after reset. (Gerd)
       - Remove dpy_gfx_switch_surface(). (Gerd)
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Message-id: 1524820266-27079-3-git-send-email-tina.zhang@intel.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8983e3e3
    • T
      console: introduce dpy_gfx_update_full · 7cd0afe6
      Tina Zhang 提交于
      dpy_gfx_update_full is used to do the whole display surface update.
      
      This function is proposed by Gerd Hoffmann.
      Signed-off-by: NTina Zhang <tina.zhang@intel.com>
      Message-id: 1524820266-27079-2-git-send-email-tina.zhang@intel.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7cd0afe6
    • E
      sdl: Allow OpenGL ES context creation · 4867e47c
      Elie Tournier 提交于
      Signed-off-by: NElie Tournier <elie.tournier@collabora.com>
      Message-id: 20180413135842.21325-4-tournier.elie@gmail.com
      
      [ kraxel: fix indent ]
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4867e47c
    • M
      ccid-card: include libcacard.h only · 0f5c642d
      Michal Privoznik 提交于
      When trying to build with latest libcacard-2.5.1, I hit the
      following error:
      
      In file included from hw/usb/ccid-card-passthru.c:12:0:
      /usr/include/cacard/vscard_common.h:26:2: error: #warning "Only <libcacard.h> can be included directly" [-Werror=cpp]
       #warning "Only <libcacard.h> can be included directly"
      
      While it was fixed in libcacard upstream (so that individual
      files can be included directly), it doesn't make much sense.
      Let's switch to including the main libcacard.h and also require
      at least libcacard-2.5.1 which introduced it. It's available
      since late 2015.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 3c36db1dc0702763ebb7966cc27428ed67d43804.1522751624.git.mprivozn@redhat.com
      
      [ kraxel: fix include path ]
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      0f5c642d
    • J
      Fix libusb-1.0.22 deprecated libusb_set_debug with libusb_set_option · 9d8fa0df
      John Thomson 提交于
      libusb-1.0.22 marked libusb_set_debug deprecated
      it is replaced with
      libusb_set_option(libusb_context, LIBUSB_OPTION_LOG_LEVEL, libusb_log_level);
      
      details here: https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f461c5593168
      
      Warning here:
      
        CC      hw/usb/host-libusb.o
      /builds/xen/src/qemu-xen/hw/usb/host-libusb.c: In function 'usb_host_init':
      /builds/xen/src/qemu-xen/hw/usb/host-libusb.c:250:5: error: 'libusb_set_debug' is deprecated: Use libusb_set_option instead [-Werror=deprecated-declarations]
           libusb_set_debug(ctx, loglevel);
           ^~~~~~~~~~~~~~~~
      In file included from /builds/xen/src/qemu-xen/hw/usb/host-libusb.c:40:0:
      /usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
       void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                        ^~~~~~~~~~~~~~~~
      cc1: all warnings being treated as errors
      make: *** [/builds/xen/src/qemu-xen/rules.mak:66: hw/usb/host-libusb.o] Error 1
      make: Leaving directory '/builds/xen/src/xen/tools/qemu-xen-build'
      Signed-off-by: NJohn Thomson <git@johnthomson.fastmail.com.au>
      Message-id: 20180405132046.4968-1-git@johnthomson.fastmail.com.au
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9d8fa0df
    • J
      ccid: Fix dwProtocols advertisement of T=0 · 0ee86bb6
      Jason Andryuk 提交于
      Commit d7d218ef attempted to change
      dwProtocols to only advertise support for T=0 and not T=1.  The change
      was incorrect as it changed 0x00000003 to 0x00010000.
      
      lsusb -v in a linux guest shows:
      "dwProtocols         65536  (Invalid values detected)", though the
      smart card could still be accessed.  Windows 7 does not detect inserted
      smart cards and logs the the following Error in the Event Logs:
      
          Source: Smart Card Service
          Event ID: 610
          Smart Card Reader 'QEMU QEMU USB CCID 0' rejected IOCTL SET_PROTOCOL:
          Incorrect function. If this error persists, your smart card or reader
          may not be functioning correctly
      
          Command Header: 03 00 00 00
      
      Setting to 0x00000001 fixes the Windows issue.
      Signed-off-by: NJason Andryuk <jandryuk@gmail.com>
      Message-id: 20180420183219.20722-1-jandryuk@gmail.com
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      0ee86bb6
    • D
      Clear mem_path if we fall back to anonymous RAM allocation · 6233b679
      David Gibson 提交于
      If the -mem-path option is set, we attempt to map the guest's RAM from a
      file in the given path; it's usually used to back guest RAM with hugepages.
      If we're unable to (e.g. not enough free hugepages) then we fall back to
      allocating normal anonymous pages.  This behaviour can be surprising, but a
      comment in allocate_system_memory_nonnuma() suggests it's legacy behaviour
      we can't change.
      
      What really isn't ok, though, is that in this case we leave mem_path set.
      That means functions which attempt to determine the pagesize of main RAM
      can erroneously think it is hugepage based on the requested path, even
      though it's not.
      
      This is particular bad for the pseries machine type.  KVM HV limitations
      mean the guest can't use pagesizes larger than the host page size used to
      back RAM.  That means that such a fallback, rather than merely giving
      poorer performance than expected will cause the guest to freeze up early in
      boot as it attempts to use large page mappings that can't work.
      
      This patch addresses the problem by clearing the mem_path variable when we
      fall back to anonymous pages, meaning that subsequent attempts to
      determine the RAM page size will get an accurate result.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      6233b679
    • D
      spapr: Set compatibility mode before the rest of spapr_cpu_reset() · 88f42c67
      David Gibson 提交于
      Although the order doesn't really matter at the moment, it's possible
      other initializastions could depend on the compatiblity mode, so make sure
      we set it first in spapr_cpu_reset().
      
      While we're at it drop the test against first_cpu.  Setting the compat mode
      to the value it already has is redundant, but harmless, so we might as well
      make a small simplification to the code.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      88f42c67
    • D
      target/ppc: Don't bother with MSR_EP in cpu_ppc_set_papr() · 4550f6a5
      David Gibson 提交于
      cpu_ppc_set_papr() removes the EP and HV bits from the MSR mask.  While
      removing the HV bit makes sense (a cpu in PAPR mode should never be
      emulated in hypervisor mode), the EP bit is just bizarre.  Although it's
      true that a papr mode guest shouldn't be able to change the exception
      prefix, the MSR[EP] bit doesn't even exist on the cpus supported for PAPR
      mode, so it's pointless to do anything with it here.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      4550f6a5
    • B
      spapr: Support ibm,dynamic-memory-v2 property · a324d6f1
      Bharata B Rao 提交于
      The new property ibm,dynamic-memory-v2 allows memory to be represented
      in a more compact manner in device tree.
      Signed-off-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      a324d6f1
    • I
      ppc: e500: switch E500 based machines to full machine definition · 03f04809
      Igor Mammedov 提交于
      Convert PPCE500Params to PCCE500MachineClass which it essentially is,
      and introduce PCCE500MachineState to keep track of E500 specific
      state instead of adding global variables or extra parameters to
      functions when we need to keep data beyond machine init
      (i.e. make it look like typical fully defined machine).
      
      It's pretty shallow conversion instead of currently used trivial
      DEFINE_MACHINE() macro. It adds extra 60LOC of boilerplate code
      of full machine definition.
      
      The patch on top[1] will use PCCE500MachineState to keep track of
      platform_bus device and add E500Plate specific machine class
      to use HOTPLUG_HANDLER for explicitly initializing dynamic
      sysbus devices at the time they are added instead of delaying
      it to machine done time by platform_bus_init_notify() which is
      being removed.
      
      1)  <1523551221-11612-3-git-send-email-imammedo@redhat.com>
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Suggested-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      03f04809
    • S
      spapr: Add ibm,max-associativity-domains property · da9f80fb
      Serhii Popovych 提交于
      Now recent kernels (i.e. since linux-stable commit a346137e9142
      ("powerpc/numa: Use ibm,max-associativity-domains to discover possible nodes")
      support this property to mark initially memory-less NUMA nodes as "possible"
      to allow further memory hot-add to them.
      
      Advertise this property for pSeries machines to let guest kernels detect
      maximum supported node configuration and benefit from kernel side change
      when hot-add memory to specific, possibly empty before, NUMA node.
      Signed-off-by: NSerhii Popovych <spopovyc@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      da9f80fb
    • D
      target/ppc: Fold slb_nr into PPCHash64Options · 67d7d66f
      David Gibson 提交于
      The env->slb_nr field gives the size of the SLB (Segment Lookaside Buffer).
      This is another static-after-initialization parameter of the specific
      version of the 64-bit hash MMU in the CPU.  So, this patch folds the field
      into PPCHash64Options with the other hash MMU options.
      
      This is a bit more complicated that the things previously put in there,
      because slb_nr was foolishly included in the migration stream.  So we need
      some of the usual dance to handle backwards compatible migration.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      67d7d66f
    • D
      target/ppc: Get rid of POWERPC_MMU_VER() macros · 0941d728
      David Gibson 提交于
      These macros were introduced to deal with the fact that the mmu_model
      field has bit flags mixed in with what's otherwise an enum of various mmu
      types.
      
      We've now eliminated all those flags except for one, and that one -
      POWERPC_MMU_64 - is already included/compared in the MMU_VER macros.  So,
      we can get rid of those macros and just directly compare mmu_model values
      in the places it was used.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      0941d728
    • D
      target/ppc: Remove unnecessary POWERPC_MMU_V3 flag from mmu_model · ca79b3b7
      David Gibson 提交于
      The only place we test this flag is in conjunction with
      ppc64_use_proc_tbl().  That checks for the LPCR_UPRT bit, which we already
      ensure can't be set except on a machine with a v3 MMU (i.e. POWER9).
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      ca79b3b7
    • D
      target/ppc: Fold ci_large_pages flag into PPCHash64Options · 26cd35b8
      David Gibson 提交于
      The ci_large_pages boolean in CPUPPCState is only relevant to 64-bit hash
      MMU machines, indicating whether it's possible to map large (> 4kiB) pages
      as cache-inhibitied (i.e. for IO, rather than memory).  Fold it as another
      flag into the PPCHash64Options structure.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      26cd35b8
    • D
      target/ppc: Move 1T segment and AMR options to PPCHash64Options · 58969eee
      David Gibson 提交于
      Currently env->mmu_model is a bit of an unholy mess of an enum of distinct
      MMU types, with various flag bits as well.  This makes which bits of the
      field should be compared pretty confusing.
      
      Make a start on cleaning that up by moving two of the flags bits -
      POWERPC_MMU_1TSEG and POWERPC_MMU_AMR - which are specific to the 64-bit
      hash MMU into a new flags field in PPCHash64Options structure.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      58969eee
    • D
      target/ppc: Make hash64_opts field mandatory for 64-bit hash MMUs · 21e405f1
      David Gibson 提交于
      Currently some cpus set the hash64_opts field in the class structure, with
      specific details of their variant of the 64-bit hash mmu.  For the
      remaining cpus with that mmu, ppc_hash64_realize() fills in defaults.
      
      But there are only a couple of cpus that use those fallbacks, so just have
      them to set the has64_opts field instead, simplifying the logic.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      21e405f1
    • D
      target/ppc: Split page size information into a separate allocation · b07c59f7
      David Gibson 提交于
      env->sps contains page size encoding information as an embedded structure.
      Since this information is specific to 64-bit hash MMUs, split it out into
      a separately allocated structure, to reduce the basic env size for other
      cpus.  Along the way we make a few other cleanups:
      
          * Rename to PPCHash64Options which is more in line with qemu name
            conventions, and reflects that we're going to merge some more hash64
            mmu specific details in there in future.  Also rename its
            substructures to match qemu conventions.
      
          * Move structure definitions to the mmu-hash64.[ch] files.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      b07c59f7
    • D
      target/ppc: Move page size setup to helper function · a059471d
      David Gibson 提交于
      Initialization of the env->sps structure at the end of instance_init is
      specific to the 64-bit hash MMU, so move the code into a helper function
      in mmu-hash64.c.
      
      We also create a corresponding function to be called at finalize time -
      it's empty for now, but we'll need it shortly.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      a059471d
    • D
      target/ppc: Remove fallback 64k pagesize information · dc71b559
      David Gibson 提交于
      CPU definitions for cpus with the 64-bit hash MMU can include a table of
      available pagesizes.  If this isn't supplied ppc_cpu_instance_init() will
      fill it in a fallback table based on the POWERPC_MMU_64K bit in mmu_model.
      
      However, it turns out all the cpus which support 64K pages already include
      an explicit table of page sizes, so there's no point to the fallback table
      including 64k pages.
      
      That removes the only place which tests POWERPC_MMU_64K, so we can remove
      it.  Which in turn allows some logic to be removed from
      kvm_fixup_page_sizes().
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      dc71b559
    • D
      target/ppc: Avoid taking "env" parameter to mmu-hash64 functions · 8fe08fac
      David Gibson 提交于
      In most cases we prefer to pass a PowerPCCPU rather than the (embedded)
      CPUPPCState.
      
      For ppc_hash64_update_{rmls,vrma}() change to take "cpu" instead of "env".
      For ppc_hash64_set_{dsi,isi}() remove the redundant "env" parameter.
      
      In theory this makes more work for the functions, but since "cs", "cpu"
      and "env" are related by at most constant offsets, the compiler should be
      able to optimize out the difference at effectively zero cost.
      
      helper_*() functions are left alone - since they're more closely tied to
      the TCG generated code, passing "env" is still the standard there.
      
      While we're there, fix an incorrect indentation.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      8fe08fac