copy-ref-dumps: don't copy empty files

Empty dump files are not useful for the test code.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
qemu_cpu.cfg: fix typo on cpu64-rhel5 variant name

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
qemu_cpu.cfg: unify similar rules in a single one

Simplify the config file a little bit.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
cpuid: don't setup USB devices

The CPUID dump test kernel doesn't need USB devices.

This allows some older QEMU versions to be tested.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
cpuid: handle "restricted to guest" message as TestNAError too

The RHEL-6 qemu-kvm binary prints that message when SVM is not available
and can't be used. Treat this case as TestNAError too, as it means the
test can't be run, not a test failure.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
qemu_cpu.cfg: ignore known Opteron_G* CPUID difference introduce on RHEL-6.1

Those bits were changed on RHEL-6.1 without any compat code, so we need
to ignore the differences we find.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
cpuid: check_cpuid_dump: use cpu_model_flags

Use cpu_model_flags when running the test and reading CPUID dumps.

In some cases it will be useful to check if dumps are OK on specific
cases where flags are removed (e.g. removing the "svm" flag when running
without -enable-nesting). This change will allow dumps for those special
cases to be used if cpu_model_flags is configured on qemu_cpu.cfg.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
dump-cpus-from-qemu: allow list of CPU models to be specified via env var

Helpful for testing and for saving time when just a few CPU models need
to be dumped again.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
dump-cpus-from-qemu: dump some additional special cases

They will be useful when some features are not available on the host.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
cpuid: added new CPUID dumps

This includes:

 * Opteron_G* CPU model dumps
 * Dumps for CPUs having 3dnow & 3dnowext (they couldn't be generated
   previously because the machine didn't have 3dnow available)
 * Some new special-cases that will be used (e.g. removing the "svm"
   and/or "monitor" flags) when the original CPU model can't be tested
   as-is

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
qemu_cpu.cfg: exceptions for cases where the full CPU model can't be tested

Add extra CPU model flags to some CPU models when the full CPU model
can't be tested easily.

Note that the code loads the reference files using the CPU flags as part
of the file name too (so we can be sure we're reading the right dump
file)  This way we can be sure we are comparing the output of "-cpu
Foo,-flag" against a dump that was surely generated using "-cpu
Foo,-flag" as well (not just "-cpu Foo").

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
qemu_cpu.cfg: introduce rhel_major_version variant name

This way we can make filters that include/exclude all RHEL-6 versions.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: host_cpu_vendor variants

This will allow us to filter/document cases that require a specific host
CPU vendor. Enable only host_cpu_vendor=unknown by default.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: run full_dump test case only on kvm mode

We don't have any dumps for nokvm mode, so there's no point in enabling
all those variants that won't run because of missing dump files.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
dump-cpus-from-qemu: additional special cases

Dump some additional models using "-abm,-sse4a".

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid_dumps: additional CPUID dumps

Add dumps with "+apic" flags for some models, and with "-abm,-sse4a" for
some other models.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: rules to set cpu_model_flags on specific cases

Add some new variants/rules that will run some tests using
additional cpu_model_flags values. Especially:

 * CPU models that require "+apic" to be run on RHEL-6 hosts on Intel
   CPUs
 * CPU models that require "-abm,-sse4a" on Intel CPUs
 * CPU models that require using "-svm" because we don't enable nesting
   by default

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: fix exception message for missing CPU models

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: RHEL-6 doesn t have kvm32 CPU model

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>