kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add and use helpers to check bit set in CR0/CR4
@ 2023-03-22  4:58 Binbin Wu
  2023-03-22  4:58 ` [PATCH 1/4] KVM: x86: Add helpers to check bit set in CR0/CR4 and return in bool Binbin Wu
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Binbin Wu @ 2023-03-22  4:58 UTC (permalink / raw)
  To: kvm, seanjc, pbonzini; +Cc: binbin.wu, robert.hu

Add two helpers
- kvm_is_cr0_bit_set()
- kvm_is_cr4_bit_set()
to do CR0/CR4 check on one specific bit and return the value in bool.
Replace kvm_read_{cr0,cr4}_bits() with kvm_is_{cr0,cr4}_bit_set() when applicable.

Also change return type of is_pae(), is_pse(), is_paging() and is_long_mode()
to bool.

No functional change intended.

The patch series is originated from cleanup code of KVM LAM enabling patchset by
Robert Hu
(https://lore.kernel.org/all/20230227084547.404871-3-robert.hu@linux.intel.com),
and suggested by Sean Christopherson during code review
(https://lore.kernel.org/all/ZAuRec2NkC3+4jvD@google.com).

Binbin Wu (4):
  KVM: x86: Add helpers to check bit set in CR0/CR4 and return in bool
  KVM: x86: Replace kvm_read_{cr0,cr4}_bits() with
    kvm_is_{cr0,cr4}_bit_set()
  KVM: SVM: Remove implicit cast from ulong to bool in
    svm_can_emulate_instruction()
  KVM: x86: Change return type of is_long_mode() to bool

 arch/x86/kvm/cpuid.c          |  4 ++--
 arch/x86/kvm/kvm_cache_regs.h | 16 ++++++++++++++++
 arch/x86/kvm/mmu.h            |  2 +-
 arch/x86/kvm/svm/svm.c        |  9 +++------
 arch/x86/kvm/vmx/nested.c     |  2 +-
 arch/x86/kvm/vmx/vmx.c        |  2 +-
 arch/x86/kvm/x86.c            | 20 ++++++++++----------
 arch/x86/kvm/x86.h            | 22 +++++++++++-----------
 8 files changed, 45 insertions(+), 32 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2023-03-23 22:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-22  4:58 [PATCH 0/4] Add and use helpers to check bit set in CR0/CR4 Binbin Wu
2023-03-22  4:58 ` [PATCH 1/4] KVM: x86: Add helpers to check bit set in CR0/CR4 and return in bool Binbin Wu
2023-03-22  4:58 ` [PATCH 2/4] KVM: x86: Replace kvm_read_{cr0,cr4}_bits() with kvm_is_{cr0,cr4}_bit_set() Binbin Wu
2023-03-22 17:21   ` Sean Christopherson
2023-03-23  1:09     ` Binbin Wu
2023-03-22  4:58 ` [PATCH 3/4] KVM: SVM: Remove implicit cast from ulong to bool in svm_can_emulate_instruction() Binbin Wu
2023-03-22  4:58 ` [PATCH 4/4] KVM: x86: Change return type of is_long_mode() to bool Binbin Wu
2023-03-22 22:33   ` Huang, Kai
2023-03-23 22:47 ` [PATCH 0/4] Add and use helpers to check bit set in CR0/CR4 Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).