mbox series

[v5,0/6] target/i386: Restrict system-specific features from user emulation

Message ID 20230913093009.83520-1-philmd@linaro.org (mailing list archive)
Headers show
Series target/i386: Restrict system-specific features from user emulation | expand

Message

Philippe Mathieu-Daudé Sept. 13, 2023, 9:30 a.m. UTC
Since v4:
- Addressed Paolo's suggestions (clearly better)

Too many system-specific code (and in particular KVM related)
is pulled in user-only build. This led to adding unjustified
stubs as kludge to unagressive linker non-optimizations.

This series restrict x86 system-specific features to sysemu,
so we don't require any stub, and remove all x86 KVM declarations
from user emulation code (to trigger compile failure instead of
link one).

Philippe Mathieu-Daudé (6):
  target/i386: Check kvm_hyperv_expand_features() return value
  target/i386: Drop accel_uses_host_cpuid before
    x86_cpu_get_supported_cpuid
  target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()
  target/i386: Move x86_cpu_get_migratable_flags() around
  RFC target/i386: Restrict system-specific code from user emulation
  target/i386: Prohibit target specific KVM prototypes on user emulation

 target/i386/kvm/kvm_i386.h |   4 ++
 target/i386/cpu.c          | 134 +++++++++++++++++++++++--------------
 2 files changed, 88 insertions(+), 50 deletions(-)

Comments

Paolo Bonzini Sept. 13, 2023, 10:29 a.m. UTC | #1
On 9/13/23 11:30, Philippe Mathieu-Daudé wrote:
> Since v4:
> - Addressed Paolo's suggestions (clearly better)
> 
> Too many system-specific code (and in particular KVM related)
> is pulled in user-only build. This led to adding unjustified
> stubs as kludge to unagressive linker non-optimizations.
> 
> This series restrict x86 system-specific features to sysemu,
> so we don't require any stub, and remove all x86 KVM declarations
> from user emulation code (to trigger compile failure instead of
> link one).

I'm still not sure about patch 5, though I'd like to have something like 
patch 6.  But fortunately patches 1-3 are enough to placate clang, so I 
have queued them.

Thanks Philippe!

Paolo