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: add variants for qemu64/cpu64-rhel* that run on Intel CPUs

As we can't run "-cpu qemu64" and "-cpu cpu64-rhel[56]" on an Intel CPU
host because of the "abm" and "sse4a" flags, add variants that will test
those models by explicitly removing "abm" and "sse4a".

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: don't run full_dump variant on nokvm mode

We don't have CPU dumps for TCG mode yet, so there's no point in
enabling the test on "nokvm" mode.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
dump-cpus-from-qemu: add special cases adding "+apic" flag to some CPU models

They will be useful on some cases where it's not possible to boot a few CPU
models without the "apic" flag.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
cpuid_dumps: new dumps for "<model>,+apic" cases

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
qemu_cpu.cfg: add special cases for 486/pentium* with apic flag

On some hosts (e.g. when using RHEL-6 seabios version), it is not
possible to boot CPU models without the "apic" flag, so add variants
that allow those CPU models to be tested by explicitly setting the
"apic" flag.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
add variants for host CPU vendor

This way we can exclude some cases if we know they won't work on a
specific system.

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

This way we can filter test cases depending on the RHEL major version,
too.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: 486 won't boot without "apic" flag, either

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

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