]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: CPA return early when requested feature is not available
authorThomas Gleixner <tglx@linutronix.de>
Mon, 4 Feb 2008 15:48:06 +0000 (16:48 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 4 Feb 2008 15:48:06 +0000 (16:48 +0100)
Mask out the not supported bits (e.g. NX). If the clr/set masks
are empty after the mask return without changing anything.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/pageattr.c

index a629cea5e46551efadd5f27e02919b3f19db9236..f60b93dc2e579794f8a7783a2fb2a3a5fb660c66 100644 (file)
@@ -405,8 +405,18 @@ static int __change_page_attr_set_clr(unsigned long addr, int numpages,
 static int change_page_attr_set_clr(unsigned long addr, int numpages,
                                    pgprot_t mask_set, pgprot_t mask_clr)
 {
-       int ret = __change_page_attr_set_clr(addr, numpages, mask_set,
-                                            mask_clr);
+       int ret;
+
+       /*
+        * Check, if we are requested to change a not supported
+        * feature:
+        */
+       mask_set = canon_pgprot(mask_set);
+       mask_clr = canon_pgprot(mask_clr);
+       if (!pgprot_val(mask_set) && !pgprot_val(mask_clr))
+               return 0;
+
+       ret = __change_page_attr_set_clr(addr, numpages, mask_set, mask_clr);
 
        /*
         * On success we use clflush, when the CPU supports it to