target/i386: ignore CPL0-specific features in user mode emulation
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 20 Jun 2023 23:17:28 +0000 (01:17 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 29 Jun 2023 08:49:43 +0000 (10:49 +0200)
commitd903259dd2dbe40e007db1724dd072c5e210b3f4
tree156e1ba78926e87dba5048b00a48462ce3c41ddf
parent9fb4f5f5a1fd7619e221fd5068003c5b491b2bf0
target/i386: ignore CPL0-specific features in user mode emulation

Features such as PCID are only accessible through privileged operations,
and therefore have no impact on any user-mode operation.  Allow reporting
them to programs running under user mode emulation, so that "-cpu" can be
used with more named CPU models.

XSAVES would be similar, but it doesn't make sense to provide it until
XSAVEC is implemented.

With this change, all CPUs up to Broadwell-v4 can be emulate.  Skylake-Client
requires XSAVEC, while EPYC also requires SHA-NI, MISALIGNSSE and TOPOEXT.
MISALIGNSSE is not hard to implement, but I am not sure it is worth using
a precious hflags bit for it.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1534
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c