Skip to contentSkip to conversation

KVM: Fix some comments

PATCH Superseded Binbin Wu 2 participants 6 messages Apr 23, 2023 – May 18, 2023

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Binbin Wu

author
#0 lore raw

cover KVM: Fix some comments

Fix comments for KVM_ENABLE_CAP.
Update msrs_to_save_all to msrs_to_save_base in comments. Fix a typo in x86/mmu.rst

Binbin Wu (2):
KVM: Fix comments for KVM_ENABLE_CAP
KVM: x86: Fix some comments

 Documentation/virt/kvm/x86/mmu.rst | 2 +-
 arch/x86/kvm/x86.c                 | 4 ++--
 include/uapi/linux/kvm.h           | 2 +-
 tools/include/uapi/linux/kvm.h     | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

base-commit: cf9f4c0eb1699d306e348b1fd0225af7b2c282d3

Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/2 KVM: Fix comments for KVM_ENABLE_CAP

---
 include/uapi/linux/kvm.h       | 2 +-
 tools/include/uapi/linux/kvm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/kvm.h +1 -1
index 4003a166328c..1a5cc4c6b59b 100644
@@ -1605,7 +1605,7 @@ struct kvm_s390_ucas_mapping {
 #define KVM_GET_DEBUGREGS         _IOR(KVMIO,  0xa1, struct kvm_debugregs)
 #define KVM_SET_DEBUGREGS         _IOW(KVMIO,  0xa2, struct kvm_debugregs)
 /*
- * vcpu version available with KVM_ENABLE_CAP
+ * vcpu version available with KVM_CAP_ENABLE_CAP
  * vm version available with KVM_CAP_ENABLE_CAP_VM
  */
 #define KVM_ENABLE_CAP            _IOW(KVMIO,  0xa3, struct kvm_enable_cap)
tools/include/uapi/linux/kvm.h +1 -1
index 4003a166328c..1a5cc4c6b59b 100644
@@ -1605,7 +1605,7 @@ struct kvm_s390_ucas_mapping {
 #define KVM_GET_DEBUGREGS         _IOR(KVMIO,  0xa1, struct kvm_debugregs)
 #define KVM_SET_DEBUGREGS         _IOW(KVMIO,  0xa2, struct kvm_debugregs)
 /*
- * vcpu version available with KVM_ENABLE_CAP
+ * vcpu version available with KVM_CAP_ENABLE_CAP
  * vm version available with KVM_CAP_ENABLE_CAP_VM
  */
 #define KVM_ENABLE_CAP            _IOW(KVMIO,  0xa3, struct kvm_enable_cap)
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/2] KVM: Fix comments for KVM_ENABLE_CAP

On Sun, Apr 23, 2023, Binbin Wu wrote:

Please write a changelog, I'm not willing to trudge through KVM's capability mess to determine whether or not this is correct without some effort on your part to point me in the right direction.

tools/include/uapi/linux/kvm.h

Quoted 23 lines
---
 include/uapi/linux/kvm.h       | 2 +-
 tools/include/uapi/linux/kvm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/kvm.h +1 -1
index 4003a166328c..1a5cc4c6b59b 100644
@@ -1605,7 +1605,7 @@ struct kvm_s390_ucas_mapping {
 #define KVM_GET_DEBUGREGS         _IOR(KVMIO,  0xa1, struct kvm_debugregs)
 #define KVM_SET_DEBUGREGS         _IOW(KVMIO,  0xa2, struct kvm_debugregs)
 /*
- * vcpu version available with KVM_ENABLE_CAP
+ * vcpu version available with KVM_CAP_ENABLE_CAP
  * vm version available with KVM_CAP_ENABLE_CAP_VM
  */
 #define KVM_ENABLE_CAP            _IOW(KVMIO,  0xa3, struct kvm_enable_cap)
tools/include/uapi/linux/kvm.h +0 -0
index 4003a166328c..1a5cc4c6b59b 100644

Unless someone objects, please drop the tools/ change and let the perf folks deal with their mess.

https://lore.kernel.org/all/Y8bZ%2FJ98V5i3wG%[email protected]

author
#3 lore raw

PATCH 2/2 KVM: x86: Fix some comments

In reply to Binbin Wu

msrs_to_save_all is out-dated after commit 2374b7310b66 (KVM: x86/pmu: Use separate array for defining "PMU MSRs to save"). Update the comments to msrs_to_save_base.

Fix a typo in x86 mmu.rst.

---
 Documentation/virt/kvm/x86/mmu.rst | 2 +-
 arch/x86/kvm/x86.c                 | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/virt/kvm/x86/mmu.rst +1 -1
index 8364afa228ec..26f62034b6f3 100644
@@ -205,7 +205,7 @@ Shadow pages contain the following information:
   role.passthrough:
     The page is not backed by a guest page table, but its first entry
     points to one.  This is set if NPT uses 5-level page tables (host
-    CR4.LA57=1) and is shadowing L1's 4-level NPT (L1 CR4.LA57=1).
+    CR4.LA57=1) and is shadowing L1's 4-level NPT (L1 CR4.LA57=0).
   gfn:
     Either the guest page table containing the translations shadowed by this
     page, or the base page frame for linear translations.  See role.direct.
arch/x86/kvm/x86.c +2 -2
index 1b74da8682a0..d02150a1c909 100644
@@ -1430,7 +1430,7 @@ EXPORT_SYMBOL_GPL(kvm_emulate_rdpmc);
  *
  * The three MSR lists(msrs_to_save, emulated_msrs, msr_based_features)
  * extract the supported MSRs from the related const lists.
- * msrs_to_save is selected from the msrs_to_save_all to reflect the
+ * msrs_to_save is selected from the msrs_to_save_base to reflect the
  * capabilities of the host cpu. This capabilities test skips MSRs that are
  * kvm-specific. Those are put in emulated_msrs_all; filtering of emulated_msrs
  * may depend on host virtualization features rather than host cpu features.
@@ -1533,7 +1533,7 @@ static const u32 emulated_msrs_all[] = {
 	 * by arch/x86/kvm/vmx/nested.c based on CPUID or other MSRs.
 	 * We always support the "true" VMX control MSRs, even if the host
 	 * processor does not, so I am putting these registers here rather
-	 * than in msrs_to_save_all.
+	 * than in msrs_to_save_base.
 	 */
 	MSR_IA32_VMX_BASIC,
 	MSR_IA32_VMX_TRUE_PINBASED_CTLS,
Signature · 1 line
2.25.1
#4 lore raw

Re: [PATCH 2/2] KVM: x86: Fix some comments

Quoted 5 lines · Binbin Wu

msrs_to_save_all is out-dated after commit 2374b7310b66 (KVM: x86/pmu: Use separate array for defining "PMU MSRs to save"). Update the comments to msrs_to_save_base.

Fix a typo in x86 mmu.rst.

Please split this into two patches, these are two completely unrelated changes. Yes, they're tiny, but the mmu.rst change is more than just a trivial typo, e.g. it can't be reasonably reviewed by someone without at least passing knowledge of NPT, LA57, etc.

author
#5 lore raw

Re: [PATCH 2/2] KVM: x86: Fix some comments

Quoted 10 lines · Sean Christopherson
Quoted 5 lines · Binbin Wu

msrs_to_save_all is out-dated after commit 2374b7310b66 (KVM: x86/pmu: Use separate array for defining "PMU MSRs to save"). Update the comments to msrs_to_save_base.

Fix a typo in x86 mmu.rst.

Please split this into two patches, these are two completely unrelated changes. Yes, they're tiny, but the mmu.rst change is more than just a trivial typo, e.g. it can't be reasonably reviewed by someone without at least passing knowledge of NPT, LA57, etc.

OK, will split it. Thanks.