|
@@ -53,6 +53,7 @@ static DEFINE_SPINLOCK(cpa_lock);
|
|
#define CPA_FLUSHTLB 1
|
|
#define CPA_FLUSHTLB 1
|
|
#define CPA_ARRAY 2
|
|
#define CPA_ARRAY 2
|
|
#define CPA_PAGES_ARRAY 4
|
|
#define CPA_PAGES_ARRAY 4
|
|
|
|
+#define CPA_NO_CHECK_ALIAS 8 /* Do not search for aliases */
|
|
|
|
|
|
#ifdef CONFIG_PROC_FS
|
|
#ifdef CONFIG_PROC_FS
|
|
static unsigned long direct_pages_count[PG_LEVEL_NUM];
|
|
static unsigned long direct_pages_count[PG_LEVEL_NUM];
|
|
@@ -1486,6 +1487,9 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
|
|
|
|
|
|
/* No alias checking for _NX bit modifications */
|
|
/* No alias checking for _NX bit modifications */
|
|
checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX;
|
|
checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX;
|
|
|
|
+ /* Has caller explicitly disabled alias checking? */
|
|
|
|
+ if (in_flag & CPA_NO_CHECK_ALIAS)
|
|
|
|
+ checkalias = 0;
|
|
|
|
|
|
ret = __change_page_attr_set_clr(&cpa, checkalias);
|
|
ret = __change_page_attr_set_clr(&cpa, checkalias);
|
|
|
|
|
|
@@ -1772,6 +1776,15 @@ int set_memory_np(unsigned long addr, int numpages)
|
|
return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_PRESENT), 0);
|
|
return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_PRESENT), 0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int set_memory_np_noalias(unsigned long addr, int numpages)
|
|
|
|
+{
|
|
|
|
+ int cpa_flags = CPA_NO_CHECK_ALIAS;
|
|
|
|
+
|
|
|
|
+ return change_page_attr_set_clr(&addr, numpages, __pgprot(0),
|
|
|
|
+ __pgprot(_PAGE_PRESENT), 0,
|
|
|
|
+ cpa_flags, NULL);
|
|
|
|
+}
|
|
|
|
+
|
|
int set_memory_4k(unsigned long addr, int numpages)
|
|
int set_memory_4k(unsigned long addr, int numpages)
|
|
{
|
|
{
|
|
return change_page_attr_set_clr(&addr, numpages, __pgprot(0),
|
|
return change_page_attr_set_clr(&addr, numpages, __pgprot(0),
|