1. 27 1月, 2013 2 次提交
    • E
      pc: Reverse pc_init_pci() compatibility logic · 29694758
      Eduardo Habkost 提交于
      Currently, the pc-1.4 machine init function enables PV EOI and then
      calls the pc-1.2 machine init function. The problem with this approach
      is that now we can't enable any additional compatibility code inside the
      pc-1.2 init function because it would end up enabling the compatibility
      behavior on pc-1.3 and pc-1.4 as well.
      
      This reverses the logic so that the pc-1.2 machine init function will
      disable PV EOI, and then call the pc-1.4 machine init function.
      
      This way we can change older machine-types to enable compatibility
      behavior, and the newer machine-types (pc-1.3, pc-q35-1.4 and
      pc-i440fx-1.4) would just use the default behavior.
      
      (This means that one nice side-effect of this change is that pc-q35-1.4
      will get PV EOI enabled by default, too)
      
      It would be interesting to eventually change pc_init_pci_no_kvmclock()
      and pc_init_isa() to reuse pc_init_pci_1_2() as well (so we don't need
      to duplicate compatibility code on those two functions). But this will
      be probably much easier to do after we create a PCInitArgs struct for
      the PC initialization arguments, and/or after we use global-properties
      to implement the compatibility modes present in pc_init_pci_1_2().
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      29694758
    • E
      target-i386: Don't set any KVM flag by default if KVM is disabled · aa87d458
      Eduardo Habkost 提交于
      This is a cleanup that tries to solve two small issues:
      
       - We don't need a separate kvm_pv_eoi_features variable just to keep a
         constant calculated at compile-time, and this style would require
         adding a separate variable (that's declared twice because of the
         CONFIG_KVM ifdef) for each feature that's going to be
         enabled/disabled by machine-type compat code.
       - The pc-1.3 code is setting the kvm_pv_eoi flag on cpuid_kvm_features
         even when KVM is disabled at runtime. This small inconsistency in
         the cpuid_kvm_features field isn't a problem today because
         cpuid_kvm_features is ignored by the TCG code, but it may cause
         unexpected problems later when refactoring the CPUID handling code.
      
      This patch eliminates the kvm_pv_eoi_features variable and simply uses
      kvm_enabled() inside the enable_kvm_pv_eoi() compat function, so it
      enables kvm_pv_eoi only if KVM is enabled. I believe this makes the
      behavior of enable_kvm_pv_eoi() clearer and easier to understand.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Acked-by: NGleb Natapov <gleb@redhat.com>
      Reviewed-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      aa87d458
  2. 22 1月, 2013 1 次提交
  3. 15 1月, 2013 10 次提交
  4. 09 1月, 2013 10 次提交
  5. 23 12月, 2012 1 次提交
    • E
      target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevel · 57f26ae7
      Eduardo Habkost 提交于
      This fixes a subtle bug. A bug that probably won't cause trouble for any
      existing OS, but a bug anyway:
      
      Intel SDM Volume 2, CPUID Instruction states:
      
      > Two types of information are returned: basic and extended function
      > information. If a value entered for CPUID.EAX is higher than the maximum
      > input value for basic or extended function for that processor then the
      > data for the highest basic information leaf is returned. For example,
      > using the Intel Core i7 processor, the following is true:
      >
      >   CPUID.EAX = 05H (* Returns MONITOR/MWAIT leaf. *)
      >   CPUID.EAX = 0AH (* Returns Architectural Performance Monitoring leaf. *)
      >   CPUID.EAX = 0BH (* Returns Extended Topology Enumeration leaf. *)
      >   CPUID.EAX = 0CH (* INVALID: Returns the same information as CPUID.EAX = 0BH. *)
      >   CPUID.EAX = 80000008H (* Returns linear/physical address size data. *)
      >   CPUID.EAX = 8000000AH (* INVALID: Returns same information as CPUID.EAX = 0BH. *)
      
      AMD's CPUID Specification, on the other hand, is less specific:
      
      > The CPUID instruction supports two sets or ranges of functions,
      > standard and extended.
      >
      > • The smallest function number of the standard function range is
      >   Fn0000_0000. The largest function num- ber of the standard function
      >   range, for a particular implementation, is returned in CPUID
      >   Fn0000_0000_EAX.
      >
      > • The smallest function number of the extended function range is
      >   Fn8000_0000. The largest function num- ber of the extended function
      >   range, for a particular implementation, is returned in CPUID
      >   Fn8000_0000_EAX.
      >
      > Functions that are neither standard nor extended are undefined and
      > should not be relied upon.
      
      QEMU's behavior matched Intel's specification before, but this was
      changed by commit b3baa152. This patch
      restores the behavior documented by Intel when cpuid_xlevel2 is 0.
      
      The existing behavior when cpuid_xlevel2 is set (falling back to
      level=cpuid_xlevel) is being kept, as I couldn't find any public
      documentation on the CPUID 0xC0000000 function range on Centaur CPUs.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      57f26ae7
  6. 19 12月, 2012 5 次提交
  7. 08 12月, 2012 1 次提交
  8. 06 12月, 2012 3 次提交
  9. 27 11月, 2012 2 次提交
  10. 26 11月, 2012 1 次提交
  11. 15 11月, 2012 3 次提交
  12. 03 11月, 2012 1 次提交