Statistics
| Branch: | Revision:

root / target-i386 / cpu.c @ 76f13133

History | View | Annotate | Download (75.8 kB)

# Date Author Comment
cd7f97ca 02/20/2013 09:05 am Richard Henderson

target-i386: Implement ADX extension

Signed-off-by: Richard Henderson <>

111994ee 02/19/2013 01:39 am Richard Henderson

target-i386: Implement MOVBE

Signed-off-by: Richard Henderson <>

7073fbad 02/19/2013 01:39 am Richard Henderson

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.

Signed-off-by: Richard Henderson <>

2d64255b 02/16/2013 03:51 pm Andreas Färber

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 move
cpu_x86_parse_featurestr() into cpu_x86_init() as well....

c05efcb1 02/16/2013 03:51 pm Andreas Färber

cpu: Add CPUArchState pointer to CPUState

The target-specific ENV_GET_CPU() macros have allowed us to navigate
from CPUArchState to CPUState. The reverse direction was not supported.
Avoid introducing CPU_GET_ENV() macros by initializing an untyped
pointer that is initialized in derived instance_init functions....

5c3c6a68 02/16/2013 03:51 pm Andreas Färber

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 <>
Reviewed-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

2b6f294c 02/16/2013 03:50 pm Andreas Färber

target-i386: Update X86CPU to QOM realizefn

Adapt the signature of x86_cpu_realize(), hook up to
DeviceClass::realize and set realized = true in cpu_x86_init().

The QOM realizefn cannot depend on errp being non-NULL as in
cpu_x86_init(), so use a local Error to preserve error handling behavior...

312fd5f2 02/11/2013 04:13 pm Markus Armbruster

error: Strip trailing '\n' from error string arguments (again)

Commit 6daf194d and be62a2eb got rid of a bunch, but they keep coming
back. Tracked down with this Coccinelle semantic patch:

