History | View | Annotate | Download (75.8 kB)
target-i386: Implement ADX extension
Signed-off-by: Richard Henderson <rth@twiddle.net>
target-i386: Implement MOVBE
target-i386: Implement ANDN
As this is the first of the BMI insns to be implemented,this carries quite a bit more baggage than normal.
target-i386: Split command line parsing out of cpu_x86_register()
In order to instantiate a CPU subtype we will need to know which type,so move the cpu_model splitting into cpu_x86_init().
Parameters need to be set on the X86CPU instance, so movecpu_x86_parse_featurestr() into cpu_x86_init() as well....
cpu: Add CPUArchState pointer to CPUState
The target-specific ENV_GET_CPU() macros have allowed us to navigatefrom CPUArchState to CPUState. The reverse direction was not supported.Avoid introducing CPU_GET_ENV() macros by initializing an untypedpointer that is initialized in derived instance_init functions....
target-i386: Move cpu_x86_init()
Consolidate CPU functions in cpu.c.Allows to make cpu_x86_register() static.
No functional changes.
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Update X86CPU to QOM realizefn
Adapt the signature of x86_cpu_realize(), hook up toDeviceClass::realize and set realized = true in cpu_x86_init().
The QOM realizefn cannot depend on errp being non-NULL as incpu_x86_init(), so use a local Error to preserve error handling behavior...
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep comingback. Tracked down with this Coccinelle semantic patch:
r expression err, eno, cls, fmt; position p; @@ (...
r
target-i386: Introduce x86_cpu_apic_id_from_index() function
This function will be used by both the CPU initialization code and thefw_cfg table initialization code.
Later this function will be updated to generate APIC IDs according tothe CPU topology....
pc: Generate APIC IDs according to CPU topology
This keeps compatibility on machine-types pc-1.2 and older, and prints awarning in case the requested configuration won't get the correcttopology.
I couldn't think of a better way to warn about broken topology when in...
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 throughmodel definitions. This prepares for introducing X86CPU subclasses.
Signed-off-by: Andreas Färber <afaerber@suse.de>
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...
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>
target-i386: Replace uint32_t vendor fields by vendor string in x86_def_t
Vendor property setter takes string as vendor value but cpudefsuse uint32_t vendor123 fields to define vendor value. It makes itdifficult to unify and use property setter for values from cpudefs....
target-i386: Remove vendor_override field from CPUX86State
Commit 8935499831312 makes cpuid return to guest host's vendor valueinstead of built-in one by default if kvm_enabled() == true and allowsto override this behavior if 'vendor' is specified on -cpu command line....
target-i386: Set custom features/properties without intermediate x86_def_t
Move custom features parsing after built-in cpu_model defaults are setand set custom features directly on CPU instance. That allows to make aclear distinction between built-in cpu model defaults that eventually...
target-i386: Remove setting tsc-frequency from x86_def_t
Setting tsc-frequency from x86_def_t is NOP because default tsc_khzin x86_def_t is 0 and CPUX86State.tsc_khz is also initialized to 0by default. So there is no need to overwrite tsc_khz with default 0...
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...
pc: Reverse pc_init_pci() compatibility logic
Currently, the pc-1.4 machine init function enables PV EOI and thencalls the pc-1.2 machine init function. The problem with this approachis that now we can't enable any additional compatibility code inside the...
sysbus: Drop sysbus_from_qdev() cast macro
Replace by SYS_BUS_DEVICE() QOM cast macro using a scripted conversion.Avoids the old macro creeping into new code.
Resolve a Coding Style warning in openpic code.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
target-i386: Move kvm_check_features_against_host() check to realize time
kvm_check_features_against_host() should be called when features can'tbe changed, and when features are converted to properties it would bepossible to change them until realize time, so correct way is to call...
target-i386: Disable kvm_mmu by default
KVM_CAP_PV_MMU capability reporting was removed from the kernel sincev2.6.33 (see commit a68a6a7282373), and was completely removed from thekernel since v3.3 (see commit fb92045843). It doesn't make sense to keep...
target-i386/cpu: Introduce FeatureWord typedefs
This introduces a FeatureWord enum, FeatureWordInfo struct (withgeneration information about a feature word), and a FeatureWordArraytypedef, and changes add_flagname_to_bitmaps() code andcpu_x86_parse_featurestr() to use the new typedefs instead of separate...
target-i386: kvm_check_features_against_host(): Use feature_word_info
Instead of carrying the CPUID leaf/register and feature name array onthe model_features_t struct, move that information intofeature_word_info so it can be reused by other functions....
target-i386/cpu.c: Add feature name array for ext4_features
Feature names were taken from the X86_FEATURE_* constants in the Linuxkernel code.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: check/enforce: Check all feature words
This adds the following feature words to the list of flags to be checkedby kvm_check_features_against_host():
- cpuid_7_0_ebx_features - ext4_features - kvm_features - svm_features
This will ensure the "enforce" flag works as it should: it won't allow...
target-i386: Move setting defaults out of cpu_x86_parse_featurestr()
No functional change, needed for simplifying conversion to properties.
target-i386: cpu_x86_register() consolidate freeing resources
Freeing resources in one place would require setting 'error'to not NULL, so add some more error reporting before jumping toexit branch.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
cpu: Move nr_{cores,threads} fields to CPUState
To facilitate the field movements, pass MIPSCPU to malta_mips_config();avoid that for mips_cpu_map_tc() since callers only access MIPS ThreadContexts, inside TCG helpers.
cpu: Move cpu_index field to CPUState
Note that target-alpha accesses this field from TCG, now using anegative offset. Therefore the field is placed last in CPUState.
Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.
Move common parts of mips cpu_state_reset() to mips_cpu_reset()....
target-i386: kvm: -cpu host: Use GET_SUPPORTED_CPUID for SVM features
The existing -cpu host code simply sets every bit inside svm_features(initializing it to -1), and that makes it impossible to make theenforce/check options work properly when the user asks for SVM features...
target-i386: kvm: Enable all supported KVM features for -cpu host
When using -cpu host, we don't need to use the kvm_default_featuresvariable, as the user is explicitly asking QEMU to enable all featuresupported by the host.
This changes the kvm_cpu_fill_host() code to use GET_SUPPORTED_CPUID to...
target-i386: check/enforce: Fix CPUID leaf numbers on error messages
The -cpu check/enforce warnings are printing incorrect information about themissing flags. There are no feature flags on CPUID leaves 0 and 0x80000000, butthere were references to 0 and 0x80000000 in the table at...
target-i386: check/enforce: Do not ignore "hypervisor" flag
We don't need any hack to ignore CPUID_EXT_HYPERVISOR anymore, becausekvm_arch_get_supported_cpuid() now sets CPUID_EXT_HYPERVISOR properly.So, this shouldn't introduce any behavior change, but it makes the code...
target-i386: check/enforce: Check all CPUID.80000001H.EDX bits
I have no idea why PPRO_FEATURES was being ignored on the check of theCPUID.80000001H.EDX bits. I believe it was a mistake, and it wassupposed to be ~(PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) or just...
target-i386: check/enforce: Check SVM flag support as well
When nested SVM is supported, the kernel returns the SVM flag onGET_SUPPORTED_CPUID1, so we can check the SVM flag safely inkvm_check_features_against_host().
I don't know why the original code ignored the SVM flag. Maybe it was...
target-i386: check/enforce: Eliminate check_feat field
Now that all entries have check_feat=~0 inkvm_check_features_against_host(), we can eliminate check_feat entirelyand make the code check all bits.
This patch shouldn't introduce any behavior change, as check_feat is set...
target-i386: Filter out unsupported features at realize time
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Sanitize AMD's ext2_features at realize time
When CPU properties are implemented, ext2_features may changebetween object_new(CPU) and cpu_realize_fn(). Sanitizingext2_features for AMD based CPU at realize() time will keepcurrent behavior after CPU features are converted to properties....
target-i386: Explicitly set vendor for each built-in cpudef
Since cpudef config is not supported anymore and all remaining sourcesnow always set x86_def_t.vendor123 fields, remove setting defaultvendor to simplify future re-factoring.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>...
Merge branch 'qom-cpu' of git://repo.or.cz/qemu/afaerber
target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevel
This fixes a subtle bug. A bug that probably won't cause trouble for anyexisting OS, but a bug anyway:
Intel SDM Volume 2, CPUID Instruction states:
Two types of information are returned: basic and extended function...
Merge branch 'master' of git://git.qemu.org/qemu into qom-cpu
Adapt header include paths.
cpu: Move kvm_state field into CPUState
Adapt some functions to take CPUState / {PowerPC,S390}CPU argument.
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: move include files to include/qemu/
qapi: move include files to include/qobject/
qapi: remove qapi/qapi-types-core.h
The file is only including error.h and qerror.h. Prefer explicitinclusion of whatever files are needed.Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target-i386: Postpone cpuid_level update to realize time
Delay capping cpuid_level to 7 to realize time so property settersfor cpuid_7_0_ebx_features and "level" could be used in any order/timebetween x86_cpu_initfn() and x86_cpu_realize().
target-i386: Use define for cpuid vendor string size
target-i386/cpu.c: Coding style fixes
- Use spaces instead of tabs on cpu_x86_cpuid().- Use braces on 'if' statement cpu_x86_find_by_name().
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Separate feature string parsing from CPU model lookup
Instead of parsing the whole cpu_model string insidecpu_x86_find_by_name(), first split it into the CPU model name and thefull feature string, then parse the feature string into pieces....
target-i386: Enable SSSE3 TCG support
SSSE3 support has been added to TCG more than 4 years ago in commit4242b1bd8acc19aaaacffdaad4ac23213d72a72b. It has been disabled bymistake in commit 551a2dec8fa55006a68393b9d6fb63577d2b3f1c.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
target-i386/cpu: Add missing flags to Haswell CPU model
When adding the Haswell CPU model, I intended to make it a superset of thefeatures present on the SandyBridge model, but I have removed the SEP andRDTSCP features from the feature list by mistake. This patch adds the...
target-i386: Add Haswell CPU model
Features added to the model, in relation to SandyBridge:
fma CPUID1.ECX12pcid CPUID1.ECX17movbe CPUID1.ECX22fsgsbase CPUID[EAX=7,ECX=0].EBX0bmi1 CPUID[EAX=7,ECX=0].EBX3hle CPUID[EAX=7,ECX=0].EBX4...
target-i386/cpu: Add new Opteron CPU model
Add a new base CPU model called Opteron_G5 to model the latestOpteron CPUs. This increases the model value and model numbers andadds TBM, F16C and FMA over the latest G4 model.
Signed-off-by: Andre Przywara <osp@andrep.de>...
target-i386/cpu: Name new CPUID bits
Update QEMU's knowledge of CPUID bit names. This allows toenable/disable those new features on QEMU's command line whenusing KVM and prepares future feature enablement in QEMU.
This adds F16C, RDRAND, LWP, TBM, TopoExt, PerfCtr_Core, PerfCtr_NB,...
target-i386: cpu: fix --disable-kvm compilation
This fixes the following: target-i386/cpu.o: In function `kvm_cpu_fill_host': target-i386/cpu.c:783: undefined reference to `kvm_state'
I didn't notice the problem before because GCC was optimizing the entire...
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
target-i386: make cpu_x86_fill_host() void
The return value of that function is always 0, and is always ignored.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
target-i386: cpu: make -cpu host/check/enforce code KVM-specific
Rationale: * "-cpu host" is available only when using KVM * The current implementation of -cpu check/enforce (check_features_against_host()) makes sense only when using KVM.
So this makes the functions check_features_against_host() and...
target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID
Change the kvm_cpu_fill_host() function to usekvm_arch_get_supported_cpuid() instead of running the CPUID instructiondirectly, when checking for supported CPUID features.
This should solve two problems at the same time:...
i386: kvm: filter CPUID feature words earlier, on cpu.c
cpu.c contains the code that will check if all requested CPU featuresare available, so the filtering of KVM features must be there, so we canimplement "check" and "enforce" properly.
The only point where kvm_arch_init_vcpu() is called on i386 is:...
i386: kvm: reformat filter_features_for_kvm() code
Cosmetic, but it will also help to make futher patches easier to review.
i386: kvm: filter CPUID leaf 7 based on GET_SUPPORTED_CPUID, too
Now that CPUID leaf 7 features can be enabled/disabled on thecommand-line, we need to filter them properly using GET_SUPPORTED_CPUID,at the same place where other features are filtered out....
i386: cpu: add missing CPUID[EAX=7,ECX=0] flag names
This makes QEMU recognize the following CPU flag names:
Flags | Corresponding KVM kernel commit -----------------+---------------------------------------- FSGSBASE | 176f61da82435eae09cc96f70b530d1ba0746b8b...
target-i386: Add missing kvm cpuid feature name
Currently "-cpu host,-kvmclock,-kvm_nopiodelay,-kvm_mmu" does notturn off all bits in CPUID 0x40000001 EAX.
The missing ones is KVM_FEATURE_STEAL_TIME.
This adds the name kvm_steal_time.
Signed-off-by: Don Slutz <Don@CloudSwitch.com>...
target-i386: cpu_x86_register(): report error from property setter
target-i386: Initialize APIC at CPU level
(L)APIC is a part of cpu [1] so move APIC initialization inside ofx86_cpu object. Since cpu_model and override flags currently specifywhether APIC should be created or not, APIC creation&initialization ismoved into x86_cpu_apic_init() which is called from x86_cpu_realize()....
target-i386: Inline APIC cpu_env property setting
This prepares for changing the variable type from void*.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>
apic: Store X86CPU in APICCommonState
Prepares for using a link<> property to connect APIC with CPU and forchanging the CPU APIs to CPUState.
Resolve Coding Style warnings by moving the closing parenthesis offoreach_apic() macro to next line.
qemu: enable PV EOI for qemu 1.3
Enable KVM PV EOI by default. You can still disable it with-kvm_pv_eoi cpu flag. To avoid breaking cross-version migration,enable only for qemu 1.3 (or in the future, newer) machine type.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
target-i386: cpu: recover items 28-31 of ext2_feature_name
I removed a line by mistake on commit3b671a40cab2404bc63e57db8cd3afa4ec70bfab, containing the flags lm/i64,3dnow, and 3dnowext. This patch restores the removed line.
Reviewed-by: Don Slutz <Don@cloudswitch.com>...
cpu_dump_state: move DUMP_FPU and DUMP_CCOP flags from x86-only to generic
Move the DUMP_FPU and DUMP_CCOP flags for cpu_dump_state() from beingx86-specific flags to being generic ones. This allows us to drop someTARGET_I386 ifdefs in various places, and means that we can (potentially)...
x86: Implement SMEP and SMAP
This patch implements Supervisor Mode Execution Prevention (SMEP) andSupervisor Mode Access Prevention (SMAP) for x86. The purpose of thepatch, obviously, is to help kernel developers debug the support forthose features....
i386: -cpu help: remove reference to specific CPUID leaves/registers
The -cpu configuration interface is based on a list of feature names orproperties, on a single namespace, so there's no need to mention onwhich CPUID leaf/register each flag is located....
i386: cpu: eliminate duplicate feature names
Instead of having duplicate feature names on the ext2_feature array forthe AMD feature bit aliases, we keep the feature names only on thefeature_name[] array, and copy the corresponding bits tocpuid_ext2_features in case the CPU vendor is AMD....
i386: cpu: replace EXT2_FEATURE_MASK with CPUID_EXT2_AMD_ALIASES
Both constants have the same value, but CPUID_EXT2_AMD_ALIASES isdefined without using magic numbers.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Don Slutz <Don@CloudSwitch.com>...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
target-i386: Allow tsc-frequency to be larger then 2.147G
The check using INT_MAX (2147483647) is wrong in this case.
Signed-off-by: Fred Oliveira <foliveira@cloudswitch.com>Signed-off-by: Don Slutz <Don@CloudSwitch.com>Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
target-i386: Drop unused setscalar() macro
It was only used by now removed setfeatures() function.
Suggested-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump
Commit c8057f95 (accidentally) disabled the ability to passoption strings starting with '?' to the target-specificcpu_list function, so the target-i386 specific "-cpu ?dump","-cpu ?cpuid" and "-cpu ?model" stopped working....
Drop cpu_list_id macro
Since the only user of the extended cpu_list_id() formatwas the x86 ?model/?dump/?cpuid output, we can drop itcompletely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
target-i386: Move CPU models from cpus-x86_64.conf to C
Those models are maintained by QEMU and may require compatibility codeto be added when making some changes. Keeping the data in the C sourcecode should make it simpler to handle those details.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
target-i386: x86_cpudef_setup() coding style change
Make source code lines shorter.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Don Slutz <Don@CloudSwitch.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Kill cpudef config section support
It's nice to have a flexible system to maintain CPU models as data, butthis is holding us from making improvements in the CPU code because it'snot using the common infra-structure, and because the machine-type data...
w32: Fix broken build
Commit ef8621b1a3b199c348606c0a11a77d8e8bf135f1 added an includefile which is not available for MinGW compilations.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
target-i386: disable pv eoi to fix migration across QEMU versions
We have a problem with how we handle migration with KVM paravirt features.We unconditionally enable paravirt features regardless of whether we know howto migrate them.
We also don't tie paravirt features to specific machine types so an old QEMU on...
win32: provide separate macros for weak decls and definitions
mingw32 seems to want the declaration to also carry the weak attribute.Strangely, gcc on Linux absolutely does not want the declaration to be markedas weak. This may not be the right fix, but it seems to do the trick....
target-i386: add implementation of query-cpu-definitions (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Merge branch 'x86cpu_qom_tcg_v2' of git://github.com/imammedo/qemu
target-i386: move cpu halted decision into x86_cpu_reset
MP initialization protocol differs between cpu families, and for P6 andonward models it is up to CPU to decide if it will be BSP using thisprotocol, so try to model this. However there is no point in implementing...
target-i386: move cpu_reset and reset callback to cpu.c
Moving reset callback into cpu object from board level andresetting cpu at the end of x86_cpu_realize() will allow properlycreate cpu object during run-time (hotplug) without calling reset externaly....
Recognize PCID feature
This patch makes Qemu recognize the PCID feature specified from configuration or command line options.
Signed-off-by: Junjie Mao <junjie.mao@intel.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
kvm_pv_eoi: add flag support
Support the new PV EOI flag in kvm - it recently got mergedinto kvm.git. Set by default with -cpu kvm.Set for -cpu qemu by adding +kvm_pv_eoi.Clear by adding -kvm_pv_eoi to -cpu option.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
target-i386: move tcg initialization into x86_cpu_initfn()
In order to make cpu object not depended on external ad-hocinitialization routines, move tcg initialization from cpu_x86_initinside cpu object "x86_cpu_initfn()".
target-i386: Use QEMU instead of Qemu
This new 'QEmu' was recently added.Replace it by the official all upper case 'QEMU'.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Allow machines to configure the QEMU_VERSION that's exposed via hardware
QEMU exposes its version to the guest's hardware and in some cases that is wrong(e.g. Windows prints messages about driver updates when you switchthe QEMU version).There is a new field now on the struct QEmuMachine, hw_version, which may...
target-i386: Use uint32 visitor for [x]level properties
This simplifies the code and resolves TODOs.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Expose CPUID leaf 7 only for -cpu host
Changes v2 -> v3; - Check for kvm_enabled() before setting cpuid_7_0_ebx_features
Changes v1 -> v2: - Use kvm_arch_get_supported_cpuid() instead of host_cpuid() on cpu_x86_fill_host().
We should use GET_SUPPORTED_CPUID for all bits on "-cpu host"...