|
@@ -839,6 +839,20 @@ static int __should_split_large_page(pte_t *kpte, unsigned long address,
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * Optimization: If the requested pgprot is the same as the current
|
|
|
+ * pgprot, then the large page can be preserved and no updates are
|
|
|
+ * required independent of alignment and length of the requested
|
|
|
+ * range. The above already established that the current pgprot is
|
|
|
+ * correct, which in consequence makes the requested pgprot correct
|
|
|
+ * as well if it is the same. The static protection scan below will
|
|
|
+ * not come to a different conclusion.
|
|
|
+ */
|
|
|
+ if (pgprot_val(req_prot) == pgprot_val(old_prot)) {
|
|
|
+ cpa_inc_lp_sameprot(level);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
* Make sure that the requested pgprot does not violate the static
|
|
|
* protections. Check the full large page whether one of the pages
|