[PATCH] apic, x86: Need to set offset before using it
From: Jaswinder Singh
Date: Mon Oct 25 2010 - 01:46:25 EST
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@xxxxxxxxx>
Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Cc: Robert Richter <robert.richter@xxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86/oprofile/op_model_amd.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
index 42fb46f..c65a924 100644
--- a/arch/x86/oprofile/op_model_amd.c
+++ b/arch/x86/oprofile/op_model_amd.c
@@ -285,6 +285,7 @@ static inline int ibs_eilvt_valid(void)
int offset;
rdmsrl(MSR_AMD64_IBSCTL, val);
+ offset = val & IBSCTL_LVT_OFFSET_MASK;
if (!(val & IBSCTL_LVT_OFFSET_VALID)) {
pr_err(FW_BUG "cpu %d, invalid IBS "
"interrupt offset %d (MSR%08X=0x%016llx)",
@@ -293,8 +294,6 @@ static inline int ibs_eilvt_valid(void)
return 0;
}
- offset = val & IBSCTL_LVT_OFFSET_MASK;
-
if (eilvt_is_available(offset))
return !0;
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/