[3/5] x86/kvm: Make kvm_async_pf_enabled __ro_after_init

Message ID 20231120105528.760306-4-vschneid@redhat.com
State New
Headers
Series jump_label: Fix __ro_after_init keys for modules & annotate some keys |

Commit Message

Valentin Schneider Nov. 20, 2023, 10:55 a.m. UTC
  kvm_async_pf_enabled is only ever enabled in __init kvm_guest_init(), so
mark it as __ro_after_init.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 arch/x86/kernel/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sean Christopherson Nov. 27, 2023, 10:20 p.m. UTC | #1
On Mon, Nov 20, 2023, Valentin Schneider wrote:
> kvm_async_pf_enabled is only ever enabled in __init kvm_guest_init(), so
> mark it as __ro_after_init.
> 
> Signed-off-by: Valentin Schneider <vschneid@redhat.com>
> ---

Reviewed-by: Sean Christopherson <seanjc@google.com>
  

Patch

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 0ddb3bd0f1aac..146e16f420edf 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -44,7 +44,7 @@ 
 #include <asm/svm.h>
 #include <asm/e820/api.h>
 
-DEFINE_STATIC_KEY_FALSE(kvm_async_pf_enabled);
+DEFINE_STATIC_KEY_FALSE_RO(kvm_async_pf_enabled);
 
 static int kvmapf = 1;