r
expression err, eno, cls, fmt;
position p;
@@
(...
cb41bad3 01/27/2013 03:34 pm Eduardo Habkost

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....

8932cfdf 01/27/2013 03:34 pm Eduardo Habkost

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...

4bfe910d 01/27/2013 03:34 pm Andreas Färber

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 <>

7fc9b714 01/27/2013 03:34 pm Andreas Färber

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...

8ba8a698 01/27/2013 03:34 pm Igor Mammedov

target-i386: Print deprecation warning if xlevel < 0x80000000

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

99b88a17 01/27/2013 03:34 pm Igor Mammedov

target-i386: Replace uint32_t vendor fields by vendor string in x86_def_t

Vendor property setter takes string as vendor value but cpudefs
use uint32_t vendor123 fields to define vendor value. It makes it
difficult to unify and use property setter for values from cpudefs....

11acfdd5 01/27/2013 03:34 pm Igor Mammedov

target-i386: Remove vendor_override field from CPUX86State

Commit 8935499831312 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....

a91987c2 01/27/2013 03:34 pm Igor Mammedov

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...

2c728dfe 01/27/2013 03:34 pm Igor Mammedov

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...

aa87d458 01/27/2013 03:34 pm Eduardo Habkost

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...
29694758 01/27/2013 03:34 pm Eduardo Habkost

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...

1356b98d 01/21/2013 09:52 pm Andreas Färber

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 <>...

5ec01c2e 01/15/2013 05:09 am Igor Mammedov

target-i386: Move kvm_check_features_against_host() check to realize time

kvm_check_features_against_host() should be called when features can't
be changed, and when features are converted to properties it would be
possible to change them until realize time, so correct way is to call...

6a4784ce 01/15/2013 05:09 am Eduardo Habkost

target-i386: Disable kvm_mmu by default

KVM_CAP_PV_MMU capability reporting was removed from the kernel since
v2.6.33 (see commit a68a6a7282373), and was completely removed from the
kernel since v3.3 (see commit fb92045843). It doesn't make sense to keep...

5ef57876 01/15/2013 05:09 am Eduardo Habkost

target-i386/cpu: Introduce FeatureWord typedefs

This introduces a FeatureWord enum, FeatureWordInfo struct (with
generation information about a feature word), and a FeatureWordArray
typedef, and changes add_flagname_to_bitmaps() code and
cpu_x86_parse_featurestr() to use the new typedefs instead of separate...

bffd67b0 01/15/2013 05:09 am Eduardo Habkost

target-i386: kvm_check_features_against_host(): Use feature_word_info

Instead of carrying the CPUID leaf/register and feature name array on
the model_features_t struct, move that information into
feature_word_info so it can be reused by other functions.
...

89e49c8b 01/15/2013 05:09 am Eduardo Habkost

target-i386/cpu.c: Add feature name array for ext4_features

Feature names were taken from the X86_FEATURE_* constants in the Linux
kernel code.

Signed-off-by: Eduardo Habkost <>
Reviewed-by: Gleb Natapov <>
Signed-off-by: Andreas Färber <>

07ca5945 01/15/2013 05:09 am Eduardo Habkost

target-i386: check/enforce: Check all feature words

This adds the following feature words to the list of flags to be checked
by 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...

077c68c3 01/15/2013 05:09 am Igor Mammedov

target-i386: Move setting defaults out of cpu_x86_parse_featurestr()

No functional change, needed for simplifying conversion to properties.

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

fa2db3c4 01/15/2013 05:09 am Igor Mammedov

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 to
exit branch.

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>...

ce3960eb 01/15/2013 05:09 am Andreas Färber

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 Thread
Contexts, inside TCG helpers.

Signed-off-by: Andreas Färber <>

55e5c285 01/15/2013 05:09 am Andreas Färber

cpu: Move cpu_index field to CPUState

Note that target-alpha accesses this field from TCG, now using a
negative 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()....

fcb93c03 01/08/2013 10:03 pm Eduardo Habkost

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 the
enforce/check options work properly when the user asks for SVM features...

bd004bef 01/08/2013 10:03 pm Eduardo Habkost

target-i386: kvm: Enable all supported KVM features for -cpu host

When using -cpu host, we don't need to use the kvm_default_features
variable, as the user is explicitly asking QEMU to enable all feature
supported by the host.

This changes the kvm_cpu_fill_host() code to use GET_SUPPORTED_CPUID to...

8b4beddc 01/08/2013 10:03 pm Eduardo Habkost

target-i386: check/enforce: Fix CPUID leaf numbers on error messages

The -cpu check/enforce warnings are printing incorrect information about the
missing flags. There are no feature flags on CPUID leaves 0 and 0x80000000, but
there were references to 0 and 0x80000000 in the table at...

54830ff8 01/08/2013 10:03 pm Eduardo Habkost

target-i386: check/enforce: Do not ignore "hypervisor" flag

We don't need any hack to ignore CPUID_EXT_HYPERVISOR anymore, because
kvm_arch_get_supported_cpuid() now sets CPUID_EXT_HYPERVISOR properly.
So, this shouldn't introduce any behavior change, but it makes the code...

22714625 01/08/2013 10:03 pm Eduardo Habkost

target-i386: check/enforce: Check all CPUID.80000001H.EDX bits

I have no idea why PPRO_FEATURES was being ignored on the check of the
CPUID.80000001H.EDX bits. I believe it was a mistake, and it was
supposed to be ~(PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) or just...

396d2cfc 01/08/2013 10:03 pm Eduardo Habkost

target-i386: check/enforce: Check SVM flag support as well

When nested SVM is supported, the kernel returns the SVM flag on
GET_SUPPORTED_CPUID1, so we can check the SVM flag safely in
kvm_check_features_against_host().

I don't know why the original code ignored the SVM flag. Maybe it was...

e8beac00 01/08/2013 10:03 pm Eduardo Habkost

target-i386: check/enforce: Eliminate check_feat field

Now that all entries have check_feat=~0 in
kvm_check_features_against_host(), we can eliminate check_feat entirely
and make the code check all bits.

This patch shouldn't introduce any behavior change, as check_feat is set...

4586f157 01/08/2013 10:03 pm Igor Mammedov

target-i386: Filter out unsupported features at realize time

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

9b15cd9e 01/08/2013 10:03 pm Igor Mammedov

target-i386: Sanitize AMD's ext2_features at realize time

When CPU properties are implemented, ext2_features may change
between object_new(CPU) and cpu_realize_fn(). Sanitizing
ext2_features for AMD based CPU at realize() time will keep
current behavior after CPU features are converted to properties....

ebe8b9c6 01/08/2013 10:03 pm Igor Mammedov

target-i386: Explicitly set vendor for each built-in cpudef

Since cpudef config is not supported anymore and all remaining sources
now always set x86_def_t.vendor123 fields, remove setting default
vendor to simplify future re-factoring.

Signed-off-by: Igor Mammedov <>...

4de63460 12/28/2012 06:08 pm Blue Swirl

Merge branch 'qom-cpu' of git://repo.or.cz/qemu/afaerber

  • 'qom-cpu' of git://repo.or.cz/qemu/afaerber:
    MAINTAINERS: Include X86CPU in CPU maintenance area
    cpu: Move kvm_run into CPUState
    cpu: Move kvm_state field into CPUState
    ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init()...
57f26ae7 12/23/2012 05:11 pm Eduardo Habkost

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 any
existing OS, but a bug anyway:

Intel SDM Volume 2, CPUID Instruction states:

Two types of information are returned: basic and extended function...

501a7ce7 12/23/2012 01:40 am Andreas Färber

Merge branch 'master' of git://git.qemu.org/qemu into qom-cpu

Adapt header include paths.

Signed-off-by: Andreas Färber <>

a60f24b5 12/19/2012 03:09 pm Andreas Färber

cpu: Move kvm_state field into CPUState

Adapt some functions to take CPUState / {PowerPC,S390}CPU argument.

Signed-off-by: Andreas Färber <>

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

7b1b5d19 12/19/2012 09:31 am Paolo Bonzini

qapi: move include files to include/qobject/

Signed-off-by: Paolo Bonzini <>

4167c42c 12/19/2012 09:31 am Paolo Bonzini

qapi: remove qapi/qapi-types-core.h

The file is only including error.h and qerror.h. Prefer explicit
inclusion of whatever files are needed.
Signed-off-by: Paolo Bonzini <>

b34d12d1 12/07/2012 08:03 pm Igor Mammedov

target-i386: Postpone cpuid_level update to realize time

Delay capping cpuid_level to 7 to realize time so property setters
for cpuid_7_0_ebx_features and "level" could be used in any order/time
between x86_cpu_initfn() and x86_cpu_realize().

Signed-off-by: Igor Mammedov <>...

9df694ee 12/06/2012 10:17 am Igor Mammedov

target-i386: Use define for cpuid vendor string size

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

9f3fb565 12/06/2012 10:17 am Eduardo Habkost

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 <>
Reviewed-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

8f961357 12/06/2012 10:17 am Eduardo Habkost

target-i386: Separate feature string parsing from CPU model lookup

Instead of parsing the whole cpu_model string inside
cpu_x86_find_by_name(), first split it into the CPU model name and the
full feature string, then parse the feature string into pieces....

a0a70681 11/26/2012 06:00 pm Aurelien Jarno

target-i386: Enable SSSE3 TCG support

SSSE3 support has been added to TCG more than 4 years ago in commit
4242b1bd8acc19aaaacffdaad4ac23213d72a72b. It has been disabled by
mistake in commit 551a2dec8fa55006a68393b9d6fb63577d2b3f1c.

Signed-off-by: Aurelien Jarno <>...

80ae4160 11/26/2012 05:55 pm Eduardo Habkost

target-i386/cpu: Add missing flags to Haswell CPU model

When adding the Haswell CPU model, I intended to make it a superset of the
features present on the SandyBridge model, but I have removed the SEP and
RDTSCP features from the feature list by mistake. This patch adds the...

37507094 11/15/2012 04:48 am Eduardo Habkost

target-i386: Add Haswell CPU model

Features added to the model, in relation to SandyBridge:

fma CPUID1.ECX12
pcid CPUID1.ECX17
movbe CPUID1.ECX22
fsgsbase CPUID[EAX=7,ECX=0].EBX0
bmi1 CPUID[EAX=7,ECX=0].EBX3
hle CPUID[EAX=7,ECX=0].EBX4...

021941b9 11/15/2012 04:48 am Andre Przywara

target-i386/cpu: Add new Opteron CPU model

Add a new base CPU model called Opteron_G5 to model the latest
Opteron CPUs. This increases the model value and model numbers and
adds TBM, F16C and FMA over the latest G4 model.

Signed-off-by: Andre Przywara <>...

c8acc380 11/15/2012 04:47 am Andre Przywara

target-i386/cpu: Name new CPUID bits

Update QEMU's knowledge of CPUID bit names. This allows to
enable/disable those new features on QEMU's command line when
using KVM and prepares future feature enablement in QEMU.

This adds F16C, RDRAND, LWP, TBM, TopoExt, PerfCtr_Core, PerfCtr_NB,...

e4ab0d6b 11/02/2012 06:55 pm Eduardo Habkost

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...

43552994 11/01/2012 06:12 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

  • qemu-kvm/uq/master: (28 commits)
    update-linux-headers.sh: Handle new kernel uapi/ directories
    target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID
    target-i386: cpu: make -cpu host/check/enforce code KVM-specific...
1aefc6b8 10/31/2012 03:39 am Eduardo Habkost

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 <>
Signed-off-by: Marcelo Tosatti <>

6e746f30 10/31/2012 03:39 am Eduardo Habkost

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...

12869995 10/31/2012 03:39 am Eduardo Habkost

target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID

Change the kvm_cpu_fill_host() function to use
kvm_arch_get_supported_cpuid() instead of running the CPUID instruction
directly, when checking for supported CPUID features.

This should solve two problems at the same time:...

bc74b7db 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: filter CPUID feature words earlier, on cpu.c

cpu.c contains the code that will check if all requested CPU features
are available, so the filtering of KVM features must be there, so we can
implement "check" and "enforce" properly.

The only point where kvm_arch_init_vcpu() is called on i386 is:...

b8091f24 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: reformat filter_features_for_kvm() code

Cosmetic, but it will also help to make futher patches easier to review.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Marcelo Tosatti <>

ffa8c11f 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: filter CPUID leaf 7 based on GET_SUPPORTED_CPUID, too

Now that CPUID leaf 7 features can be enabled/disabled on the
command-line, we need to filter them properly using GET_SUPPORTED_CPUID,
at the same place where other features are filtered out....

811a8ae0 10/31/2012 03:39 am Eduardo Habkost

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...
c3d39807 10/31/2012 03:39 am Don Slutz

target-i386: Add missing kvm cpuid feature name

Currently "-cpu host,-kvmclock,-kvm_nopiodelay,-kvm_mmu" does not
turn 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 <>...

18eb473f 10/30/2012 11:38 pm Igor Mammedov

target-i386: cpu_x86_register(): report error from property setter

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

bdeec802 10/30/2012 11:38 pm Igor Mammedov

target-i386: Initialize APIC at CPU level

(L)APIC is a part of cpu [1] so move APIC initialization inside of
x86_cpu object. Since cpu_model and override flags currently specify
whether APIC should be created or not, APIC creation&initialization is
moved into x86_cpu_apic_init() which is called from x86_cpu_realize()....

449994eb 10/30/2012 11:38 pm Andreas Färber

target-i386: Inline APIC cpu_env property setting

This prepares for changing the variable type from void*.

Signed-off-by: Andreas Färber <>
Reviewed-by: Igor Mammedov <>

60671e58 10/30/2012 11:38 pm Andreas Färber

apic: Store X86CPU in APICCommonState

Prepares for using a link<> property to connect APIC with CPU and for
changing the CPU APIs to CPUState.

Resolve Coding Style warnings by moving the closing parenthesis of
foreach_apic() macro to next line.

Signed-off-by: Andreas Färber <>...

dc59944b 10/29/2012 05:59 pm Michael S. Tsirkin

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 <>

01f590d5 10/28/2012 03:58 pm Eduardo Habkost

target-i386: cpu: recover items 28-31 of ext2_feature_name

I removed a line by mistake on commit
3b671a40cab2404bc63e57db8cd3afa4ec70bfab, containing the flags lm/i64,
3dnow, and 3dnowext. This patch restores the removed line.

Reviewed-by: Don Slutz <>...

6fd2a026 10/05/2012 05:04 pm Peter Maydell

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 being
x86-specific flags to being generic ones. This allows us to drop some
TARGET_I386 ifdefs in various places, and means that we can (potentially)...

a9321a4d 10/01/2012 04:04 pm H. Peter Anvin

x86: Implement SMEP and SMAP

This patch implements Supervisor Mode Execution Prevention (SMEP) and
Supervisor Mode Access Prevention (SMAP) for x86. The purpose of the
patch, obviously, is to help kernel developers debug the support for
those features.
...

4a19e505 09/30/2012 02:11 pm Eduardo Habkost

i386: -cpu help: remove reference to specific CPUID leaves/registers

The -cpu configuration interface is based on a list of feature names or
properties, on a single namespace, so there's no need to mention on
which CPUID leaf/register each flag is located....

3b671a40 09/30/2012 02:11 pm Eduardo Habkost

i386: cpu: eliminate duplicate feature names

Instead of having duplicate feature names on the ext2_feature array for
the AMD feature bit aliases, we keep the feature names only on the
feature_name[] array, and copy the corresponding bits to
cpuid_ext2_features in case the CPU vendor is AMD....

60032ac0 09/30/2012 02:11 pm Eduardo Habkost

i386: cpu: replace EXT2_FEATURE_MASK with CPUID_EXT2_AMD_ALIASES

Both constants have the same value, but CPUID_EXT2_AMD_ALIASES is
defined without using magic numbers.

Signed-off-by: Eduardo Habkost <>
Reviewed-by: Don Slutz <>...

3988475b 09/26/2012 12:06 am Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

  • stefanha/trivial-patches:
    w32: Always use standard instead of native format strings
    net/socket: Fix compiler warning (regression for MinGW)
    linux-user: Remove redundant null check and replace free by g_free...
2e84849a 09/23/2012 09:11 am Don Slutz

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 <>
Signed-off-by: Don Slutz <>
Signed-off-by: Stefan Hajnoczi <>

473955e5 09/21/2012 04:12 pm Andreas Färber

target-i386: Drop unused setscalar() macro

It was only used by now removed setfeatures() function.

Suggested-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

6cdf8854 09/21/2012 04:12 pm Peter Maydell

target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump

Commit c8057f95 (accidentally) disabled the ability to pass
option strings starting with '?' to the target-specific
cpu_list function, so the target-i386 specific "-cpu ?dump",
"-cpu ?cpuid" and "-cpu ?model" stopped working....

e916cbf8 09/21/2012 04:12 pm Peter Maydell

Drop cpu_list_id macro

Since the only user of the extended cpu_list_id() format
was the x86 ?model/?dump/?cpuid output, we can drop it
completely.

Signed-off-by: Peter Maydell <>
Reviewed-by: Eduardo Habkost <>...

3eca4642 09/21/2012 04:12 pm Eduardo Habkost

target-i386: Move CPU models from cpus-x86_64.conf to C

Those models are maintained by QEMU and may require compatibility code
to be added when making some changes. Keeping the data in the C source
code should make it simpler to handle those details.

Signed-off-by: Eduardo Habkost <>...

bc3e1291 09/21/2012 04:12 pm Eduardo Habkost

target-i386: x86_cpudef_setup() coding style change

Make source code lines shorter.

Signed-off-by: Eduardo Habkost <>
Reviewed-by: Don Slutz <>
Signed-off-by: Andreas Färber <>

c04321b3 09/21/2012 04:12 pm Eduardo Habkost

target-i386: Kill cpudef config section support

It's nice to have a flexible system to maintain CPU models as data, but
this is holding us from making improvements in the CPU code because it's
not using the common infra-structure, and because the machine-type data...

b834b508 08/31/2012 12:36 am Stefan Weil

w32: Fix broken build

Commit ef8621b1a3b199c348606c0a11a77d8e8bf135f1 added an include
file which is not available for MinGW compilations.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

ef8621b1 08/29/2012 06:51 pm Anthony Liguori

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 how
to migrate them.

We also don't tie paravirt features to specific machine types so an old QEMU on...

76b64a7a 08/15/2012 09:26 pm Anthony Liguori

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 marked
as weak. This may not be the right fix, but it seems to do the trick....

e3966126 08/13/2012 10:10 pm Anthony Liguori

target-i386: add implementation of query-cpu-definitions (v2)

Signed-off-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

d3da41e3 08/09/2012 09:44 pm Blue Swirl

Merge branch 'x86cpu_qom_tcg_v2' of git://github.com/imammedo/qemu

  • 'x86cpu_qom_tcg_v2' of git://github.com/imammedo/qemu:
    target-i386: move tcg initialization into x86_cpu_initfn()
    cleanup cpu_set_debug_excp_handler
    target-xtensa: drop usage of prev_debug_excp_handler...
dd673288 08/01/2012 04:45 pm Igor Mammedov

target-i386: move cpu halted decision into x86_cpu_reset

MP initialization protocol differs between cpu families, and for P6 and
onward models it is up to CPU to decide if it will be BSP using this
protocol, so try to model this. However there is no point in implementing...

65dee380 08/01/2012 04:45 pm Igor Mammedov

target-i386: move cpu_reset and reset callback to cpu.c

Moving reset callback into cpu object from board level and
resetting cpu at the end of x86_cpu_realize() will allow properly
create cpu object during run-time (hotplug) without calling reset externaly....

434acb81 07/21/2012 12:54 pm Mao, Junjie

Recognize PCID feature

This patch makes Qemu recognize the PCID feature specified from configuration or command line options.

Signed-off-by: Junjie Mao <>
Signed-off-by: Stefan Hajnoczi <>

bfee7546 07/03/2012 10:57 pm Michael S. Tsirkin

kvm_pv_eoi: add flag support

Support the new PV EOI flag in kvm - it recently got merged
into 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 <>...

d65e9815 06/25/2012 04:40 pm Igor Mammedov

target-i386: move tcg initialization into x86_cpu_initfn()

In order to make cpu object not depended on external ad-hoc
initialization routines, move tcg initialization from cpu_x86_init
inside cpu object "x86_cpu_initfn()".

Signed-off-by: Igor Mammedov <>...

09faecf2 06/22/2012 12:34 pm Stefan Weil

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 <>
Signed-off-by: Stefan Hajnoczi <>

93bfef4c 06/19/2012 09:36 pm Crístian Viana

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 switch
the QEMU version).
There is a new field now on the struct QEmuMachine, hw_version, which may...

fa029887 06/08/2012 05:11 pm Andreas Färber

target-i386: Use uint32 visitor for [x]level properties

This simplifies the code and resolves TODOs.

Signed-off-by: Andreas Färber <>
Reviewed-by: Michael Roth <>

13526728 05/30/2012 05:28 am Eduardo Habkost

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"...