Statistics
| Branch: | Revision:

root / target-i386 / cpu.c @ 41e5e76d

History | View | Annotate | Download (66.9 kB)

# Date Author Comment
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"...
7a059953 05/12/2012 03:17 pm Andreas Färber

target-i386: Defer MCE init

Commit de024815e3b523addf58f1f79846b7fe74643678 (target-i386: QOM'ify
CPU init) moved mce_init() call from helper.c:cpu_x86_init() into
X86CPU's cpu.c:x86_cpu_initfn().
mce_init() checks for a family >= 6 though, so we could end up with a...

16b93aa8 04/25/2012 11:51 am Andreas Färber

target-i386: Introduce "xlevel" property for X86CPU

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

d480e1af 04/25/2012 11:51 am Andreas Färber

target-i386: Prepare "vendor" property for X86CPU

Using it now would incur converting the three x86_def_t vendor words
into a string for object_property_set_str(), then back to three words
in the "vendor" setter.
The built-in CPU definitions use numeric preprocessor defines to...

89e48965 04/25/2012 11:51 am Andreas Färber

target-i386: Introduce "tsc-frequency" property for X86CPU

Use Hz as unit.

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

61dcd775 04/25/2012 11:51 am Andreas Färber

target-i386: Pass X86CPU to cpu_x86_register()

Avoids an x86_env_get_cpu() call there, to work with QOM properties.

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

a88a677f 04/25/2012 11:51 am Andreas Färber

target-i386: Add range check for -cpu ,family=x

A family field value of 0xf and extended family field value of 0xff is
the maximum representable unsigned family number.
All other CPUID property values are bounds-checked, so add a check here
for symmetry before we adopt it in a property setter....

71ad61d3 04/25/2012 11:51 am Andreas Färber

target-i386: Add "family" property to X86CPU

Add the property early in the initfn so that it can be used in helpers
such as mce_init().

Signed-off-by: Andreas Färber <>
Reviewed-by: Eduardo Habkost <>
[AF: Add an error_free(), spotted by Michael Roth]...

c5291a4f 04/25/2012 11:51 am Andreas Färber

target-i386: Add "model" property to X86CPU

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

036e2222 04/25/2012 11:51 am Andreas Färber

target-i386: Add "stepping" property to X86CPU

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

938d4c25 04/25/2012 11:51 am Andreas Färber

target-i386: Add "model-id" property to X86CPU

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

95b8519d 04/25/2012 11:51 am Andreas Färber

target-i386: Add property getter for CPU family

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

67e30c83 04/25/2012 11:51 am Andreas Färber

target-i386: Add property getter for CPU model

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

35112e41 04/25/2012 11:51 am Andreas Färber

target-i386: Add property getter for CPU stepping

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

63e886eb 04/25/2012 11:51 am Andreas Färber

target-i386: Add property getter for CPU model-id

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

8e1898bf 04/25/2012 11:51 am Andreas Färber

target-i386: Introduce "level" property for X86CPU

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

d0a6acf4 04/25/2012 11:45 am Andreas Färber

target-i386: Fix x86_cpuid_set_model_id()

Don't assume zeroed cpuid_model[] fields.

This didn't break anything yet but QOM properties should be able to set
the value to something else without setting an intermediate zero string.

Reviewed-by: Eduardo Habhost <>...

30471bc9 04/10/2012 06:10 pm Andreas Färber

target-i386: Rename cpuid.c

Name it cpu.c to align with other QOM'ified targets.

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

5fd2087a 04/10/2012 06:10 pm Andreas Färber

target-i386: QOM'ify CPU

Embed CPUX86State as first member of X86CPU.
Distinguish between "x86_64-cpu" and "i386-cpu".
Drop cpu_x86_close() in favor of calling object_delete() directly.

For now let CPUClass::reset() call cpu_state_reset().

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

de024815 04/10/2012 06:10 pm Andreas Färber

target-i386: QOM'ify CPU init

Move code from cpu_x86_init() to new QOM x86_cpu_initfn().
Also move mce_init() to cpu.c since it's used nowhere else.

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

c1958aea 04/10/2012 06:10 pm Andreas Färber

target-i386: QOM'ify CPU reset

Move code from cpu_state_reset() into QOM x86_cpu_reset(),
fixing style issues for FPU init.

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