[PATCH v5 06/10] powerpc64/ftrace: Disable ftrace during kvm entry/exit

Naveen N. Rao naveen.n.rao at linux.vnet.ibm.com
Fri Apr 20 16:31:32 AEST 2018


Steven Rostedt wrote:
> On Thu, 19 Apr 2018 12:34:05 +0530
> "Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> wrote:
> 
>> 2. If we are a secondary thread in Power8, then we would be in nap due
>> to SMT being disabled. We are woken up by an IPI to enter the guest. In
>> this scenario, we enter the guest through kvm_start_guest(). We disable
>> ftrace at this point. In this scenario, ftrace would only get re-enabled
>> on the secondary thread when SMT is re-enabled (via start_secondary()).
>> 
> 	trace_hardirqs_off();
>> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
>> index bd63fa8a08b5..2c3cbe0067b2 100644
>> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
>> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
>> @@ -342,6 +342,9 @@ kvm_start_guest:
>>  
>>  	ld	r2,PACATOC(r13)
>>  
> 
> You may want to add a comment here about where ftrace gets re-enabled.

Sure. That would be:

/*
 * If this is the primary thread, ftrace will get re-enabled when we
 * go back to the hypervisor in kvmppc_run_core(). For secondary threads 
 * on Power8, ftrace will get enabled when SMT is re-enabled through the 
 * start_secondary() cpu bringup path.
 */

- Naveen




More information about the Linuxppc-dev mailing list