/* The caller must ensure that local interrupts are disabled and are reenabled after post_set() has been called.  */
static void prepare_set(void)
/* The caller must ensure that local interrupts are disabled and are reenabled after post_set() has been called.  */
static void prepare_set(void)
{
	unsigned long cr0;
	spin_lock(&set_atomicity_lock);
	cr0 = read_cr0() | X86_CR0_CD;
	write_cr0(cr0);
	wbinvd();
	if (cpu_has_pge) {
		cr4 = read_cr4();
		write_cr4(cr4 & ~X86_CR4_PGE);
	}
	__flush_tlb();
	rdmsr(MSR_MTRRdefType, deftype_lo, deftype_hi);
	mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi);
}