File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ extern u32 __boot_cpu_mode[2];
78
78
79
79
void __hyp_set_vectors (phys_addr_t phys_vector_base );
80
80
void __hyp_reset_vectors (void );
81
+ bool is_kvm_arm_initialised (void );
81
82
82
83
DECLARE_STATIC_KEY_FALSE (kvm_protected_mode_initialized );
83
84
Original file line number Diff line number Diff line change @@ -51,11 +51,16 @@ DECLARE_KVM_HYP_PER_CPU(unsigned long, kvm_hyp_vector);
51
51
DEFINE_PER_CPU (unsigned long, kvm_arm_hyp_stack_page );
52
52
DECLARE_KVM_NVHE_PER_CPU (struct kvm_nvhe_init_params , kvm_init_params );
53
53
54
- static bool vgic_present ;
54
+ static bool vgic_present , kvm_arm_initialised ;
55
55
56
56
static DEFINE_PER_CPU (unsigned char , kvm_arm_hardware_enabled );
57
57
DEFINE_STATIC_KEY_FALSE (userspace_irqchip_in_use );
58
58
59
+ bool is_kvm_arm_initialised (void )
60
+ {
61
+ return kvm_arm_initialised ;
62
+ }
63
+
59
64
int kvm_arch_vcpu_should_kick (struct kvm_vcpu * vcpu )
60
65
{
61
66
return kvm_vcpu_exiting_guest_mode (vcpu ) == IN_GUEST_MODE ;
@@ -2396,6 +2401,8 @@ static __init int kvm_arm_init(void)
2396
2401
if (err )
2397
2402
goto out_subs ;
2398
2403
2404
+ kvm_arm_initialised = true;
2405
+
2399
2406
return 0 ;
2400
2407
2401
2408
out_subs :
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ static int __init finalize_pkvm(void)
243
243
{
244
244
int ret ;
245
245
246
- if (!is_protected_kvm_enabled ())
246
+ if (!is_protected_kvm_enabled () || ! is_kvm_arm_initialised () )
247
247
return 0 ;
248
248
249
249
/*
You can’t perform that action at this time.
0 commit comments