Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ac72e7888a612dccfbc15b34698aad441bdfda10
Commit:     ac72e7888a612dccfbc15b34698aad441bdfda10
Parent:     191679fdfa63342752ff6a094a2522ae939b8d0c
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:33:21 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:33:21 2008 +0100

    x86: add generic clearcpuid=... option
    
    Add a generic option to clear any cpuid bit. I added it because it was
    very easy to add with the new generic cpuid disable bitmap and perhaps
    it will be useful in the future.
    
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 Documentation/kernel-parameters.txt |   13 +++++++++++++
 arch/x86/kernel/cpu/common.c        |   11 +++++++++++
 arch/x86/kernel/setup_64.c          |   11 +++++++++++
 3 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 040e30a..50d564d 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -416,6 +416,19 @@ and is between 256 and 4096 characters. It is defined in 
the file
                        [SPARC64] tick
                        [X86-64] hpet,tsc
 
+       clearcpuid=BITNUM [X86]
+                       Disable CPUID feature X for the kernel. See
+                       include/asm-x86/cpufeature.h for the valid bit numbers.
+                       Note the Linux specific bits are not necessarily
+                       stable over kernel options, but the vendor specific
+                       ones should be.
+                       Also note that user programs calling CPUID directly
+                       or using the feature without checking anything
+                       will still see it. This just prevents it from
+                       being used by the kernel or shown in /proc/cpuinfo.
+                       Also note the kernel might malfunction if you disable
+                       some critical bits.
+
        code_bytes      [IA32/X86_64] How many bytes of object code to print
                        in an oops report.
                        Range: 0 - 8192
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 56b7ea8..56cc341 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -572,6 +572,17 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
                printk("\n");
 }
 
+static __init int setup_disablecpuid(char *arg)
+{
+       int bit;
+       if (get_option(&arg, &bit) && bit < NCAPINTS*32)
+               setup_clear_cpu_cap(bit);
+       else
+               return 0;
+       return 1;
+}
+__setup("clearcpuid=", setup_disablecpuid);
+
 cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
 
 /* This is hacky. :)
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index cb9b8a9..79635b7 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -1050,6 +1050,17 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
                printk(KERN_CONT "\n");
 }
 
+static __init int setup_disablecpuid(char *arg)
+{
+       int bit;
+       if (get_option(&arg, &bit) && bit < NCAPINTS*32)
+               setup_clear_cpu_cap(bit);
+       else
+               return 0;
+       return 1;
+}
+__setup("clearcpuid=", setup_disablecpuid);
+
 /*
  *     Get CPU information for use by the procfs.
  */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to