[PATCH] Fix i386/x86_64 cpuid/msr BUG() on impossible CPUs
From: Rusty Russell <rusty@rustcorp.com.au> Matthieu Castet <castet.matthieu@free.fr> pointed out that testing cpu_online(cpu) on a UP system goes BUG(). That's because you're never supposed to ask cpu_online() about a CPU which is >= NR_CPUS. msr and cpuid devices use the minor to indicate the CPU number. Oops. Fix is to explicitly test cpu < NR_CPUS. Using cpu_online() is OK; although the CPU might go down before you actually read the file, that will simply cause junk to be returned.
Showing
Please register or sign in to comment