Re: [PATCH 04/23] x86, tlb: make CR4-based TLB flushes more robust

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/01/2017 02:25 PM, Thomas Gleixner wrote:
>>  	cr4 = this_cpu_read(cpu_tlbstate.cr4);
>> -	/* clear PGE */
>> -	native_write_cr4(cr4 & ~X86_CR4_PGE);
>> -	/* write old PGE again and flush TLBs */
>> +	/*
>> +	 * This function is only called on systems that support X86_CR4_PGE
>> +	 * and where always set X86_CR4_PGE.  Warn if we are called without
>> +	 * PGE set.
>> +	 */
>> +	WARN_ON_ONCE(!(cr4 & X86_CR4_PGE));
> Because if CR4_PGE is not set, this warning triggers. So this defeats the
> toggle mode you are implementing.

The warning is there because there is probably plenty of *other* stuff
that breaks if we have X86_FEATURE_PGE=1, but CR4.PGE=0.

The point of this was to make this function do the right thing no matter
what, but warn if it gets called in an unexpected way.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux