mirror_qemu/linux-user
john cooper b5ec5ce0e3 Add cpu model configuration support..
This is a reimplementation of prior versions which adds
the ability to define cpu models for contemporary processors.
The added models are likewise selected via -cpu <name>,
and are intended to displace the existing convention
of "-cpu qemu64" augmented with a series of feature flags.

A primary motivation was determination of a least common
denominator within a given processor class to simplify guest
migration.  It is still possible to modify an arbitrary model
via additional feature flags however the goal here was to
make doing so unnecessary in typical usage.  The other
consideration was providing models names reflective of
current processors.  Both AMD and Intel have reviewed the
models in terms of balancing generality of migration vs.
excessive feature downgrade relative to released silicon.

This version of the patch replaces the prior hard wired
definitions with a configuration file approach for new
models.  Existing models are thus far left as-is but may
easily be transitioned to (or may be overridden by) the
configuration file representation.

Proposed new model definitions are provided here for current
AMD and Intel processors.  Each model consists of a name
used to select it on the command line (-cpu <name>), and a
model_id which corresponds to a least common denominator
commercial instance of the processor class.

A table of names/model_ids may be queried via "-cpu ?model":

        :
    x86       Opteron_G3  AMD Opteron 23xx (Gen 3 Class Opteron)
    x86       Opteron_G2  AMD Opteron 22xx (Gen 2 Class Opteron)
    x86       Opteron_G1  AMD Opteron 240 (Gen 1 Class Opteron)
    x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)
    x86           Penryn  Intel Core 2 Duo P9xxx (Penryn Class Core 2)
    x86           Conroe  Intel Celeron_4x0 (Conroe/Merom Class Core 2)
        :

Also added is "-cpu ?dump" which exhaustively outputs all config
data for all defined models, and "-cpu ?cpuid" which enumerates
all qemu recognized CPUID feature flags.

The pseudo cpuid flag 'check' when added to the feature flag list
will warn when feature flags (either implicit in a cpu model or
explicit on the command line) would have otherwise been quietly
unavailable to a guest:

    # qemu-system-x86_64 ... -cpu Nehalem,check
    warning: host cpuid 0000_0001 lacks requested flag 'sse4.2|sse4_2' [0x00100000]
    warning: host cpuid 0000_0001 lacks requested flag 'popcnt' [0x00800000]

A similar 'enforce' pseudo flag exists which in addition
to the above causes qemu to error exit if requested flags are
unavailable.

Configuration data for a cpu model resides in the target config
file which by default will be installed as:

    /usr/local/etc/qemu/target-<arch>.conf

The format of this file should be self explanatory given the
definitions for the above six models and essentially mimics
the structure of the static x86_def_t x86_defs.

Encoding of cpuid flags names now allows aliases for both the
configuration file and the command line which reconciles some
Intel/AMD/Linux/Qemu naming differences.

This patch was tested relative to qemu.git.

Signed-off-by: john cooper <john.cooper@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-22 16:16:17 -06:00
..
alpha linux-user: Add aliases for some Alpha syscalls 2009-12-21 11:29:27 +01:00
arm linux-user: fix up oversealous nitpicking 2009-10-02 17:59:12 +00:00
cris Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
i386 Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
m68k Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
microblaze Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
mips Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
mips64 Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
mipsn32 Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
ppc Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
sh4 Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
sparc Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
sparc64 Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
x86_64 Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
cpu-uname.c linux-user: adapt uname machine to emulated CPU 2010-02-06 17:19:43 +01:00
cpu-uname.h linux-user: adapt uname machine to emulated CPU 2010-02-06 17:19:43 +01:00
elfload.c fix linux-user microblaze ELF_ARCH definition 2010-01-17 09:51:03 +01:00
elfload32.c Remove unwanted executable properties 2008-04-06 06:04:39 +00:00
errno_defs.h Remove unnecessary trailing newlines 2008-12-13 09:32:43 +00:00
flat.h Support for 32 bit ABI on 64 bit targets (only enabled Sparc64) 2007-10-14 16:27:31 +00:00
flatload.c Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00
ioctls.h linux-user: KD/VT/FB ioctls 2009-10-17 11:38:00 +03:00
linux_loop.h Fix build failure with old kernel headers (loop.h is incompatible with 2008-05-23 16:06:43 +00:00
linuxload.c linux-user: don't zero a buffer twice 2009-10-16 14:36:36 +03:00
m68k-sim.c Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00
main.c Add cpu model configuration support.. 2010-02-22 16:16:17 -06:00
mmap.c mmap_frag() users only check for -1 error 2010-01-26 14:59:20 -06:00
qemu-types.h linux-user: Move abi_* typedefs into qemu-types.h 2008-12-08 18:12:04 +00:00
qemu.h Revert "Get rid of _t suffix" 2009-10-01 16:12:16 -05:00
signal.c linux-user: cleanup force_sig() calls 2009-12-19 19:45:27 +01:00
socket.h Various linux-user structures and definitions fixes for PowerPC targets. 2007-12-10 08:24:59 +00:00
strace.c Fix strace or FUTEX_PRIVATE_FLAG 2010-02-19 16:04:51 +00:00
strace.list linux-user: strace now handles guest strings correctly [v2] 2009-06-16 16:56:28 +03:00
syscall.c linux-user: adapt uname machine to emulated CPU 2010-02-06 17:19:43 +01:00
syscall_defs.h linux-user: KD/VT/FB ioctls 2009-10-17 11:38:00 +03:00
syscall_types.h linux-user: KD/VT/FB ioctls 2009-10-17 11:38:00 +03:00
uaccess.c Fix missing strnlen problems 2009-07-01 18:24:44 +00:00
vm86.c Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00