1. 18 1月, 2018 2 次提交
  2. 16 1月, 2018 1 次提交
  3. 22 12月, 2017 2 次提交
    • P
      6701d81d
    • S
      i386: hvf: add code base from Google's QEMU repository · c97d6d2c
      Sergio Andres Gomez Del Real 提交于
      This file begins tracking the files that will be the code base for HVF
      support in QEMU. This code base is part of Google's QEMU version of
      their Android emulator, and can be found at
      https://android.googlesource.com/platform/external/qemu/+/emu-master-dev
      
      This code is based on Veertu Inc's vdhh (Veertu Desktop Hosted
      Hypervisor), found at https://github.com/veertuinc/vdhh. Everything is
      appropriately licensed under GPL v2-or-later, except for the code inside
      x86_task.c and x86_task.h, which, deriving from KVM (the Linux kernel),
      is licensed GPL v2-only.
      
      This code base already implements a very great deal of functionality,
      although Google's version removed from Vertuu's the support for APIC
      page and hyperv-related stuff. According to the Android Emulator Release
      Notes, Revision 26.1.3 (August 2017), "Hypervisor.framework is now
      enabled by default on macOS for 32-bit x86 images to improve performance
      and macOS compatibility", although we better use with caution for, as the
      same Revision warns us, "If you experience issues with it specifically,
      please file a bug report...". The code hasn't seen much update in the
      last 5 months, so I think that we can further develop the code with
      occasional visiting Google's repository to see if there has been any
      update.
      
      On top of Google's code, the following changes were made:
      
      - add code to the configure script to support the --enable-hvf argument.
      If the OS is Darwin, it checks for presence of HVF in the system. The
      patch also adds strings related to HVF in the file qemu-options.hx.
      QEMU will only support the modern syntax style '-M accel=hvf' no enable
      hvf; the legacy '-enable-hvf' will not be supported.
      
      - fix styling issues
      
      - add glue code to cpus.c
      
      - move HVFX86EmulatorState field to CPUX86State, changing the
      the emulation functions to have a parameter with signature 'CPUX86State *'
      instead of 'CPUState *' so we don't have to get the 'env'.
      Signed-off-by: NSergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>
      Message-Id: <20170913090522.4022-2-Sergio.G.DelReal@gmail.com>
      Message-Id: <20170913090522.4022-3-Sergio.G.DelReal@gmail.com>
      Message-Id: <20170913090522.4022-5-Sergio.G.DelReal@gmail.com>
      Message-Id: <20170913090522.4022-6-Sergio.G.DelReal@gmail.com>
      Message-Id: <20170905035457.3753-7-Sergio.G.DelReal@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c97d6d2c
  4. 21 12月, 2017 3 次提交
  5. 19 9月, 2017 3 次提交
    • R
      hyperv: add header with protocol definitions · 5e953812
      Roman Kagan 提交于
      The definitions for Hyper-V emulation are currently taken from a header
      imported from the Linux kernel.
      
      However, as these describe a third-party protocol rather than a kernel
      API, it probably wasn't a good idea to publish it in the kernel uapi.
      
      This patch introduces a header that provides all the necessary
      definitions, superseding the one coming from the kernel.
      
      The new header supports (temporary) coexistence with the kernel one.
      The constants explicitly named in the Hyper-V specification (e.g. msr
      numbers) are defined in a non-conflicting way.  Other constants and
      types have got new names.
      
      While at this, the protocol data structures are defined in a more
      conventional way, without bitfields, enums, and excessive unions.
      
      The code using this stuff is adjusted, too; it can now be built both
      with and without the kernel header in the tree.
      Signed-off-by: NRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20170713201522.13765-2-rkagan@virtuozzo.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5e953812
    • G
      i386/cpu/hyperv: support over 64 vcpus for windows guests · 6c69dfb6
      Gonglei 提交于
      Starting with Windows Server 2012 and Windows 8, if
      CPUID.40000005.EAX contains a value of -1, Windows assumes specific
      limit to the number of VPs. In this case, Windows Server 2012
      guest VMs may use more than 64 VPs, up to the maximum supported
      number of processors applicable to the specific Windows
      version being used.
      
      https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
      
      For compatibility, Let's introduce a new property for X86CPU,
      named "x-hv-max-vps" as Eduardo's suggestion, and set it
      to 0x40 before machine 2.10.
      
      (The "x-" prefix indicates that the property is not supposed to
      be a stable user interface.)
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1505143227-14324-1-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6c69dfb6
    • I
      pc: use generic cpu_model parsing · 311ca98d
      Igor Mammedov 提交于
      define default CPU type in generic way in pc_machine_class_init()
      and let common machine code to handle cpu_model parsing
      
      Patch also introduces TARGET_DEFAULT_CPU_TYPE define for 2 purposes:
        * make foo_machine_class_init() look uniform on every target
        * use define in [bsd|linux]-user targets to pick default
          cpu type
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <1505318697-77161-5-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      311ca98d
  6. 01 9月, 2017 1 次提交
  7. 18 7月, 2017 1 次提交
    • D
      i386: expose "TCGTCGTCGTCG" in the 0x40000000 CPUID leaf · 1ce36bfe
      Daniel P. Berrange 提交于
      Currently when running KVM, we expose "KVMKVMKVM\0\0\0" in
      the 0x40000000 CPUID leaf. Other hypervisors (VMWare,
      HyperV, Xen, BHyve) all do the same thing, which leaves
      TCG as the odd one out.
      
      The CPUID signature is used by software to detect which
      virtual environment they are running in and (potentially)
      change behaviour in certain ways. For example, systemd
      supports a ConditionVirtualization= setting in unit files.
      The virt-what command can also report the virt type it is
      running on
      
      Currently both these apps have to resort to custom hacks
      like looking for 'fw-cfg' entry in the /proc/device-tree
      file to identify TCG.
      
      This change thus proposes a signature "TCGTCGTCGTCG" to be
      reported when running under TCG.
      
      To hide this, the -cpu option tcg-cpuid=off can be used.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170509132736.10071-3-berrange@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      1ce36bfe
  8. 05 7月, 2017 3 次提交
  9. 04 7月, 2017 1 次提交
  10. 08 6月, 2017 2 次提交
  11. 06 6月, 2017 1 次提交
  12. 29 3月, 2017 1 次提交
    • E
      i386: Don't override -cpu options on -cpu host/max · d4a606b3
      Eduardo Habkost 提交于
      The existing code for "host" and "max" CPU models overrides every
      single feature in the CPU object at realize time, even the ones
      that were explicitly enabled or disabled by the user using
      "feat=on" or "feat=off", while features set using +feat/-feat are
      kept.
      
      This means "-cpu host,+invtsc" works as expected, while
      "-cpu host,invtsc=on" doesn't.
      
      This was a known bug, already documented in a comment inside
      x86_cpu_expand_features(). What makes this bug worse now is that
      libvirt 3.0.0 and newer now use "feat=on|off" instead of
      +feat/-feat when it detects a QEMU version that supports it (see
      libvirt commit d47db7b16dd5422c7e487c8c8ee5b181a2f9cd66).
      
      Change the feature property getter/setter to set a
      env->user_features field, to keep track of features that were
      explicitly changed using QOM properties. Then make the
      max_features code not override user features when handling "-cpu
      host" and "-cpu max".
      
      This will also allow us to remove the plus_features/minus_features
      hack in the future, but I plan to do that after 2.9.0 is
      released.
      Reported-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170327144815.8043-3-ehabkost@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Tested-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d4a606b3
  13. 11 3月, 2017 1 次提交
  14. 09 3月, 2017 2 次提交
  15. 03 3月, 2017 1 次提交
    • D
      x86: Work around SMI migration breakages · fc3a1fd7
      Dr. David Alan Gilbert 提交于
      Migration from a 2.3.0 qemu results in a reboot on the receiving QEMU
      due to a disagreement about SM (System management) interrupts.
      
      2.3.0 didn't have much SMI support, but it did set CPU_INTERRUPT_SMI
      and this gets into the migration stream, but on 2.3.0 it
      never got delivered.
      
      ~2.4.0 SMI interrupt support was added but was broken - so
      that when a 2.3.0 stream was received it cleared the CPU_INTERRUPT_SMI
      but never actually caused an interrupt.
      
      The SMI delivery was recently fixed by 68c6efe0, but the
      effect now is that an incoming 2.3.0 stream takes the interrupt it
      had flagged but it's bios can't actually handle it(I think
      partly due to the original interrupt not being taken during boot?).
      The consequence is a triple(?) fault and a reboot.
      
      Tested from:
        2.3.1 -M 2.3.0
        2.7.0 -M 2.3.0
        2.8.0 -M 2.3.0
        2.8.0 -M 2.8.0
      
      This corresponds to RH bugzilla entry 1420679.
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20170223133441.16010-1-dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fc3a1fd7
  16. 28 2月, 2017 2 次提交
  17. 17 2月, 2017 1 次提交
  18. 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
  19. 24 1月, 2017 1 次提交
  20. 13 1月, 2017 1 次提交
    • A
      qom/cpu: move tlb_flush to cpu_common_reset · 1f5c00cf
      Alex Bennée 提交于
      It is a common thing amongst the various cpu reset functions want to
      flush the SoftMMU's TLB entries. This is done either by calling
      tlb_flush directly or by way of a general memset of the CPU
      structure (sometimes both).
      
      This moves the tlb_flush call to the common reset function and
      additionally ensures it is only done for the CONFIG_SOFTMMU case and
      when tcg is enabled.
      
      In some target cases we add an empty end_of_reset_fields structure to the
      target vCPU structure so have a clear end point for any memset which
      is resetting value in the structure before CPU_COMMON (where the TLB
      structures are).
      
      While this is a nice clean-up in general it is also a precursor for
      changes coming to cputlb for MTTCG where the clearing of entries
      can't be done arbitrarily across vCPUs. Currently the cpu_reset
      function is usually called from the context of another vCPU as the
      architectural power up sequence is run. By using the cputlb API
      functions we can ensure the right behaviour in the future.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      1f5c00cf
  21. 11 1月, 2017 1 次提交
  22. 22 12月, 2016 2 次提交
  23. 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
  24. 02 11月, 2016 1 次提交
  25. 25 10月, 2016 1 次提交
  26. 07 10月, 2016 1 次提交
  27. 28 9月, 2016 2 次提交