All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/3] MSR filtering / exiting flag cleanup
@ 2022-07-19 23:49 Aaron Lewis
  2022-07-19 23:49 ` [RFC PATCH v2 1/3] KVM: x86: Protect the unused bits in the MSR filtering / exiting flags Aaron Lewis
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Aaron Lewis @ 2022-07-19 23:49 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, jmattson, seanjc, Aaron Lewis

Posting as an RFC to get feedback whether it's too late to protect the
unused flag bits.  My hope is this feature is still new enough, and not
widely used enough, and this change is reasonable enough to be able to be
corrected.  These bits should have been protected from the start, but
unfortunately they were not.

Other approaches to fixing this could be to fix it with a quirk, or the
tried and true KVM method of adding a "2" (e.g. KVM_CAP_X86_USER_SPACE_MSR2).
Both approaches, however, complicate the code more than it would otherwise
be if the original feature could be patched.

For long term simplicity my hope is to be able to just patch
the original change.

Note: the second patch in this series does not contain any functional changes,
so it is not an RFC.  The others do, so they are.

v1 -> v2
 - Added valid masks KVM_MSR_FILTER_VALID_MASK and
   KVM_MSR_EXIT_REASON_VALID_MASK.
 - Added patch 2/3 to add valid mask KVM_MSR_FILTER_RANGE_VALID_MASK, and
   use it.
 - Added testing to demonstrate flag protection when calling the ioctl for
   KVM_X86_SET_MSR_FILTER or KVM_CAP_X86_USER_SPACE_MSR.

Aaron Lewis (3):
  KVM: x86: Protect the unused bits in the MSR filtering / exiting flags
  KVM: x86: Add a VALID_MASK for the flags in kvm_msr_filter_range
  selftests: kvm/x86: Test the flags in MSR filtering / exiting

 arch/x86/include/uapi/asm/kvm.h               |  3 +
 arch/x86/kvm/x86.c                            |  8 +-
 include/uapi/linux/kvm.h                      |  3 +
 .../kvm/x86_64/userspace_msr_exit_test.c      | 95 +++++++++++++++++++
 4 files changed, 108 insertions(+), 1 deletion(-)

-- 
2.37.1.359.gd136c6c3e2-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-07-22 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19 23:49 [RFC PATCH v2 0/3] MSR filtering / exiting flag cleanup Aaron Lewis
2022-07-19 23:49 ` [RFC PATCH v2 1/3] KVM: x86: Protect the unused bits in the MSR filtering / exiting flags Aaron Lewis
2022-07-20 23:31   ` Sean Christopherson
2022-07-22 15:35     ` Aaron Lewis
2022-07-19 23:49 ` [PATCH v2 2/3] KVM: x86: Add a VALID_MASK for the flags in kvm_msr_filter_range Aaron Lewis
2022-07-19 23:49 ` [RFC PATCH v2 3/3] selftests: kvm/x86: Test the flags in MSR filtering / exiting Aaron Lewis
2022-07-20 23:23   ` Sean Christopherson
2022-07-21  2:28     ` Aaron Lewis
2022-07-21 16:21       ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.