@@ -61,7 +61,7 @@ static enum kvm_wfx_trap_policy kvm_wfe_trap_policy __read_mostly = KVM_WFX_NOTR
6161
6262DECLARE_KVM_HYP_PER_CPU (unsigned long, kvm_hyp_vector );
6363
64- DEFINE_PER_CPU (unsigned long, kvm_arm_hyp_stack_page );
64+ DEFINE_PER_CPU (unsigned long, kvm_arm_hyp_stack_base );
6565DECLARE_KVM_NVHE_PER_CPU (struct kvm_nvhe_init_params , kvm_init_params );
6666
6767DECLARE_KVM_NVHE_PER_CPU (struct kvm_cpu_context , kvm_hyp_ctxt );
@@ -2339,7 +2339,7 @@ static void __init teardown_hyp_mode(void)
23392339
23402340 free_hyp_pgds ();
23412341 for_each_possible_cpu (cpu ) {
2342- free_page (per_cpu (kvm_arm_hyp_stack_page , cpu ));
2342+ free_pages (per_cpu (kvm_arm_hyp_stack_base , cpu ), NVHE_STACK_SHIFT - PAGE_SHIFT );
23432343 free_pages (kvm_nvhe_sym (kvm_arm_hyp_percpu_base )[cpu ], nvhe_percpu_order ());
23442344
23452345 if (free_sve ) {
@@ -2527,15 +2527,15 @@ static int __init init_hyp_mode(void)
25272527 * Allocate stack pages for Hypervisor-mode
25282528 */
25292529 for_each_possible_cpu (cpu ) {
2530- unsigned long stack_page ;
2530+ unsigned long stack_base ;
25312531
2532- stack_page = __get_free_page (GFP_KERNEL );
2533- if (!stack_page ) {
2532+ stack_base = __get_free_pages (GFP_KERNEL , NVHE_STACK_SHIFT - PAGE_SHIFT );
2533+ if (!stack_base ) {
25342534 err = - ENOMEM ;
25352535 goto out_err ;
25362536 }
25372537
2538- per_cpu (kvm_arm_hyp_stack_page , cpu ) = stack_page ;
2538+ per_cpu (kvm_arm_hyp_stack_base , cpu ) = stack_base ;
25392539 }
25402540
25412541 /*
@@ -2604,9 +2604,9 @@ static int __init init_hyp_mode(void)
26042604 */
26052605 for_each_possible_cpu (cpu ) {
26062606 struct kvm_nvhe_init_params * params = per_cpu_ptr_nvhe_sym (kvm_init_params , cpu );
2607- char * stack_page = (char * )per_cpu (kvm_arm_hyp_stack_page , cpu );
2607+ char * stack_base = (char * )per_cpu (kvm_arm_hyp_stack_base , cpu );
26082608
2609- err = create_hyp_stack (__pa (stack_page ), & params -> stack_hyp_va );
2609+ err = create_hyp_stack (__pa (stack_base ), & params -> stack_hyp_va );
26102610 if (err ) {
26112611 kvm_err ("Cannot map hyp stack\n" );
26122612 goto out_err ;
@@ -2618,7 +2618,7 @@ static int __init init_hyp_mode(void)
26182618 * __hyp_pa() won't do the right thing there, since the stack
26192619 * has been mapped in the flexible private VA space.
26202620 */
2621- params -> stack_pa = __pa (stack_page );
2621+ params -> stack_pa = __pa (stack_base );
26222622 }
26232623
26242624 for_each_possible_cpu (cpu ) {
0 commit comments