Skip to content

Commit 8a4e92b

Browse files
coibybp3tk0v
authored andcommitted
x86/crash: Use set_memory_p() instead of __set_memory_prot()
set_memory_p() is available to use outside of its compilation unit since: 030ad7a ("x86/mm: Regularize set_memory_p() parameters and make non-static"). There is no use for __set_memory_prot() anymore so drop it too. [ bp: Massage commit message. ] Signed-off-by: Coiby Xu <coxu@redhat.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20260106095100.656292-1-coxu@redhat.com
1 parent 736a2dc commit 8a4e92b

3 files changed

Lines changed: 1 addition & 18 deletions

File tree

arch/x86/include/asm/set_memory.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ int set_memory_rox(unsigned long addr, int numpages);
3838
* The caller is required to take care of these.
3939
*/
4040

41-
int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot);
4241
int _set_memory_uc(unsigned long addr, int numpages);
4342
int _set_memory_wc(unsigned long addr, int numpages);
4443
int _set_memory_wt(unsigned long addr, int numpages);

arch/x86/kernel/machine_kexec_64.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,7 @@ static void kexec_mark_dm_crypt_keys(bool protect)
673673
if (protect)
674674
set_memory_np((unsigned long)phys_to_virt(start_paddr), nr_pages);
675675
else
676-
__set_memory_prot(
677-
(unsigned long)phys_to_virt(start_paddr),
678-
nr_pages,
679-
__pgprot(_PAGE_PRESENT | _PAGE_NX | _PAGE_RW));
676+
set_memory_p((unsigned long)phys_to_virt(start_paddr), nr_pages);
680677
}
681678
}
682679

arch/x86/mm/pat/set_memory.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,19 +2145,6 @@ static inline int cpa_clear_pages_array(struct page **pages, int numpages,
21452145
CPA_PAGES_ARRAY, pages);
21462146
}
21472147

2148-
/*
2149-
* __set_memory_prot is an internal helper for callers that have been passed
2150-
* a pgprot_t value from upper layers and a reservation has already been taken.
2151-
* If you want to set the pgprot to a specific page protocol, use the
2152-
* set_memory_xx() functions.
2153-
*/
2154-
int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot)
2155-
{
2156-
return change_page_attr_set_clr(&addr, numpages, prot,
2157-
__pgprot(~pgprot_val(prot)), 0, 0,
2158-
NULL);
2159-
}
2160-
21612148
int _set_memory_uc(unsigned long addr, int numpages)
21622149
{
21632150
/*

0 commit comments

Comments
 (0)