Skip to content

Add and use helpers to check bit set in CR0/CR4

Binbin Wu kvm 1 version Applied

Status from this message: Applied to kvm-x86 misc, with a fair bit of massaging to the changelogs.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4KVM: x86: Add helpers to check bit set in CR0/CR4 and return in boolarch/x86/kvm/kvm_cache_regs.h+16 -00 replies
2/4KVM: x86: Replace kvm_read_{cr0,cr4}_bits() with kvm_is_{cr0,cr4}_bit_set()arch/x86/kvm/cpuid.c arch/x86/kvm/mmu.h arch/x86/kvm/vmx/nested.c +3 more+23 -232 replies
3/4KVM: SVM: Remove implicit cast from ulong to bool in svm_can_emulate_instruction()arch/x86/kvm/svm/svm.c+3 -60 replies
4/4KVM: x86: Change return type of is_long_mode() to boolarch/x86/kvm/x86.h+3 -31 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchKai Huang
1/4
2/4
3/4
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] Add and use helpers to check bit set in CR0/CR4

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/[email protected]),
and suggested by Sean Christopherson during code review
(https://lore.kernel.org/all/[email protected]).

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(-)
Signature · 1 line
2.25.1