KVM: x86/mmu: Rename "nxe" role bit to "efer_nx" for macro shenanigans
authorSean Christopherson <seanjc@google.com>
Tue, 22 Jun 2021 17:57:09 +0000 (10:57 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 22:00:41 +0000 (18:00 -0400)
Rename "nxe" to "efer_nx" so that future macro magic can use the pattern
<reg>_<bit> for all CR0, CR4, and EFER bits that included in the role.
Using "efer_nx" also makes it clear that the role bit reflects EFER.NX,
not the NX bit in the corresponding PTE.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-25-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/mmu.rst
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmutrace.h
tools/lib/traceevent/plugins/plugin_kvm.c

index ddbb23998742c6460d8874fcfab22e46f205b6be..f60f5488e12193d3384474093e5d7c90e2dbde17 100644 (file)
@@ -180,8 +180,8 @@ Shadow pages contain the following information:
   role.gpte_is_8_bytes:
     Reflects the size of the guest PTE for which the page is valid, i.e. '1'
     if 64-bit gptes are in use, '0' if 32-bit gptes are in use.
-  role.nxe:
-    Contains the value of efer.nxe for which the page is valid.
+  role.efer_nx:
+    Contains the value of efer.nx for which the page is valid.
   role.cr0_wp:
     Contains the value of cr0.wp for which the page is valid.
   role.smep_andnot_wp:
index 250915da1681df9004409a8e9ff3e019c3b43be2..520140eed4239b64cd7804b2e4ef34caaac6da9d 100644 (file)
@@ -274,7 +274,7 @@ struct kvm_kernel_irq_routing_entry;
  * by indirect shadow page can not be more than 15 bits.
  *
  * Currently, we used 14 bits that are @level, @gpte_is_8_bytes, @quadrant, @access,
- * @nxe, @cr0_wp, @smep_andnot_wp and @smap_andnot_wp.
+ * @efer_nx, @cr0_wp, @smep_andnot_wp and @smap_andnot_wp.
  */
 union kvm_mmu_page_role {
        u32 word;
@@ -285,7 +285,7 @@ union kvm_mmu_page_role {
                unsigned direct:1;
                unsigned access:3;
                unsigned invalid:1;
-               unsigned nxe:1;
+               unsigned efer_nx:1;
                unsigned cr0_wp:1;
                unsigned smep_andnot_wp:1;
                unsigned smap_andnot_wp:1;
index 81992ba2899fb5027859c6d88b6e2b5599ec117d..25f23de89cdff1f9e5d4830ee449d9e504ad94bb 100644 (file)
@@ -4567,7 +4567,7 @@ static union kvm_mmu_role kvm_calc_mmu_role_common(struct kvm_vcpu *vcpu,
        union kvm_mmu_role role = {0};
 
        role.base.access = ACC_ALL;
-       role.base.nxe = ____is_efer_nx(regs);
+       role.base.efer_nx = ____is_efer_nx(regs);
        role.base.cr0_wp = ____is_cr0_wp(regs);
        role.base.smm = is_smm(vcpu);
        role.base.guest_mode = is_guest_mode(vcpu);
index e798489b56b55dd72f42ceb6e2b9570f915e4b01..efbad33a064578b8953ae96dabf49277ba0b128c 100644 (file)
@@ -40,7 +40,7 @@
                         role.direct ? " direct" : "",                  \
                         access_str[role.access],                       \
                         role.invalid ? " invalid" : "",                \
-                        role.nxe ? "" : "!",                           \
+                        role.efer_nx ? "" : "!",                       \
                         role.ad_disabled ? "!" : "",                   \
                         __entry->root_count,                           \
                         __entry->unsync ? "unsync" : "sync", 0);       \
index 51ceeb9147eb61b78e839794707f8f0e7e3db7bf..9ce7b4b68e3fe3ff612f38749ff7622389c9219a 100644 (file)
@@ -366,7 +366,7 @@ union kvm_mmu_page_role {
                unsigned direct:1;
                unsigned access:3;
                unsigned invalid:1;
-               unsigned nxe:1;
+               unsigned efer_nx:1;
                unsigned cr0_wp:1;
                unsigned smep_and_not_wp:1;
                unsigned smap_and_not_wp:1;
@@ -403,7 +403,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
                                 access_str[role.access],
                                 role.invalid ? " invalid" : "",
                                 role.cr4_pae ? "" : "!",
-                                role.nxe ? "" : "!",
+                                role.efer_nx ? "" : "!",
                                 role.cr0_wp ? "" : "!",
                                 role.smep_and_not_wp ? " smep" : "",
                                 role.smap_and_not_wp ? " smap" : "",