Add support for userspace MSR handling. This is done by enabling the KVM_CAP_X86_USER_SPACE_MSR capability, which enables two new exits, KVM_EXIT_X86_RDMSR and KVM_EXIT_X86_WRMSR. This allows a VMM to intercept reads and writes to invalid MSRs instead of having KVM automatically inject a #GP into the guest.
This PR adds safe wrappers around KVM_CAP_X86_USER_SPACE_MSR, KVM_EXIT_X86_RDMSR and KVM_EXIT_X86_WRMSR, some helper types and 2 relevant tests.
Requirements
[X] All commits in this PR are signed (with git commit -s), and the commit
message has max 60 characters for the summary and max 75 characters for each
description line.
[X] All added/changed functionality has a corresponding unit/integration
test.
[X] All added/changed public-facing functionality has entries in the "Upcoming
Release" section of CHANGELOG.md (if no such section exists, please create one).
[X] Any newly added unsafe code is properly documented.
Summary of the PR
Add support for userspace MSR handling. This is done by enabling the
KVM_CAP_X86_USER_SPACE_MSR
capability, which enables two new exits,KVM_EXIT_X86_RDMSR
andKVM_EXIT_X86_WRMSR
. This allows a VMM to intercept reads and writes to invalid MSRs instead of having KVM automatically inject a#GP
into the guest.This PR adds safe wrappers around
KVM_CAP_X86_USER_SPACE_MSR
,KVM_EXIT_X86_RDMSR
andKVM_EXIT_X86_WRMSR
, some helper types and 2 relevant tests.Requirements
git commit -s
), and the commit message has max 60 characters for the summary and max 75 characters for each description line.unsafe
code is properly documented.