Merge branch 'topic/ppc-kvm' into next
[sfrench/cifs-2.6.git] / arch / powerpc / kernel / security.c
index 118f10d14af82c06bb2029f574a98353416534b5..9c2f7b90991163093dc0ec5f3b9baaf0ddf6456b 100644 (file)
@@ -432,16 +432,19 @@ device_initcall(stf_barrier_debugfs_init);
 
 static void update_branch_cache_flush(void)
 {
-       u32 *site;
+       u32 *site, __maybe_unused *site2;
 
 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
        site = &patch__call_kvm_flush_link_stack;
+       site2 = &patch__call_kvm_flush_link_stack_p9;
        // This controls the branch from guest_exit_cont to kvm_flush_link_stack
        if (link_stack_flush_type == BRANCH_CACHE_FLUSH_NONE) {
                patch_instruction_site(site, ppc_inst(PPC_RAW_NOP()));
+               patch_instruction_site(site2, ppc_inst(PPC_RAW_NOP()));
        } else {
                // Could use HW flush, but that could also flush count cache
                patch_branch_site(site, (u64)&kvm_flush_link_stack, BRANCH_SET_LINK);
+               patch_branch_site(site2, (u64)&kvm_flush_link_stack, BRANCH_SET_LINK);
        }
 #endif