1. 07 1月, 2019 4 次提交
  2. 20 12月, 2018 1 次提交
    • P
      intel_iommu: dma read/write draining support · ccc23bb0
      Peter Xu 提交于
      Support DMA read/write draining should be easy for existing VT-d
      emulation since the emulation itself does not have any request queue
      there so we don't need to do anything to flush the un-commited queue.
      What we need to do is to declare the support.
      
      These capabilities are required to pass Windows SVVP test program.  It
      is verified that when with parameters "x-aw-bits=48,caching-mode=off"
      we can pass the Windows SVVP test with this patch applied.  Otherwise
      we'll fail with:
      
              IOMMU[0] - DWD (DMA write draining) not supported
              IOMMU[0] - DWD (DMA read draining) not supported
              Segment 0 has no DMA remapping capable IOMMU units
      
      However since these bits are not declared support for QEMU<=3.1, we'll
      need a compatibility bit for it and we turn this on by default only
      for QEMU>=4.0.
      
      Please refer to VT-d spec 6.5.4 for more information.
      
      CC: Yu Wang <wyu@redhat.com>
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1654550Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ccc23bb0
  3. 12 12月, 2018 2 次提交
  4. 31 10月, 2018 1 次提交
  5. 19 10月, 2018 1 次提交
    • R
      hyperv: only add SynIC in compatible configurations · 9b4cf107
      Roman Kagan 提交于
      Certain configurations do not allow SynIC to be used in QEMU.  In
      particular,
      
      - when hyperv_vpindex is off, SINT routes can't be used as they refer to
        the destination vCPU by vp_index
      
      - older KVM (which doesn't expose KVM_CAP_HYPERV_SYNIC2) zeroes out
        SynIC message and event pages on every msr load, breaking migration
      
      OTOH in-KVM users of SynIC -- SynIC timers -- do work in those
      configurations, and we shouldn't stop the guest from using them.
      
      To cover both scenarios, introduce an X86CPU property that makes CPU
      init code to skip creation of the SynIC object (and thus disables any
      SynIC use in QEMU) but keeps the KVM part of the SynIC working.
      The property is clear by default but is set via compat logic for older
      machine types.
      
      As a result, when hv_synic and a modern machine type are specified, QEMU
      will refuse to run unless vp_index is on and the kernel is recent
      enough.  OTOH with an older machine type QEMU will run fine with
      hv_synic=on against an older kernel and/or without vp_index enabled but
      will disallow the in-QEMU uses of SynIC (in e.g. VMBus).
      Signed-off-by: NRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20180921082217.29481-4-rkagan@virtuozzo.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9b4cf107
  6. 30 7月, 2018 1 次提交
  7. 10 7月, 2018 1 次提交
  8. 29 6月, 2018 1 次提交
  9. 23 6月, 2018 1 次提交
  10. 12 6月, 2018 1 次提交
  11. 02 6月, 2018 1 次提交
  12. 15 5月, 2018 2 次提交
  13. 11 5月, 2018 1 次提交
  14. 07 5月, 2018 2 次提交
  15. 17 3月, 2018 1 次提交
  16. 12 3月, 2018 3 次提交
  17. 18 1月, 2018 2 次提交
  18. 18 12月, 2017 5 次提交
  19. 16 11月, 2017 1 次提交
  20. 19 9月, 2017 1 次提交
  21. 08 9月, 2017 1 次提交
  22. 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
  23. 04 7月, 2017 1 次提交
    • T
      Move CONFIG_KVM related definitions to kvm_i386.h · 2099935d
      Thomas Huth 提交于
      pc.h and sysemu/kvm.h are also included from common code (where
      CONFIG_KVM is not available), so the #defines that depend on CONFIG_KVM
      should not be declared here to avoid that anybody is using them in a
      wrong way. Since we're also going to poison CONFIG_KVM for common code,
      let's move them to kvm_i386.h instead. Most of the dummy definitions
      from sysemu/kvm.h are also unused since the code that uses them is
      only compiled for CONFIG_KVM (e.g. target/i386/kvm.c), so the unused
      defines are also simply dropped here instead of being moved.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <1498454578-18709-3-git-send-email-thuth@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2099935d
  24. 16 6月, 2017 1 次提交
    • L
      q35/mch: implement extended TSEG sizes · 2f295167
      Laszlo Ersek 提交于
      The q35 machine type currently lets the guest firmware select a 1MB, 2MB
      or 8MB TSEG (basically, SMRAM) size. In edk2/OVMF, we use 8MB, but even
      that is not enough when a lot of VCPUs (more than approx. 224) are
      configured -- SMRAM footprint scales largely proportionally with VCPU
      count.
      
      Introduce a new property for "mch" called "extended-tseg-mbytes", which
      expresses (in megabytes) the user's choice of TSEG (SMRAM) size.
      
      Invent a new, QEMU-specific register in the config space of the DRAM
      Controller, at offset 0x50, in order to allow guest firmware to query the
      TSEG (SMRAM) size.
      
      According to Intel Document Number 316966-002, Table 5-1 "DRAM Controller
      Register Address Map (D0:F0)":
      
          Warning: Address locations that are not listed are considered Intel
                   Reserved registers locations. Reads to Reserved registers may
                   return non-zero values. Writes to reserved locations may
                   cause system failures.
      
                   All registers that are defined in the PCI 2.3 specification,
                   but are not necessary or implemented in this component are
                   simply not included in this document. The
                   reserved/unimplemented space in the PCI configuration header
                   space is not documented as such in this summary.
      
      Offsets 0x50 and 0x51 are not listed in Table 5-1. They are also not part
      of the standard PCI config space header. And they precede the capability
      list as well, which starts at 0xe0 for this device.
      
      When the guest writes value 0xffff to this register, the value that can be
      read back is that of "mch.extended-tseg-mbytes" -- unless it remains
      0xffff. The guest is required to write 0xffff first (as opposed to a
      read-only register) because PCI config space is generally not cleared on
      QEMU reset, and after S3 resume or reboot, new guest firmware running on
      old QEMU could read a guest OS-injected value from this register.
      
      After reading the available "extended" TSEG size, the guest firmware may
      actually request that TSEG size by writing pattern 11b to the ESMRAMC
      register's TSEG_SZ bit-field. (The Intel spec referenced above defines
      only patterns 00b (1MB), 01b (2MB) and 10b (8MB); 11b is reserved.)
      
      On the QEMU command line, the value can be set with
      
        -global mch.extended-tseg-mbytes=N
      
      The default value for 2.10+ q35 machine types is 16. The value is limited
      to 0xfff (4095) at the moment, purely so that the product (4095 MB) can be
      stored to the uint32_t variable "tseg_size" in mch_update_smram(). Users
      are responsible for choosing sensible TSEG sizes.
      
      On 2.9 and earlier q35 machine types, the default value is 0. This lets
      the 11b bit pattern in ESMRAMC.TSEG_SZ, and the register at offset 0x50,
      keep their original behavior.
      
      When "extended-tseg-mbytes" is nonzero, the new register at offset 0x50 is
      set to that value on reset, for completeness.
      
      PCI config space is migrated automatically, so no VMSD changes are
      necessary.
      
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1447027
      Ref: https://lists.01.org/pipermail/edk2-devel/2017-May/010456.htmlSigned-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      2f295167
  25. 06 6月, 2017 1 次提交
    • E
      pc: Use "min-[x]level" on compat_props · 1f435716
      Eduardo Habkost 提交于
      Since the automatic cpuid-level code was introduced in commit
      c39c0edf ("target-i386: Automatically
      set level/xlevel/xlevel2 when needed"), the CPU model tables just define
      the default CPUID level code (set using "min-level").  Setting
      "[x]level" forces CPUID level to a specific value and disable the
      automatic-level logic.
      
      But the PC compat code was not updated and the existing "[x]level"
      compat properties broke compatibility for people using features that
      triggered the auto-level code.  To keep previous behavior, we should set
      "min-[x]level" instead of "[x]level" on compat_props.
      
      This was not a problem for most cases, because old machine-types don't
      have full-cpuid-auto-level enabled.  The only common use case it broke
      was the CPUID[7] auto-level code, that was already enabled since the
      first CPUID[7] feature was introduced (in QEMU 1.4.0).
      
      This causes the regression reported at:
      https://bugzilla.redhat.com/show_bug.cgi?id=1454641
      
      Change the PC compat code to use "min-[x]level" instead of "[x]level" on
      compat_props, and add new test cases to ensure we don't break this
      again.
      Reported-by: N"Guo, Zhiyi" <zhguo@redhat.com>
      Fixes: c39c0edf ("target-i386: Automatically set level/xlevel/xlevel2 when needed")
      Cc: qemu-stable@nongnu.org
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      1f435716
  26. 11 5月, 2017 2 次提交