diff options
-rw-r--r-- | arch/x86/oprofile/op_model_amd.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c index 42fb46f83883..68759e716f0f 100644 --- a/arch/x86/oprofile/op_model_amd.c +++ b/arch/x86/oprofile/op_model_amd.c | |||
@@ -281,29 +281,25 @@ static inline int eilvt_is_available(int offset) | |||
281 | 281 | ||
282 | static inline int ibs_eilvt_valid(void) | 282 | static inline int ibs_eilvt_valid(void) |
283 | { | 283 | { |
284 | u64 val; | ||
285 | int offset; | 284 | int offset; |
285 | u64 val; | ||
286 | 286 | ||
287 | rdmsrl(MSR_AMD64_IBSCTL, val); | 287 | rdmsrl(MSR_AMD64_IBSCTL, val); |
288 | offset = val & IBSCTL_LVT_OFFSET_MASK; | ||
289 | |||
288 | if (!(val & IBSCTL_LVT_OFFSET_VALID)) { | 290 | if (!(val & IBSCTL_LVT_OFFSET_VALID)) { |
289 | pr_err(FW_BUG "cpu %d, invalid IBS " | 291 | pr_err(FW_BUG "cpu %d, invalid IBS interrupt offset %d (MSR%08X=0x%016llx)\n", |
290 | "interrupt offset %d (MSR%08X=0x%016llx)", | 292 | smp_processor_id(), offset, MSR_AMD64_IBSCTL, val); |
291 | smp_processor_id(), offset, | ||
292 | MSR_AMD64_IBSCTL, val); | ||
293 | return 0; | 293 | return 0; |
294 | } | 294 | } |
295 | 295 | ||
296 | offset = val & IBSCTL_LVT_OFFSET_MASK; | 296 | if (!eilvt_is_available(offset)) { |
297 | 297 | pr_err(FW_BUG "cpu %d, IBS interrupt offset %d not available (MSR%08X=0x%016llx)\n", | |
298 | if (eilvt_is_available(offset)) | 298 | smp_processor_id(), offset, MSR_AMD64_IBSCTL, val); |
299 | return !0; | 299 | return 0; |
300 | 300 | } | |
301 | pr_err(FW_BUG "cpu %d, IBS interrupt offset %d " | ||
302 | "not available (MSR%08X=0x%016llx)", | ||
303 | smp_processor_id(), offset, | ||
304 | MSR_AMD64_IBSCTL, val); | ||
305 | 301 | ||
306 | return 0; | 302 | return 1; |
307 | } | 303 | } |
308 | 304 | ||
309 | static inline int get_ibs_offset(void) | 305 | static inline int get_ibs_offset(void) |