printk("intpose_add: interpose array full - request dropped\n");
}
-void intpose_inval(unsigned int cpu_nr, uint64_t msr)
+bool_t intpose_inval(unsigned int cpu_nr, uint64_t msr)
{
- struct intpose_ent *ent;
+ struct intpose_ent *ent = intpose_lookup(cpu_nr, msr, NULL);
- if ((ent = intpose_lookup(cpu_nr, msr, NULL)) != NULL) {
- ent->cpu_nr = -1;
- }
+ if ( !ent )
+ return 0;
+
+ ent->cpu_nr = -1;
+ return 1;
}
#define IS_MCA_BANKREG(r) \
/* Read an MSR, checking for an interposed value first */
extern struct intpose_ent *intpose_lookup(unsigned int, uint64_t,
uint64_t *);
-extern void intpose_inval(unsigned int, uint64_t);
+extern bool_t intpose_inval(unsigned int, uint64_t);
static inline uint64_t mca_rdmsr(unsigned int msr)
{
/* Write an MSR, invalidating any interposed value */
#define mca_wrmsr(msr, val) do { \
- intpose_inval(smp_processor_id(), msr); \
- wrmsrl(msr, val); \
-} while (0)
+ if ( !intpose_inval(smp_processor_id(), msr) ) \
+ wrmsrl(msr, val); \
+} while ( 0 )
/* Utility function to "logout" all architectural MCA telemetry from the MCA