/* converts an msr to an appropriate reservation bit returns the bit offset of the event selection register  */
static unsigned int nmi_evntsel_msr_to_bit(unsigned int msr)
/* converts an msr to an appropriate reservation bit returns the bit offset of the event selection register  */
static unsigned int nmi_evntsel_msr_to_bit(unsigned int msr)
{
	switch (boot_cpu_data.x86_vendor) {
	case X86_VENDOR_AMD:
		return msr - MSR_K7_EVNTSEL0;
	case X86_VENDOR_INTEL:
		if (cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON))
			return msr - MSR_ARCH_PERFMON_EVENTSEL0;
		switch (boot_cpu_data.x86) {
		case 6:
			return msr - MSR_P6_EVNTSEL0;
		case 15:
			return msr - MSR_P4_BSU_ESCR0;
		}
	}
	return 0;
}