-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: [S390] kexec: Disable ftrace during kexec [S390] support XZ compressed kernel [S390] css_bus_type: make it static [S390] css_driver: remove duplicate members [S390] css: remove subchannel private [S390] css: move chsc_private to drv_data [S390] css: move io_private to drv_data [S390] cio: move cdev pointer to io_subchannel_private [S390] cio: move options to io_sch_private [S390] cio: move asms to generic header [S390] cio: move orb definitions to separate header [S390] Write protect module text and RO data [S390] dasd: get rid of compile warning [S390] remove superfluous check from do_IRQ [S390] remove redundant stack check option
- Loading branch information
Showing
19 changed files
with
248 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright IBM Corp. 2011 | ||
* Author(s): Jan Glauber <jang@linux.vnet.ibm.com> | ||
*/ | ||
#include <linux/module.h> | ||
#include <linux/mm.h> | ||
#include <linux/hugetlb.h> | ||
#include <asm/pgtable.h> | ||
|
||
static void change_page_attr(unsigned long addr, int numpages, | ||
pte_t (*set) (pte_t)) | ||
{ | ||
pte_t *ptep, pte; | ||
pmd_t *pmdp; | ||
pud_t *pudp; | ||
pgd_t *pgdp; | ||
int i; | ||
|
||
for (i = 0; i < numpages; i++) { | ||
pgdp = pgd_offset(&init_mm, addr); | ||
pudp = pud_offset(pgdp, addr); | ||
pmdp = pmd_offset(pudp, addr); | ||
if (pmd_huge(*pmdp)) { | ||
WARN_ON_ONCE(1); | ||
continue; | ||
} | ||
ptep = pte_offset_kernel(pmdp, addr + i * PAGE_SIZE); | ||
|
||
pte = *ptep; | ||
pte = set(pte); | ||
ptep_invalidate(&init_mm, addr + i * PAGE_SIZE, ptep); | ||
*ptep = pte; | ||
} | ||
} | ||
|
||
int set_memory_ro(unsigned long addr, int numpages) | ||
{ | ||
change_page_attr(addr, numpages, pte_wrprotect); | ||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(set_memory_ro); | ||
|
||
int set_memory_rw(unsigned long addr, int numpages) | ||
{ | ||
change_page_attr(addr, numpages, pte_mkwrite); | ||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(set_memory_rw); | ||
|
||
/* not possible */ | ||
int set_memory_nx(unsigned long addr, int numpages) | ||
{ | ||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(set_memory_nx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.