1. 19 9月, 2017 4 次提交
  2. 01 8月, 2017 1 次提交
  3. 13 7月, 2017 1 次提交
    • A
      Convert error_report() to warn_report() · 3dc6f869
      Alistair Francis 提交于
      Convert all uses of error_report("warning:"... to use warn_report()
      instead. This helps standardise on a single method of printing warnings
      to the user.
      
      All of the warnings were changed using these two commands:
          find ./* -type f -exec sed -i \
            's|error_report(".*warning[,:] |warn_report("|Ig' {} +
      
      Indentation fixed up manually afterwards.
      
      The test-qdev-global-props test case was manually updated to ensure that
      this patch passes make check (as the test cases are case sensitive).
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: NThomas Huth <thuth@redhat.com>
      Cc: Jeff Cody <jcody@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Lieven <pl@kamp.de>
      Cc: Josh Durgin <jdurgin@redhat.com>
      Cc: "Richard W.M. Jones" <rjones@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Greg Kurz <groug@kaod.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Peter Chubb <peter.chubb@nicta.com.au>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: NGreg Kurz <groug@kaod.org>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed by: Peter Chubb <peter.chubb@data61.csiro.au>
      Acked-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Message-Id: <e1cfa2cd47087c248dd24caca9c33d9af0c499b0.1499866456.git.alistair.francis@xilinx.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3dc6f869
  4. 04 7月, 2017 1 次提交
  5. 08 6月, 2017 2 次提交
    • G
      kvm: don't register smram_listener when smm is off · d870cfde
      Gonglei 提交于
      If the user set disable smm by '-machine smm=off', we
      should not register smram_listener so that we can
      avoid waster memory in kvm since the added sencond
      address space.
      
      Meanwhile we should assign value of the global kvm_state
      before invoking the kvm_arch_init(), because
      pc_machine_is_smm_enabled() may use it by kvm_has_mm().
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1496316915-121196-1-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d870cfde
    • R
      i386/kvm: do not zero out segment flags if segment is unusable or not present · d45fc087
      Roman Pen 提交于
      This is a fix for the problem [1], where VMCB.CPL was set to 0 and interrupt
      was taken on userspace stack.  The root cause lies in the specific AMD CPU
      behaviour which manifests itself as unusable segment attributes on SYSRET[2].
      
      Here in this patch flags are not touched even segment is unusable or is not
      present, therefore CPL (which is stored in DPL field) should not be lost and
      will be successfully restored on kvm/svm kernel side.
      
      Also current patch should not break desired behavior described in this commit:
      
      4cae9c97 ("target-i386: kvm: clear unusable segments' flags in migration")
      
      since present bit will be dropped if segment is unusable or is not present.
      
      This is the second part of the whole fix of the corresponding problem [1],
      first part is related to kvm/svm kernel side and does exactly the same:
      segment attributes are not zeroed out.
      
      [1] Message id: CAJrWOzD6Xq==b-zYCDdFLgSRMPM-NkNuTSDFEtX=7MreT45i7Q@mail.gmail.com
      [2] Message id: 5d120f358612d73fc909f5bfa47e7bd082db0af0.1429841474.git.luto@kernel.org
      Signed-off-by: NRoman Pen <roman.penyaev@profitbricks.com>
      Signed-off-by: NMikhail Sennikovskii <mikhail.sennikovskii@profitbricks.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Michael Chapman <mike@very.puzzling.org>
      Cc: qemu-devel@nongnu.org
      Message-Id: <20170601085604.12980-1-roman.penyaev@profitbricks.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d45fc087
  6. 07 6月, 2017 1 次提交
    • P
      kvm: irqchip: skip update msi when disabled · fd563564
      Peter Xu 提交于
      It's possible that one device kept its irqfd/virq there even when
      MSI/MSIX was disabled globally for that device. One example is
      virtio-net-pci (see commit f1d0f15a and virtio_pci_vq_vector_mask()).
      It is used as a fast path to avoid allocate/release irqfd/virq
      frequently when guest enables/disables MSIX.
      
      However, this fast path brought a problem to msi_route_list, that the
      device MSIRouteEntry is still dangling there even if MSIX disabled -
      then we cannot know which message to fetch, even if we can, the messages
      are meaningless. In this case, we can just simply ignore this entry.
      
      It's safe, since when MSIX is enabled again, we'll rebuild them no
      matter what.
      
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1448813Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <1494309644-18743-4-git-send-email-peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fd563564
  7. 23 5月, 2017 1 次提交
    • E
      shutdown: Add source information to SHUTDOWN and RESET · cf83f140
      Eric Blake 提交于
      Time to wire up all the call sites that request a shutdown or
      reset to use the enum added in the previous patch.
      
      It would have been less churn to keep the common case with no
      arguments as meaning guest-triggered, and only modified the
      host-triggered code paths, via a wrapper function, but then we'd
      still have to audit that I didn't miss any host-triggered spots;
      changing the signature forces us to double-check that I correctly
      categorized all callers.
      
      Since command line options can change whether a guest reset request
      causes an actual reset vs. a shutdown, it's easy to also add the
      information to reset requests.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts]
      Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part]
      Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x parts]
      Message-Id: <20170515214114.15442-5-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      cf83f140
  8. 17 5月, 2017 1 次提交
  9. 14 3月, 2017 1 次提交
  10. 11 3月, 2017 1 次提交
  11. 03 3月, 2017 5 次提交
  12. 28 1月, 2017 1 次提交
    • P
      x86-KVM: Supply TSC and APIC clock rates to guest like VMWare · 9954a158
      Phil Dennis-Jordan 提交于
      This fixes timekeeping of x86-64 Darwin/OS X/macOS guests when using KVM.
      
      Darwin/OS X/macOS for x86-64 uses the TSC for timekeeping; it normally calibrates this by querying various clock frequency scaling MSRs. Details depend on the exact CPU model detected. The local APIC timer frequency is extracted from (EFI) firmware.
      
      This is problematic in the presence of virtualisation, as the MSRs in question are typically not handled by the hypervisor. VMWare (Fusion) advertises TSC and APIC frequency via a custom 0x40000010 CPUID leaf, in the eax and ebx registers respectively. This is documented at https://lwn.net/Articles/301888/ among other places.
      
      Darwin/OS X/macOS looks for the generic 0x40000000 hypervisor leaf, and if this indicates via eax that leaf 0x40000010 might be available, that is in turn queried for the two frequencies.
      
      This adds a CPU option "vmware-cpuid-freq" to enable the same behaviour when running Qemu with KVM acceleration, if the KVM TSC frequency can be determined, and it is stable. (invtsc or user-specified) The virtualised APIC bus cycle is hardcoded to 1GHz in KVM, so ebx of the CPUID leaf is also hardcoded to this value.
      Signed-off-by: NPhil Dennis-Jordan <phil@philjordan.eu>
      Message-Id: <1484921496-11257-2-git-send-email-phil@philjordan.eu>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9954a158
  13. 25 1月, 2017 1 次提交
  14. 24 1月, 2017 2 次提交
  15. 20 1月, 2017 1 次提交
  16. 22 12月, 2016 1 次提交
  17. 21 12月, 2016 1 次提交
    • T
      Move target-* CPU file into a target/ folder · fcf5ef2a
      Thomas Huth 提交于
      We've currently got 18 architectures in QEMU, and thus 18 target-xxx
      folders in the root folder of the QEMU source tree. More architectures
      (e.g. RISC-V, AVR) are likely to be included soon, too, so the main
      folder of the QEMU sources slowly gets quite overcrowded with the
      target-xxx folders.
      To disburden the main folder a little bit, let's move the target-xxx
      folders into a dedicated target/ folder, so that target-xxx/ simply
      becomes target/xxx/ instead.
      
      Acked-by: Laurent Vivier <laurent@vivier.eu> [m68k part]
      Acked-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> [tricore part]
      Acked-by: Michael Walle <michael@walle.cc> [lm32 part]
      Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x part]
      Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> [s390x part]
      Acked-by: Eduardo Habkost <ehabkost@redhat.com> [i386 part]
      Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> [sparc part]
      Acked-by: Richard Henderson <rth@twiddle.net> [alpha part]
      Acked-by: Max Filippov <jcmvbkbc@gmail.com> [xtensa part]
      Reviewed-by: David Gibson <david@gibson.dropbear.id.au> [ppc part]
      Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> [cris&microblaze part]
      Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> [unicore32 part]
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      fcf5ef2a
  18. 09 11月, 2016 1 次提交
  19. 31 10月, 2016 1 次提交
  20. 25 10月, 2016 1 次提交
  21. 18 10月, 2016 2 次提交
    • R
      target-i386/kvm: cache the return value of kvm_enable_x2apic() · 2a138ec3
      Radim Krčmář 提交于
      Assume that KVM would have returned the same on subsequent runs.
      Abstract the memoizaiton pattern into macros and call it memorize as
      adding the r makes it less obscure.
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      2a138ec3
    • R
      intel_iommu: reject broken EIM · fb506e70
      Radim Krčmář 提交于
      Cluster x2APIC cannot work without KVM's x2apic API when the maximal
      APIC ID is greater than 8 and only KVM's LAPIC can support x2APIC, so we
      forbid other APICs and also the old KVM case with less than 9, to
      simplify the code.
      
      There is no point in enabling EIM in forbidden APICs, so we keep it
      enabled only for the KVM APIC;  unconditionally, because making the
      option depend on KVM version would be a maintanance burden.
      
      Old QEMUs would enable eim whenever intremap was on, which would trick
      guests into thinking that they can enable cluster x2APIC even if any
      interrupt destination would get clamped to 8 bits.
      Depending on your configuration, QEMU could notice that the destination
      LAPIC is not present and report it with a very non-obvious:
      
        KVM: injection failed, MSI lost (Operation not permitted)
      
      Or the guest could say something about unexpected interrupts, because
      clamping leads to aliasing so interrupts were being delivered to
      incorrect VCPUs.
      
      KVM_X2APIC_API is the feature that allows us to enable EIM for KVM.
      
      QEMU 2.7 allowed EIM whenever interrupt remapping was enabled.  In order
      to keep backward compatibility, we again allow guests to misbehave in
      non-obvious ways, and make it the default for old machine types.
      
      A user can enable the buggy mode it with "x-buggy-eim=on".
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      fb506e70
  22. 28 9月, 2016 4 次提交
  23. 27 9月, 2016 1 次提交
    • A
      cpus: pass CPUState to run_on_cpu helpers · e0eeb4a2
      Alex Bennée 提交于
      CPUState is a fairly common pointer to pass to these helpers. This means
      if you need other arguments for the async_run_on_cpu case you end up
      having to do a g_malloc to stuff additional data into the routine. For
      the current users this isn't a massive deal but for MTTCG this gets
      cumbersome when the only other parameter is often an address.
      
      This adds the typedef run_on_cpu_func for helper functions which has an
      explicit CPUState * passed as the first parameter. All the users of
      run_on_cpu and async_run_on_cpu have had their helpers updated to use
      CPUState where available.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      [Sergey Fedorov:
       - eliminate more CPUState in user data;
       - remove unnecessary user data passing;
       - fix target-s390x/kvm.c and target-s390x/misc_helper.c]
      Signed-off-by: NSergey Fedorov <sergey.fedorov@linaro.org>
      Acked-by: David Gibson <david@gibson.dropbear.id.au> (ppc parts)
      Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> (s390 parts)
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <1470158864-17651-3-git-send-email-alex.bennee@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e0eeb4a2
  24. 23 9月, 2016 1 次提交
  25. 22 9月, 2016 2 次提交
    • D
      kvm: apic: set APIC base as part of kvm_apic_put · f8d9ccf8
      Dr. David Alan Gilbert 提交于
      The parsing of KVM_SET_LAPIC's input depends on the current value of the
      APIC base MSR---which indeed is stored in APICCommonState---but for historical
      reasons APIC base is set through KVM_SET_SREGS together with cr8 (which is
      really just the APIC TPR) and the actual "special CPU registers".
      
      APIC base must now be set before the actual LAPIC registers, so do that
      in kvm_apic_put.  It will be set again to the same value with KVM_SET_SREGS,
      but that's not a big issue.
      
      This only happens since Linux 4.8, which checks for x2apic mode in
      KVM_SET_LAPIC.  However it's really a QEMU bug; until the recent
      commit 78d6a05d ("x86/lapic: Load LAPIC state at post_load", 2016-09-13)
      QEMU was indeed setting APIC base (via KVM_SET_SREGS) before the other
      LAPIC registers.
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f8d9ccf8
    • P
      target-i386: introduce kvm_put_one_msr · 73e1b8f2
      Paolo Bonzini 提交于
      Avoid further code duplication in the next patch.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      73e1b8f2
  26. 14 9月, 2016 1 次提交