[PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1

Michael Ellerman mpe at ellerman.id.au
Tue Jan 17 16:46:47 AEDT 2017

Madhavan Srinivasan <maddy at linux.vnet.ibm.com> writes:

> "use_siar" variable is primarily used for deciding the sampled address
> and the privilege level to be reported for a sample. perf_read_regs()
> function updates the "use_siar" and "regs->result" based on the pmu
> flags along with other checks. To force the use of MSR to report the
> privilege level and to use "regs->nip" to report the instruction pointer,
> set "PPMU_NO_CONT_SAMPLING" flag and remove "PPMU_HAS_SIER" from the
> ppmu->flags.

This still won't work for marked events AFAICS:

	if (TRAP(regs) != 0xf00)
		use_siar = 0;
	else if (marked)
		use_siar = 1;
	else if ((ppmu->flags & PPMU_NO_CONT_SAMPLING))
		use_siar = 0;
	else if (!(ppmu->flags & PPMU_NO_SIPR) && regs_sipr(regs))
		use_siar = 0;
		use_siar = 1;

So perhaps we just want a USE_SIAR flag?

And I don't see how HAS_SIER is related? Or is SIER broken too?


More information about the Linuxppc-dev mailing list