Re: [PATCH] x86: prevent unconditional writes to DebugCtl MSR

From: Andi Kleen
Date: Mon Mar 10 2008 - 11:57:10 EST


"Jan Beulich" <jbeulich@xxxxxxxxxx> writes:
>
> +static inline void update_debugctlmsr(unsigned long debugctlmsr)
> +{
> +#ifndef CONFIG_X86_DEBUGCTLMSR
> + if (boot_cpu_data.x86 < 6)
> + return;
> +#endif
> + wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr);

It would be better to use checking_wrmsrl() instead of the model
check because often VMs etc. are missing such MSRs too, but
report the higher family number.

Also silently failing is not very nice, but that's a different issue.

-Andi
--
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/