Skip to content
  • Dave Hansen's avatar
    x86/cpufeature: Add helper macro for mask check macros · 8eda072e
    Dave Hansen authored
    
    
    Every time we add a word to our cpu features, we need to add
    something like this in two places:
    
    	(((bit)>>5)==16 && (1UL<<((bit)&31) & REQUIRED_MASK16))
    
    The trick is getting the "16" in this case in both places.  I've
    now screwed this up twice, so as pennance, I've come up with
    this patch to keep me and other poor souls from doing the same.
    
    I also commented the logic behind the bit manipulation showcased
    above.
    
    Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Brian Gerst <brgerst@gmail.com>
    Cc: Dave Hansen <dave@sr71.net>
    Cc: Denys Vlasenko <dvlasenk@redhat.com>
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/20160629200110.1BA8949E@viggo.jf.intel.com
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    8eda072e