Skip to content

Commits

Permalink
qom-cpu-types
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Jan 27, 2013

  1. target-unicore32: Don't use type_register_static()

    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    b8e2b8f View commit details
    Browse the repository at this point in the history
  2. target-openrisc: Don't use type_register_static()

    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    c0cf95c View commit details
    Browse the repository at this point in the history
  3. target-unicore32: Catch attempt to instantiate abstract type in cpu_i…

    …nit()
    
    Fixes -cpu unicore32-cpu asserting.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    5a6d7a6 View commit details
    Browse the repository at this point in the history
  4. target-openrisc: Catch attempt to instantiate abstract type in cpu_in…

    …it()
    
    Fixes -cpu openrisc-cpu asserting.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    d68eb63 View commit details
    Browse the repository at this point in the history
  5. target-m68k: Catch attempt to instantiate abstract type in cpu_init()

    This fixes -cpu m68k-cpu asserting.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    2fb8d79 View commit details
    Browse the repository at this point in the history
  6. target-arm: Catch attempt to instantiate abstract type in cpu_init()

    This fixes -cpu arm-cpu asserting.
    
    Cc: qemu-stable@nongnu.org
    Acked-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    644574d View commit details
    Browse the repository at this point in the history
  7. target-alpha: Catch attempt to instantiate abstract type in cpu_init()

    This fixes -cpu alpha-cpu asserting.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    7dde3d8 View commit details
    Browse the repository at this point in the history
  8. qom: Introduce object_class_is_abstract()

    This lets a caller check if an ObjectClass as returned by, e.g.,
    object_class_by_name() is instantiatable.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Cc: Anthony Liguori <anthony@codemonkey.ws>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    ffd4f3d View commit details
    Browse the repository at this point in the history
  9. target-unicore32: Detect attempt to instantiate non-CPU type in cpu_i…

    …nit()
    
    Consolidate model checking into a new uc32_cpu_class_by_name().
    
    If the name matches an existing type, also check whether that type is
    actually (a sub-type of) TYPE_UNICORE32_CPU.
    
    This fixes, e.g., -cpu puv3_dma asserting.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    2a71dcf View commit details
    Browse the repository at this point in the history
  10. target-openrisc: Detect attempt to instantiate non-CPU type in cpu_in…

    …it()
    
    Consolidate model checking into a new openrisc_cpu_class_by_name().
    
    If the name matches an existing type, also check whether that type is
    actually (a sub-type of) TYPE_OPENRISC_CPU.
    
    This fixes, e.g., -cpu open_eth asserting.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    bd039ce View commit details
    Browse the repository at this point in the history
  11. target-m68k: Detect attempt to instantiate non-CPU type in cpu_init()

    Consolidate model checking into a new m68k_cpu_class_by_name().
    
    If the name matches an existing type, also check whether that type is
    (a sub-type of) TYPE_M68K_CPU.
    
    This fixes, e.g., -cpu ide-hd asserting.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    bc5b2da View commit details
    Browse the repository at this point in the history
  12. target-alpha: Detect attempt to instantiate non-CPU type in cpu_init()

    Check in alpha_cpu_class_by_name() whether the type found is actually
    (a sub-type of) TYPE_ALPHA_CPU.
    
    This fixes, e.g., -cpu typhoon-pcihost asserting.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    0e44a02 View commit details
    Browse the repository at this point in the history
  13. target-arm: Detect attempt to instantiate non-CPU type in cpu_init()

    Consolidate model checking into a new arm_cpu_class_by_name().
    
    If the name matches an existing type, also check whether that type is
    actually (a sub-type of) TYPE_ARM_CPU.
    
    This fixes, e.g., -cpu tmp105 asserting.
    
    Cc: qemu-stable <qemu-stable@nongnu.org>
    Acked-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    5900d6b View commit details
    Browse the repository at this point in the history
  14. cpu: Add model resolution support to CPUClass

    Introduce CPUClass::class_by_name and add a default implementation.
    Hook up the alpha and ppc implementations.
    
    Introduce a wrapper function cpu_class_by_name().
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    2b8c275 View commit details
    Browse the repository at this point in the history
  15. target-i386: Remove setting tsc-frequency from x86_def_t

    Setting tsc-frequency from x86_def_t is NOP because default tsc_khz
    in x86_def_t is 0 and CPUX86State.tsc_khz is also initialized to 0
    by default. So there is no need to overwrite tsc_khz with default 0
    because field was already initialized to 0.
    
    Custom tsc-frequency setting is not affected due to it being set
    without using x86_def_t.
    
    Field tsc_khz in x86_def_t becomes unused with this patch, so drop it
    as well.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    2c728df View commit details
    Browse the repository at this point in the history
  16. target-i386: Set custom features/properties without intermediate x86_…

    …def_t
    
    Move custom features parsing after built-in cpu_model defaults are set
    and set custom features directly on CPU instance. That allows to make a
    clear distinction between built-in cpu model defaults that eventually
    should go into class_init() and extra property setting which is done
    after defaults are set on CPU instance.
    
    Impl. details:
     * use object_property_parse() property setter so it would be a mechanical
       change to switch to global properties later.
     * And after all current features/properties are converted into static
       properties, it will take a trivial patch to switch to global properties.
       Which will allow to:
       * get CPU instance initialized with all parameters passed on -cpu ...
         cmd. line from object_new() call.
       * call cpu_model/featurestr parsing only once before CPUs are created
       * open a road for removing CPUxxxState.cpu_model_str field, when other
         CPUs are similarly converted to subclasses and static properties.
     - re-factor error handling, to use Error instead of fprintf()s, since
       it is anyway passed in for property setter.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    a91987c View commit details
    Browse the repository at this point in the history
  17. target-i386: Remove vendor_override field from CPUX86State

    Commit 8935499 makes cpuid return to guest host's vendor value
    instead of built-in one by default if kvm_enabled() == true and allows
    to override this behavior if 'vendor' is specified on -cpu command line.
    
    But every time guest calls cpuid to get 'vendor' value, host's value is
    read again and again in default case.
    
    It complicates semantics of vendor property and makes it harder to use.
    
    Instead of reading 'vendor' value from host every time cpuid[vendor] is
    called, override 'vendor' value only once in cpu_x86_find_by_name(), when
    built-in CPU model is found and if(kvm_enabled() == true).
    
    It provides the same default semantics
     if (kvm_enabled() == true)  vendor = host's vendor
     else vendor = built-in vendor
    
    and then later:
     if (custom vendor) vendor = custom vendor
    
    'vendor' value is overridden when user provides it on -cpu command line,
    and there is no need for vendor_override field anymore, remove it.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    11acfdd View commit details
    Browse the repository at this point in the history
  18. target-i386: Replace uint32_t vendor fields by vendor string in x86_d…

    …ef_t
    
    Vendor property setter takes string as vendor value but cpudefs
    use uint32_t vendor[123] fields to define vendor value. It makes it
    difficult to unify and use property setter for values from cpudefs.
    
    Simplify code by using vendor property setter, vendor[123] fields
    are converted into vendor[13] array to keep its value. And vendor
    property setter is used to access/set value on CPU.
    
     - Make for() cycle reusable for the next patch by adding
       x86_cpu_vendor_words2str()
    
    Intel's CPUID spec[1] says:
    "
    5.1.1 ...
    These registers contain the ASCII string: GenuineIntel
    ...
    "
    
    List[2] of known vendor values shows that they all are 12 ASCII
    characters long, padded where necessary with space.
    
    Current supported values are all ASCII characters packed in
    ebx, edx, ecx. So lets state that QEMU supports 12 printable ASCII
    characters packed in ebx, edx, ecx registers for cpuid(0) instruction.
    
    *1 - http://www.intel.com/Assets/PDF/appnote/241618.pdf
    *2 - http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    99b88a1 View commit details
    Browse the repository at this point in the history
  19. target-i386: Print deprecation warning if xlevel < 0x80000000

    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    8ba8a69 View commit details
    Browse the repository at this point in the history
  20. target-i386: Drop redundant list of CPU definitions

    It is no longer needed since dropping cpudef config file support.
    Cleaning this up removes knowledge about other models from x86_def_t,
    in preparation for reusing x86_def_t as intermediate step towards pure
    QOM X86CPU subclasses.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    7fc9b71 View commit details
    Browse the repository at this point in the history
  21. target-i386: Simplify cpu_x86_find_by_name()

    Catch NULL name argument early to avoid repeated checks.
    Similarly, check for -cpu host early and untangle from iterating through
    model definitions. This prepares for introducing X86CPU subclasses.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    4bfe910 View commit details
    Browse the repository at this point in the history
  22. pc: Generate APIC IDs according to CPU topology

    This keeps compatibility on machine-types pc-1.2 and older, and prints a
    warning in case the requested configuration won't get the correct
    topology.
    
    I couldn't think of a better way to warn about broken topology when in
    compat mode other than using error_report(). The warning message will
    probably be buried in a log file somewhere, but it's better than
    nothing.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    8932cfd View commit details
    Browse the repository at this point in the history
  23. target-i386: Topology & APIC ID utility functions

    This introduces utility functions for the APIC ID calculation, based on:
      Intel® 64 Architecture Processor Topology Enumeration
      http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/
    
    The code should be compatible with AMD's "Extended Method" described at:
      AMD CPUID Specification (Publication #25481)
      Section 3: Multiple Core Calcuation
    as long as:
     - nr_threads is set to 1;
     - OFFSET_IDX is assumed to be 0;
     - CPUID Fn8000_0008_ECX[ApicIdCoreIdSize[3:0]] is set to
       apicid_core_width().
    
    Unit tests included.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    247c9de View commit details
    Browse the repository at this point in the history
  24. pc: Set fw_cfg data based on APIC ID calculation

    This changes FW_CFG_MAX_CPUS and FW_CFG_NUMA to use apic_id_for_cpu(),
    so the NUMA table can be based on the APIC IDs, instead of CPU index
    (SeaBIOS knows nothing about CPU indexes, just APIC IDs).
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    1d934e8 View commit details
    Browse the repository at this point in the history
  25. cpus.h: Make constant smp_cores/smp_threads available on *-user

    The code that calculates the APIC ID will use smp_cores/smp_threads, so
    just define them as 1 on *-user to avoid #ifdefs in the code.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    54fb7bf View commit details
    Browse the repository at this point in the history
  26. fw_cfg: Remove FW_CFG_MAX_CPUS from fw_cfg_init()

    PC will not use max_cpus for that field, so move it outside the common
    code so it can use a different value on PC.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    70db922 View commit details
    Browse the repository at this point in the history
  27. target-i386: Introduce x86_cpu_apic_id_from_index() function

    This function will be used by both the CPU initialization code and the
    fw_cfg table initialization code.
    
    Later this function will be updated to generate APIC IDs according to
    the CPU topology.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    cb41bad View commit details
    Browse the repository at this point in the history
  28. target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index

    The CPU ID in KVM is supposed to be the APIC ID, so change the
    KVM_CREATE_VCPU call to match it. The current behavior didn't break
    anything yet because today the APIC ID is assumed to be equal to the CPU
    index, but this won't be true in the future.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
    Acked-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    83b17af View commit details
    Browse the repository at this point in the history
  29. kvm: Create kvm_arch_vcpu_id() function

    This will allow each architecture to define how the VCPU ID is set on
    the KVM_CREATE_VCPU ioctl call.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Acked-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    b164e48 View commit details
    Browse the repository at this point in the history
  30. pc: Reverse pc_init_pci() compatibility logic

    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: Eduardo Habkost <ehabkost@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    2969475 View commit details
    Browse the repository at this point in the history
  31. target-i386: Don't set any KVM flag by default if KVM is disabled

    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: Eduardo Habkost <ehabkost@redhat.com>
    Acked-by: Gleb Natapov <gleb@redhat.com>
    Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    aa87d45 View commit details
    Browse the repository at this point in the history
  32. kvm: Add fake KVM_FEATURE_CLOCKSOURCE_STABLE_BIT for builds without KVM

    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost authored and afaerber committed Jan 27, 2013
    Copy the full SHA
    d61a23b View commit details
    Browse the repository at this point in the history
  33. target-openrisc: Clean up triple QOM casts

    Instead of calling openrisc_env_get_cpu(), casting to CPU() via the
    ENV_GET_CPU() compatibility macro and casting back to OPENRISC_CPU(),
    just call openrisc_env_get_cpu() directly.
    
    ENV_GET_CPU() is meant as workaround for target-independent code only.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    dd51dc5 View commit details
    Browse the repository at this point in the history
  34. target-openrisc: Drop OpenRISCCPUList

    It was missed in 92a3136 (cpu:
    Introduce CPUListState struct) because its naming did not match the
    *CPUListState pattern. Use the generalized CPUListState instead.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    afaerber committed Jan 27, 2013
    Copy the full SHA
    8486af9 View commit details
    Browse the repository at this point in the history
  35. xilinx_ethlite: Avoid build warnings in debug code

    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
    edgarigl committed Jan 27, 2013
    Copy the full SHA
    6034fe7 View commit details
    Browse the repository at this point in the history
Older