static int __init feat_enable_pmu_power8(struct dt_cpu_feature *f) { hfscr_pmu_enable(); init_pmu_power8(); init_pmu_registers = init_pmu_power8; cur_cpu_spec->cpu_features |= CPU_FTR_MMCRA; cur_cpu_spec->cpu_user_features |= PPC_FEATURE_PSERIES_PERFMON_COMPAT; if (pvr_version_is(PVR_POWER8E)) cur_cpu_spec->cpu_features |= CPU_FTR_PMAO_BUG; cur_cpu_spec->num_pmcs = 6; cur_cpu_spec->pmc_type = PPC_PMC_IBM; cur_cpu_spec->oprofile_cpu_type = "ppc64/power8"; return 1; }
long hmi_exception_realmode(struct pt_regs *regs) { __this_cpu_inc(irq_stat.hmi_exceptions); #ifdef CONFIG_PPC_BOOK3S_64 /* Workaround for P9 vector CI loads (see p9_hmi_special_emu) */ if (pvr_version_is(PVR_POWER9)) { unsigned long hmer = mfspr(SPRN_HMER); /* Do we have the debug bit set */ if (hmer & PPC_BIT(17)) { hmer &= ~PPC_BIT(17); mtspr(SPRN_HMER, hmer); /* * Now to avoid problems with soft-disable we * only do the emulation if we are coming from * user space */ if (user_mode(regs)) local_paca->hmi_p9_special_emu = 1; /* * Don't bother going to OPAL if that's the * only relevant bit. */ if (!(hmer & mfspr(SPRN_HMEER))) return local_paca->hmi_p9_special_emu; } } #endif /* CONFIG_PPC_BOOK3S_64 */ wait_for_subcore_guest_exit(); if (ppc_md.hmi_exception_early) ppc_md.hmi_exception_early(regs); wait_for_tb_resync(); return 1; }