Commit 331e4065 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

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: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 1c083eb2
...@@ -405,8 +405,18 @@ static int __change_page_attr_set_clr(unsigned long addr, int numpages, ...@@ -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, static int change_page_attr_set_clr(unsigned long addr, int numpages,
pgprot_t mask_set, pgprot_t mask_clr) pgprot_t mask_set, pgprot_t mask_clr)
{ {
int ret = __change_page_attr_set_clr(addr, numpages, mask_set, int ret;
mask_clr);
/*
* 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 * On success we use clflush, when the CPU supports it to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment