1. 16 9月, 2016 5 次提交
    • R
      tcg: Support arbitrary size + alignment · 85aa8081
      Richard Henderson 提交于
      Previously we allowed fully unaligned operations, but not operations
      that are aligned but with less alignment than the operation size.
      
      In addition, arm32, ia64, mips, and sparc had been omitted from the
      previous overalignment patch, which would have led to that alignment
      being enforced.
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      85aa8081
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-20160915.0' into staging · ebc231d7
      Peter Maydell 提交于
      VFIO fixes 2016-09-15
      
      Fix a 2.7.0 regression affecting POWER8 systems in relation to EEH,
      possibly extending to subtle changes for other devices and archs.
      (David Gibson)
      
      # gpg: Signature made Thu 15 Sep 2016 18:31:42 BST
      # gpg:                using RSA key 0x239B9B6E3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
      # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
      
      * remotes/awilliam/tags/vfio-fixes-20160915.0:
        vfio/pci: Fix regression in MSI routing configuration
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ebc231d7
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 5f473241
      Peter Maydell 提交于
      * Support multiple -d trace:PATTERN arguments (Daniel)
      * SCSI cleanups/fixes for removable meia (Fam)
      * SCSI security fixes (Li Qiang, PJP)
      * qemu-char segfault fix (Lin Ma)
      * "make help" and qemu-socket cleanups (Marc-André)
      * end of the buffer_is_zero reword (Richard)
      * Fix target-i386 syscall segfault (Stanislav)
      * split irqchip fix/robustification (Wanpeng)
      * misc cleanups (me, Jiangang)
      * x86 vmstate fixes (Pavel)
      
      # gpg: Signature made Thu 15 Sep 2016 14:11:35 BST
      # gpg:                using RSA key 0xBFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream:
        pcspk: adding vmstate for save/restore
        kvmvapic: fix state change handler
        pc: apic: introduce APIC macro
        target-i386: Fixed syscall posssible segfault
        log: fix parsing of multiple trace:PATTERN log args
        qemu-char: avoid segfault if user lacks of permisson of a given logfile
        build-sys: add make 'help' target
        linux-user: complete omission of removing uses of strdup
        target-i386: fix ordering of fields in CPUX86State
        pc: apic: fix touch LAPIC when irqchip is split
        scsi: pvscsi: limit process IO loop to ring size
        memory: remove memory_region_destructor_rom_device
        Change net/socket.c to use socket_*() functions
        cutils: Rewrite x86 buffer zero checking
        scsi: mptsas: use g_new0 to allocate MPTSASRequest object
        virtio-scsi: Don't abort when media is ejected
        scsi-disk: Cleaning up around tray open state
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5f473241
    • D
      vfio/pci: Fix regression in MSI routing configuration · 6d17a018
      David Gibson 提交于
      d1f6af6a "kvm-irqchip: simplify kvm_irqchip_add_msi_route" was a cleanup
      of kvmchip routing configuration, that was mostly intended for x86.
      However, it also contains a subtle change in behaviour which breaks EEH[1]
      error recovery on certain VFIO passthrough devices on spapr guests.  So far
      it's only been seen on a BCM5719 NIC on a POWER8 server, but there may be
      other hardware with the same problem.  It's also possible there could be
      circumstances where it causes a bug on x86 as well, though I don't know of
      any obvious candidates.
      
      Prior to d1f6af6a, both vfio_msix_vector_do_use() and
      vfio_add_kvm_msi_virq() used msg == NULL as a special flag to mark this
      as the "dummy" vector used to make the host hardware state sync with the
      guest expected hardware state in terms of MSI configuration.
      
      Specifically that flag caused vfio_add_kvm_msi_virq() to become a no-op,
      meaning the dummy irq would always be delivered via qemu. d1f6af6a changed
      vfio_add_kvm_msi_virq() so it takes a vector number instead of the msg
      parameter, and determines the correct message itself.  The test for !msg
      was removed, and not replaced with anything there or in the caller.
      
      With an spapr guest which has a VFIO device, if an EEH error occurs on the
      host hardware, then the device will be isolated then reset.  This is a
      combination of host and guest action, mediated by some EEH related
      hypercalls.  I haven't fully traced the mechanics, but somehow installing
      the kvm irqchip route for the dummy irq on the BCM5719 means that after EEH
      reset and recovery, at least some irqs are no longer delivered to the
      guest.
      
      In particular, the guest never gets the link up event, and so the NIC is
      effectively dead.
      
      [1] EEH (Enhanced Error Handling) is an IBM POWER server specific PCI-*
          error reporting and recovery mechanism.  The concept is somewhat
          similar to PCI-E AER, but the details are different.
      
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1373802
      
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Peter Xu <peterx@redhat.com>
      Cc: Gavin Shan <gwshan@au1.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Cc: qemu-stable@nongnu.org
      Fixes: d1f6af6a ("kvm-irqchip: simplify kvm_irqchip_add_msi_route")
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      6d17a018
    • P
      Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging · 518352b6
      Peter Maydell 提交于
      trivial patches for 2016-09-15
      
      # gpg: Signature made Thu 15 Sep 2016 13:40:55 BST
      # gpg:                using RSA key 0x701B4F6B1A693E59
      # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@debian.org>"
      # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
      #      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59
      
      * remotes/mjt/tags/trivial-patches-fetch: (21 commits)
        mptsas: change .realize function name
        linux-user/qemu.h: change malloc to g_malloc, free to g_free
        win32: don't run subprocess tests on Mingw32 platform
        sheepdog: remove useless casts
        fw_cfg: remove useless casts
        tricore: remove useless cast
        s390x: remove useless cast
        linux-user,s390x: remove useless cast
        coccinelle: add a script to remove useless casts
        curl: Operate on zero-length file
        Remove unused function declarations
        ivshmem: Delete duplicate debug message
        sh4: fix broken link to documentation
        MAINTAINERS: Fix up F: entry bit rot
        MAINTAINERS: Add include/sysemu/cpus.h
        MAINTAINERS: Add include/hw/sh4/ to SH4 section
        MAINTAINERS: Add include/hw/tricore/ to TriCore section
        MAINTAINERS: Add include/hw/unicore32/ to UniCore32 section
        ui/console: Fix non-working backspace key in monitor of gtk UI
        tcg: Remove duplicate header includes
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      518352b6
  2. 15 9月, 2016 32 次提交
  3. 14 9月, 2016 3 次提交
    • W
      linux-user: complete omission of removing uses of strdup · b8da57fa
      Wei Jiangang 提交于
      The 900cfbca just removed two unchecked uses of strdup
      in fill_psinfo and missed the rest in core_dump_filename.
      This patch fixes it.
      Signed-off-by: NWei Jiangang <weijg.fnst@cn.fujitsu.com>
      Message-Id: <1459997185-15669-2-git-send-email-weijg.fnst@cn.fujitsu.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b8da57fa
    • P
      target-i386: fix ordering of fields in CPUX86State · 7616f1c2
      Paolo Bonzini 提交于
      Make sure reset zeroes TSC_AUX, XCR0, PKRU.  Move XSTATE_BV from the
      "vmstate only" section to the "KVM only" section.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7616f1c2
    • W
      pc: apic: fix touch LAPIC when irqchip is split · bb93e099
      Wanpeng Li 提交于
      Add -kernel_irqchip=split
      ./x86-run x86/eventinj.flat
      
      qemu-system-x86_64 -enable-kvm -machine kernel_irqchip=split -cpu host
      -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc
      none -serial stdio -device pci-testdev -kernel x86/eventinj.flat
      enabling apic
      paging enabled
      cr0 = 80010011
      cr3 = 7fff000
      cr4 = 20
      Sending vec 33 and 62 and mask one with TPR
      irq1 running
      irq1 running
      After 33/62 TPR test
      FAIL: TPR
      irq0 running
      irq0 running
      
      Both irq1 and irq0 are executing twice.
      
      kvm_entry: vcpu 0
      kvm_exit: reason MSR_WRITE rip 0x401f33 info 0 0
      kvm_apic: apic_write APIC_EOI = 0x0
      kvm_eoi: apicid 0 vector 62
      kvm_msr: msr_write 80b = 0x0
      kvm_entry: vcpu 0
      kvm_exit: reason PENDING_INTERRUPT rip 0x401f35 info 0 0
      kvm_userspace_exit: reason KVM_EXIT_IRQ_WINDOW_OPEN (7)
      kvm_inj_virq: irq 62
      kvm_entry: vcpu 0
      kvm_exit: reason IO_INSTRUCTION rip 0x4016ec info 3fd0008 0
      
      From the trace we can see there is an interrupt window exit
      after the first interrupt EOI(irq 62), and the same irq(62)
      is injected duplicately after the interrupt window.
      
      QEMU does KVM_INTERRUPT(62) ioctl after KVM exits with
      KVM_EXIT_IRQ_WINDOW_OPEN, which QEMU requested while the
      guest was printing.  The printing calls
      
      serial_update_irq() -> qemu_irq_lower() -> qemu_set_irq() ->
      gsi_handler() -> qemu_set_irq() -> pic_irq_request() ->
      apic_deliver_pic_intr() -> kvm_handle_interrupt()
      
      kvm_handle_interrupt() does
      
      	interrupt_request |= CPU_INTERRUPT_HARD
      
      which later calls cpu_get_pic_interrupt() in kvm_arch_pre_run(),
      but that function uses stale information from APIC and injects
      62 again. If we synchronized the APIC, then the test would #GP,
      because there would be no injectable interrupt in LAPIC or PIC,
      so pic_read_irq() would return 15, thinking it was spurious.
      
      This patch fix it by don't touch LAPIC if LAPIC is in kernel.
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Suggested-by: NRadim Krčmář <rkrcmar@redhat.com>
      Cc: qemu-stable@nongnu.org
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NWanpeng Li <wanpeng.li@hotmail.com>
      Message-Id: <1473832464-3478-1-git-send-email-wanpeng.li@hotmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      bb93e099