Commit 30796e18 authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Linus Torvalds
Browse files

x86/mm: introduce __set_memory_prot()

For use in the 32bit arch_add_memory() to set the pgprot type of the
memory to add.
Signed-off-by: default avatarLogan Gunthorpe <>
Signed-off-by: default avatarAndrew Morton <>
Reviewed-by: default avatarDan Williams <>
Cc: Thomas Gleixner <>
Cc: Ingo Molnar <>
Cc: Borislav Petkov <>
Cc: "H. Peter Anvin" <>
Cc: Dave Hansen <>
Cc: Andy Lutomirski <>
Cc: Peter Zijlstra <>
Cc: Benjamin Herrenschmidt <>
Cc: Catalin Marinas <>
Cc: Christoph Hellwig <>
Cc: David Hildenbrand <>
Cc: Eric Badger <>
Cc: Jason Gunthorpe <>
Cc: Michael Ellerman <>
Cc: Michal Hocko <>
Cc: Paul Mackerras <>
Cc: Will Deacon <>

Signed-off-by: default avatarLinus Torvalds <>
parent c164fbb4
......@@ -34,6 +34,7 @@
* The caller is required to take care of these.
int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot);
int _set_memory_uc(unsigned long addr, int numpages);
int _set_memory_wc(unsigned long addr, int numpages);
int _set_memory_wt(unsigned long addr, int numpages);
......@@ -1795,6 +1795,19 @@ static inline int cpa_clear_pages_array(struct page **pages, int numpages,
* _set_memory_prot is an internal helper for callers that have been passed
* a pgprot_t value from upper layers and a reservation has already been taken.
* If you want to set the pgprot to a specific page protocol, use the
* set_memory_xx() functions.
int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot)
return change_page_attr_set_clr(&addr, numpages, prot,
__pgprot(~pgprot_val(prot)), 0, 0,
int _set_memory_uc(unsigned long addr, int numpages)
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