Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=331e406588dc90331753e6562e5e3757bb907eb8
Commit:     331e406588dc90331753e6562e5e3757bb907eb8
Parent:     1c083eb2cbdd917149f6acaa55efca129d05c2a9
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 16:48:06 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 16:48:06 2008 +0100

    x86: CPA return early when requested feature is not available
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a629cea..f60b93d 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -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
-
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