mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
x86/msr: Rename 'rdmsrl()' to 'rdmsrq()'
Suggested-by: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Juergen Gross <jgross@suse.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Xin Li <xin@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -3278,7 +3278,7 @@ void __init snp_secure_tsc_init(void)
|
||||
return;
|
||||
|
||||
setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
|
||||
rdmsrl(MSR_AMD64_GUEST_TSC_FREQ, tsc_freq_mhz);
|
||||
rdmsrq(MSR_AMD64_GUEST_TSC_FREQ, tsc_freq_mhz);
|
||||
snp_tsc_freq_khz = (unsigned long)(tsc_freq_mhz * 1000);
|
||||
|
||||
x86_platform.calibrate_cpu = securetsc_get_tsc_khz;
|
||||
|
||||
@@ -325,7 +325,7 @@ void amd_brs_drain(void)
|
||||
u32 brs_idx = tos - i;
|
||||
u64 from, to;
|
||||
|
||||
rdmsrl(brs_to(brs_idx), to);
|
||||
rdmsrq(brs_to(brs_idx), to);
|
||||
|
||||
/* Entry does not belong to us (as marked by kernel) */
|
||||
if (to == BRS_POISON)
|
||||
@@ -341,7 +341,7 @@ void amd_brs_drain(void)
|
||||
if (!amd_brs_match_plm(event, to))
|
||||
continue;
|
||||
|
||||
rdmsrl(brs_from(brs_idx), from);
|
||||
rdmsrq(brs_from(brs_idx), from);
|
||||
|
||||
perf_clear_branch_entry_bitfields(br+nr);
|
||||
|
||||
|
||||
@@ -659,7 +659,7 @@ static inline u64 amd_pmu_get_global_status(void)
|
||||
u64 status;
|
||||
|
||||
/* PerfCntrGlobalStatus is read-only */
|
||||
rdmsrl(MSR_AMD64_PERF_CNTR_GLOBAL_STATUS, status);
|
||||
rdmsrq(MSR_AMD64_PERF_CNTR_GLOBAL_STATUS, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -679,7 +679,7 @@ static bool amd_pmu_test_overflow_topbit(int idx)
|
||||
{
|
||||
u64 counter;
|
||||
|
||||
rdmsrl(x86_pmu_event_addr(idx), counter);
|
||||
rdmsrq(x86_pmu_event_addr(idx), counter);
|
||||
|
||||
return !(counter & BIT_ULL(x86_pmu.cntval_bits - 1));
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event,
|
||||
* prev count manually on overflow.
|
||||
*/
|
||||
while (!perf_event_try_update(event, count, 64)) {
|
||||
rdmsrl(event->hw.config_base, *config);
|
||||
rdmsrq(event->hw.config_base, *config);
|
||||
count = perf_ibs->get_count(*config);
|
||||
}
|
||||
}
|
||||
@@ -513,7 +513,7 @@ static void perf_ibs_stop(struct perf_event *event, int flags)
|
||||
if (!stopping && (hwc->state & PERF_HES_UPTODATE))
|
||||
return;
|
||||
|
||||
rdmsrl(hwc->config_base, config);
|
||||
rdmsrq(hwc->config_base, config);
|
||||
|
||||
if (stopping) {
|
||||
/*
|
||||
@@ -1256,7 +1256,7 @@ fail:
|
||||
hwc = &event->hw;
|
||||
msr = hwc->config_base;
|
||||
buf = ibs_data.regs;
|
||||
rdmsrl(msr, *buf);
|
||||
rdmsrq(msr, *buf);
|
||||
if (!(*buf++ & perf_ibs->valid_mask))
|
||||
goto fail;
|
||||
|
||||
@@ -1274,7 +1274,7 @@ fail:
|
||||
offset_max = perf_ibs_get_offset_max(perf_ibs, event, check_rip);
|
||||
|
||||
do {
|
||||
rdmsrl(msr + offset, *buf++);
|
||||
rdmsrq(msr + offset, *buf++);
|
||||
size++;
|
||||
offset = find_next_bit(perf_ibs->offset_mask,
|
||||
perf_ibs->offset_max,
|
||||
@@ -1304,17 +1304,17 @@ fail:
|
||||
if (event->attr.sample_type & PERF_SAMPLE_RAW) {
|
||||
if (perf_ibs == &perf_ibs_op) {
|
||||
if (ibs_caps & IBS_CAPS_BRNTRGT) {
|
||||
rdmsrl(MSR_AMD64_IBSBRTARGET, *buf++);
|
||||
rdmsrq(MSR_AMD64_IBSBRTARGET, *buf++);
|
||||
br_target_idx = size;
|
||||
size++;
|
||||
}
|
||||
if (ibs_caps & IBS_CAPS_OPDATA4) {
|
||||
rdmsrl(MSR_AMD64_IBSOPDATA4, *buf++);
|
||||
rdmsrq(MSR_AMD64_IBSOPDATA4, *buf++);
|
||||
size++;
|
||||
}
|
||||
}
|
||||
if (perf_ibs == &perf_ibs_fetch && (ibs_caps & IBS_CAPS_FETCHCTLEXTD)) {
|
||||
rdmsrl(MSR_AMD64_ICIBSEXTDCTL, *buf++);
|
||||
rdmsrq(MSR_AMD64_ICIBSEXTDCTL, *buf++);
|
||||
size++;
|
||||
}
|
||||
}
|
||||
@@ -1565,7 +1565,7 @@ static inline int ibs_eilvt_valid(void)
|
||||
|
||||
preempt_disable();
|
||||
|
||||
rdmsrl(MSR_AMD64_IBSCTL, val);
|
||||
rdmsrq(MSR_AMD64_IBSCTL, val);
|
||||
offset = val & IBSCTL_LVT_OFFSET_MASK;
|
||||
|
||||
if (!(val & IBSCTL_LVT_OFFSET_VALID)) {
|
||||
@@ -1680,7 +1680,7 @@ static inline int get_ibs_lvt_offset(void)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
rdmsrl(MSR_AMD64_IBSCTL, val);
|
||||
rdmsrq(MSR_AMD64_IBSCTL, val);
|
||||
if (!(val & IBSCTL_LVT_OFFSET_VALID))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ static __always_inline u64 amd_pmu_lbr_get_from(unsigned int idx)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
rdmsrl(MSR_AMD_SAMP_BR_FROM + idx * 2, val);
|
||||
rdmsrq(MSR_AMD_SAMP_BR_FROM + idx * 2, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ static __always_inline u64 amd_pmu_lbr_get_to(unsigned int idx)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
rdmsrl(MSR_AMD_SAMP_BR_FROM + idx * 2 + 1, val);
|
||||
rdmsrq(MSR_AMD_SAMP_BR_FROM + idx * 2 + 1, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -400,11 +400,11 @@ void amd_pmu_lbr_enable_all(void)
|
||||
}
|
||||
|
||||
if (cpu_feature_enabled(X86_FEATURE_AMD_LBR_PMC_FREEZE)) {
|
||||
rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
|
||||
rdmsrq(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
|
||||
wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl | DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
|
||||
}
|
||||
|
||||
rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
|
||||
rdmsrq(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
|
||||
wrmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg | DBG_EXTN_CFG_LBRV2EN);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ static void event_update(struct perf_event *event)
|
||||
|
||||
prev_pwr_acc = hwc->pwr_acc;
|
||||
prev_ptsc = hwc->ptsc;
|
||||
rdmsrl(MSR_F15H_CU_PWR_ACCUMULATOR, new_pwr_acc);
|
||||
rdmsrl(MSR_F15H_PTSC, new_ptsc);
|
||||
rdmsrq(MSR_F15H_CU_PWR_ACCUMULATOR, new_pwr_acc);
|
||||
rdmsrq(MSR_F15H_PTSC, new_ptsc);
|
||||
|
||||
/*
|
||||
* Calculate the CU power consumption over a time period, the unit of
|
||||
@@ -75,8 +75,8 @@ static void __pmu_event_start(struct perf_event *event)
|
||||
|
||||
event->hw.state = 0;
|
||||
|
||||
rdmsrl(MSR_F15H_PTSC, event->hw.ptsc);
|
||||
rdmsrl(MSR_F15H_CU_PWR_ACCUMULATOR, event->hw.pwr_acc);
|
||||
rdmsrq(MSR_F15H_PTSC, event->hw.ptsc);
|
||||
rdmsrq(MSR_F15H_CU_PWR_ACCUMULATOR, event->hw.pwr_acc);
|
||||
}
|
||||
|
||||
static void pmu_event_start(struct perf_event *event, int mode)
|
||||
|
||||
@@ -106,7 +106,7 @@ static void amd_uncore_read(struct perf_event *event)
|
||||
* read counts directly from the corresponding PERF_CTR.
|
||||
*/
|
||||
if (hwc->event_base_rdpmc < 0)
|
||||
rdmsrl(hwc->event_base, new);
|
||||
rdmsrq(hwc->event_base, new);
|
||||
else
|
||||
rdpmcl(hwc->event_base_rdpmc, new);
|
||||
|
||||
|
||||
+10
-10
@@ -693,7 +693,7 @@ void x86_pmu_disable_all(void)
|
||||
|
||||
if (!test_bit(idx, cpuc->active_mask))
|
||||
continue;
|
||||
rdmsrl(x86_pmu_config_addr(idx), val);
|
||||
rdmsrq(x86_pmu_config_addr(idx), val);
|
||||
if (!(val & ARCH_PERFMON_EVENTSEL_ENABLE))
|
||||
continue;
|
||||
val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
|
||||
@@ -1550,10 +1550,10 @@ void perf_event_print_debug(void)
|
||||
return;
|
||||
|
||||
if (x86_pmu.version >= 2) {
|
||||
rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl);
|
||||
rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status);
|
||||
rdmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, overflow);
|
||||
rdmsrl(MSR_ARCH_PERFMON_FIXED_CTR_CTRL, fixed);
|
||||
rdmsrq(MSR_CORE_PERF_GLOBAL_CTRL, ctrl);
|
||||
rdmsrq(MSR_CORE_PERF_GLOBAL_STATUS, status);
|
||||
rdmsrq(MSR_CORE_PERF_GLOBAL_OVF_CTRL, overflow);
|
||||
rdmsrq(MSR_ARCH_PERFMON_FIXED_CTR_CTRL, fixed);
|
||||
|
||||
pr_info("\n");
|
||||
pr_info("CPU#%d: ctrl: %016llx\n", cpu, ctrl);
|
||||
@@ -1561,19 +1561,19 @@ void perf_event_print_debug(void)
|
||||
pr_info("CPU#%d: overflow: %016llx\n", cpu, overflow);
|
||||
pr_info("CPU#%d: fixed: %016llx\n", cpu, fixed);
|
||||
if (pebs_constraints) {
|
||||
rdmsrl(MSR_IA32_PEBS_ENABLE, pebs);
|
||||
rdmsrq(MSR_IA32_PEBS_ENABLE, pebs);
|
||||
pr_info("CPU#%d: pebs: %016llx\n", cpu, pebs);
|
||||
}
|
||||
if (x86_pmu.lbr_nr) {
|
||||
rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl);
|
||||
rdmsrq(MSR_IA32_DEBUGCTLMSR, debugctl);
|
||||
pr_info("CPU#%d: debugctl: %016llx\n", cpu, debugctl);
|
||||
}
|
||||
}
|
||||
pr_info("CPU#%d: active: %016llx\n", cpu, *(u64 *)cpuc->active_mask);
|
||||
|
||||
for_each_set_bit(idx, cntr_mask, X86_PMC_IDX_MAX) {
|
||||
rdmsrl(x86_pmu_config_addr(idx), pmc_ctrl);
|
||||
rdmsrl(x86_pmu_event_addr(idx), pmc_count);
|
||||
rdmsrq(x86_pmu_config_addr(idx), pmc_ctrl);
|
||||
rdmsrq(x86_pmu_event_addr(idx), pmc_count);
|
||||
|
||||
prev_left = per_cpu(pmc_prev_left[idx], cpu);
|
||||
|
||||
@@ -1587,7 +1587,7 @@ void perf_event_print_debug(void)
|
||||
for_each_set_bit(idx, fixed_cntr_mask, X86_PMC_IDX_MAX) {
|
||||
if (fixed_counter_disabled(idx, cpuc->pmu))
|
||||
continue;
|
||||
rdmsrl(x86_pmu_fixed_ctr_addr(idx), pmc_count);
|
||||
rdmsrq(x86_pmu_fixed_ctr_addr(idx), pmc_count);
|
||||
|
||||
pr_info("CPU#%d: fixed-PMC%d count: %016llx\n",
|
||||
cpu, idx, pmc_count);
|
||||
|
||||
@@ -2489,7 +2489,7 @@ static inline u64 intel_pmu_get_status(void)
|
||||
{
|
||||
u64 status;
|
||||
|
||||
rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status);
|
||||
rdmsrq(MSR_CORE_PERF_GLOBAL_STATUS, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -5054,7 +5054,7 @@ static void update_pmu_cap(struct x86_hybrid_pmu *pmu)
|
||||
|
||||
if (!intel_pmu_broken_perf_cap()) {
|
||||
/* Perf Metric (Bit 15) and PEBS via PT (Bit 16) are hybrid enumeration */
|
||||
rdmsrl(MSR_IA32_PERF_CAPABILITIES, pmu->intel_cap.capabilities);
|
||||
rdmsrq(MSR_IA32_PERF_CAPABILITIES, pmu->intel_cap.capabilities);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5202,7 +5202,7 @@ static void intel_pmu_cpu_starting(int cpu)
|
||||
if (!is_hybrid() && x86_pmu.intel_cap.perf_metrics) {
|
||||
union perf_capabilities perf_cap;
|
||||
|
||||
rdmsrl(MSR_IA32_PERF_CAPABILITIES, perf_cap.capabilities);
|
||||
rdmsrq(MSR_IA32_PERF_CAPABILITIES, perf_cap.capabilities);
|
||||
if (!perf_cap.perf_metrics) {
|
||||
x86_pmu.intel_cap.perf_metrics = 0;
|
||||
x86_pmu.intel_ctrl &= ~(1ULL << GLOBAL_CTRL_EN_PERF_METRICS);
|
||||
@@ -5627,7 +5627,7 @@ static bool check_msr(unsigned long msr, u64 mask)
|
||||
|
||||
/*
|
||||
* Quirk only affects validation in wrmsr(), so wrmsrl()'s value
|
||||
* should equal rdmsrl()'s even with the quirk.
|
||||
* should equal rdmsrq()'s even with the quirk.
|
||||
*/
|
||||
if (val_new != val_tmp)
|
||||
return false;
|
||||
@@ -6642,7 +6642,7 @@ __init int intel_pmu_init(void)
|
||||
if (boot_cpu_has(X86_FEATURE_PDCM)) {
|
||||
u64 capabilities;
|
||||
|
||||
rdmsrl(MSR_IA32_PERF_CAPABILITIES, capabilities);
|
||||
rdmsrq(MSR_IA32_PERF_CAPABILITIES, capabilities);
|
||||
x86_pmu.intel_cap.capabilities = capabilities;
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ static inline u64 cstate_pmu_read_counter(struct perf_event *event)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
rdmsrl(event->hw.event_base, val);
|
||||
rdmsrq(event->hw.event_base, val);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static void knc_pmu_disable_all(void)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
rdmsrl(MSR_KNC_IA32_PERF_GLOBAL_CTRL, val);
|
||||
rdmsrq(MSR_KNC_IA32_PERF_GLOBAL_CTRL, val);
|
||||
val &= ~(KNC_ENABLE_COUNTER0|KNC_ENABLE_COUNTER1);
|
||||
wrmsrl(MSR_KNC_IA32_PERF_GLOBAL_CTRL, val);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ static void knc_pmu_enable_all(int added)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
rdmsrl(MSR_KNC_IA32_PERF_GLOBAL_CTRL, val);
|
||||
rdmsrq(MSR_KNC_IA32_PERF_GLOBAL_CTRL, val);
|
||||
val |= (KNC_ENABLE_COUNTER0|KNC_ENABLE_COUNTER1);
|
||||
wrmsrl(MSR_KNC_IA32_PERF_GLOBAL_CTRL, val);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ static inline u64 knc_pmu_get_status(void)
|
||||
{
|
||||
u64 status;
|
||||
|
||||
rdmsrl(MSR_KNC_IA32_PERF_GLOBAL_STATUS, status);
|
||||
rdmsrq(MSR_KNC_IA32_PERF_GLOBAL_STATUS, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ static void __intel_pmu_lbr_enable(bool pmi)
|
||||
if (!static_cpu_has(X86_FEATURE_ARCH_LBR) && !pmi && cpuc->lbr_sel)
|
||||
wrmsrl(MSR_LBR_SELECT, lbr_select);
|
||||
|
||||
rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl);
|
||||
rdmsrq(MSR_IA32_DEBUGCTLMSR, debugctl);
|
||||
orig_debugctl = debugctl;
|
||||
|
||||
if (!static_cpu_has(X86_FEATURE_ARCH_LBR))
|
||||
@@ -209,7 +209,7 @@ static inline u64 intel_pmu_lbr_tos(void)
|
||||
{
|
||||
u64 tos;
|
||||
|
||||
rdmsrl(x86_pmu.lbr_tos, tos);
|
||||
rdmsrq(x86_pmu.lbr_tos, tos);
|
||||
return tos;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ static __always_inline u64 rdlbr_from(unsigned int idx, struct lbr_entry *lbr)
|
||||
if (lbr)
|
||||
return lbr->from;
|
||||
|
||||
rdmsrl(x86_pmu.lbr_from + idx, val);
|
||||
rdmsrq(x86_pmu.lbr_from + idx, val);
|
||||
|
||||
return lbr_from_signext_quirk_rd(val);
|
||||
}
|
||||
@@ -314,7 +314,7 @@ static __always_inline u64 rdlbr_to(unsigned int idx, struct lbr_entry *lbr)
|
||||
if (lbr)
|
||||
return lbr->to;
|
||||
|
||||
rdmsrl(x86_pmu.lbr_to + idx, val);
|
||||
rdmsrq(x86_pmu.lbr_to + idx, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ static __always_inline u64 rdlbr_info(unsigned int idx, struct lbr_entry *lbr)
|
||||
if (lbr)
|
||||
return lbr->info;
|
||||
|
||||
rdmsrl(x86_pmu.lbr_info + idx, val);
|
||||
rdmsrq(x86_pmu.lbr_info + idx, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -475,7 +475,7 @@ void intel_pmu_lbr_save(void *ctx)
|
||||
task_ctx->tos = tos;
|
||||
|
||||
if (cpuc->lbr_select)
|
||||
rdmsrl(MSR_LBR_SELECT, task_ctx->lbr_sel);
|
||||
rdmsrq(MSR_LBR_SELECT, task_ctx->lbr_sel);
|
||||
}
|
||||
|
||||
static void intel_pmu_arch_lbr_save(void *ctx)
|
||||
@@ -752,7 +752,7 @@ void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc)
|
||||
u64 lbr;
|
||||
} msr_lastbranch;
|
||||
|
||||
rdmsrl(x86_pmu.lbr_from + lbr_idx, msr_lastbranch.lbr);
|
||||
rdmsrq(x86_pmu.lbr_from + lbr_idx, msr_lastbranch.lbr);
|
||||
|
||||
perf_clear_branch_entry_bitfields(br);
|
||||
|
||||
|
||||
@@ -859,7 +859,7 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)
|
||||
u64 v;
|
||||
|
||||
/* an official way for overflow indication */
|
||||
rdmsrl(hwc->config_base, v);
|
||||
rdmsrq(hwc->config_base, v);
|
||||
if (v & P4_CCCR_OVF) {
|
||||
wrmsrl(hwc->config_base, v & ~P4_CCCR_OVF);
|
||||
return 1;
|
||||
@@ -872,7 +872,7 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)
|
||||
* the counter has reached zero value and continued counting before
|
||||
* real NMI signal was received:
|
||||
*/
|
||||
rdmsrl(hwc->event_base, v);
|
||||
rdmsrq(hwc->event_base, v);
|
||||
if (!(v & ARCH_P4_UNFLAGGED_BIT))
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ static void p6_pmu_disable_all(void)
|
||||
u64 val;
|
||||
|
||||
/* p6 only has one enable register */
|
||||
rdmsrl(MSR_P6_EVNTSEL0, val);
|
||||
rdmsrq(MSR_P6_EVNTSEL0, val);
|
||||
val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
|
||||
wrmsrl(MSR_P6_EVNTSEL0, val);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ static void p6_pmu_enable_all(int added)
|
||||
unsigned long val;
|
||||
|
||||
/* p6 only has one enable register */
|
||||
rdmsrl(MSR_P6_EVNTSEL0, val);
|
||||
rdmsrq(MSR_P6_EVNTSEL0, val);
|
||||
val |= ARCH_PERFMON_EVENTSEL_ENABLE;
|
||||
wrmsrl(MSR_P6_EVNTSEL0, val);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ static int __init pt_pmu_hw_init(void)
|
||||
int ret;
|
||||
long i;
|
||||
|
||||
rdmsrl(MSR_PLATFORM_INFO, reg);
|
||||
rdmsrq(MSR_PLATFORM_INFO, reg);
|
||||
pt_pmu.max_nonturbo_ratio = (reg & 0xff00) >> 8;
|
||||
|
||||
/*
|
||||
@@ -230,7 +230,7 @@ static int __init pt_pmu_hw_init(void)
|
||||
* "IA32_VMX_MISC[bit 14]" being 1 means PT can trace
|
||||
* post-VMXON.
|
||||
*/
|
||||
rdmsrl(MSR_IA32_VMX_MISC, reg);
|
||||
rdmsrq(MSR_IA32_VMX_MISC, reg);
|
||||
if (reg & BIT(14))
|
||||
pt_pmu.vmx = true;
|
||||
}
|
||||
@@ -926,7 +926,7 @@ static void pt_handle_status(struct pt *pt)
|
||||
int advance = 0;
|
||||
u64 status;
|
||||
|
||||
rdmsrl(MSR_IA32_RTIT_STATUS, status);
|
||||
rdmsrq(MSR_IA32_RTIT_STATUS, status);
|
||||
|
||||
if (status & RTIT_STATUS_ERROR) {
|
||||
pr_err_ratelimited("ToPA ERROR encountered, trying to recover\n");
|
||||
@@ -985,12 +985,12 @@ static void pt_read_offset(struct pt_buffer *buf)
|
||||
struct topa_page *tp;
|
||||
|
||||
if (!buf->single) {
|
||||
rdmsrl(MSR_IA32_RTIT_OUTPUT_BASE, pt->output_base);
|
||||
rdmsrq(MSR_IA32_RTIT_OUTPUT_BASE, pt->output_base);
|
||||
tp = phys_to_virt(pt->output_base);
|
||||
buf->cur = &tp->topa;
|
||||
}
|
||||
|
||||
rdmsrl(MSR_IA32_RTIT_OUTPUT_MASK, pt->output_mask);
|
||||
rdmsrq(MSR_IA32_RTIT_OUTPUT_MASK, pt->output_mask);
|
||||
/* offset within current output region */
|
||||
buf->output_off = pt->output_mask >> 32;
|
||||
/* index of current output region within this table */
|
||||
@@ -1611,7 +1611,7 @@ static void pt_event_start(struct perf_event *event, int mode)
|
||||
* PMI might have just cleared these, so resume_allowed
|
||||
* must be checked again also.
|
||||
*/
|
||||
rdmsrl(MSR_IA32_RTIT_STATUS, status);
|
||||
rdmsrq(MSR_IA32_RTIT_STATUS, status);
|
||||
if (!(status & (RTIT_STATUS_TRIGGEREN |
|
||||
RTIT_STATUS_ERROR |
|
||||
RTIT_STATUS_STOPPED)) &&
|
||||
|
||||
@@ -150,7 +150,7 @@ u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *eve
|
||||
{
|
||||
u64 count;
|
||||
|
||||
rdmsrl(event->hw.event_base, count);
|
||||
rdmsrq(event->hw.event_base, count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ static void nhmex_uncore_msr_disable_box(struct intel_uncore_box *box)
|
||||
u64 config;
|
||||
|
||||
if (msr) {
|
||||
rdmsrl(msr, config);
|
||||
rdmsrq(msr, config);
|
||||
config &= ~((1ULL << uncore_num_counters(box)) - 1);
|
||||
/* WBox has a fixed counter */
|
||||
if (uncore_msr_fixed_ctl(box))
|
||||
@@ -229,7 +229,7 @@ static void nhmex_uncore_msr_enable_box(struct intel_uncore_box *box)
|
||||
u64 config;
|
||||
|
||||
if (msr) {
|
||||
rdmsrl(msr, config);
|
||||
rdmsrq(msr, config);
|
||||
config |= (1ULL << uncore_num_counters(box)) - 1;
|
||||
/* WBox has a fixed counter */
|
||||
if (uncore_msr_fixed_ctl(box))
|
||||
|
||||
@@ -504,7 +504,7 @@ static int icl_get_cbox_num(void)
|
||||
{
|
||||
u64 num_boxes;
|
||||
|
||||
rdmsrl(ICL_UNC_CBO_CONFIG, num_boxes);
|
||||
rdmsrq(ICL_UNC_CBO_CONFIG, num_boxes);
|
||||
|
||||
return num_boxes & ICL_UNC_NUM_CBO_MASK;
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ static void snbep_uncore_msr_disable_box(struct intel_uncore_box *box)
|
||||
|
||||
msr = uncore_msr_box_ctl(box);
|
||||
if (msr) {
|
||||
rdmsrl(msr, config);
|
||||
rdmsrq(msr, config);
|
||||
config |= SNBEP_PMON_BOX_CTL_FRZ;
|
||||
wrmsrl(msr, config);
|
||||
}
|
||||
@@ -631,7 +631,7 @@ static void snbep_uncore_msr_enable_box(struct intel_uncore_box *box)
|
||||
|
||||
msr = uncore_msr_box_ctl(box);
|
||||
if (msr) {
|
||||
rdmsrl(msr, config);
|
||||
rdmsrq(msr, config);
|
||||
config &= ~SNBEP_PMON_BOX_CTL_FRZ;
|
||||
wrmsrl(msr, config);
|
||||
}
|
||||
@@ -6572,7 +6572,7 @@ void spr_uncore_cpu_init(void)
|
||||
* of UNCORE_SPR_CHA) is incorrect on some SPR variants because of a
|
||||
* firmware bug. Using the value from SPR_MSR_UNC_CBO_CONFIG to replace it.
|
||||
*/
|
||||
rdmsrl(SPR_MSR_UNC_CBO_CONFIG, num_cbo);
|
||||
rdmsrq(SPR_MSR_UNC_CBO_CONFIG, num_cbo);
|
||||
/*
|
||||
* The MSR doesn't work on the EMR XCC, but the firmware bug doesn't impact
|
||||
* the EMR XCC. Don't let the value from the MSR replace the existing value.
|
||||
|
||||
@@ -231,7 +231,7 @@ static inline u64 msr_read_counter(struct perf_event *event)
|
||||
u64 now;
|
||||
|
||||
if (event->hw.event_base)
|
||||
rdmsrl(event->hw.event_base, now);
|
||||
rdmsrq(event->hw.event_base, now);
|
||||
else
|
||||
now = rdtsc_ordered();
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user