Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173043
b: refs/heads/master
c: e7d23dd
h: refs/heads/master
i:
  173041: 0954575
  173039: 2570f09
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Nov 2, 2009
1 parent f3cb1fc commit c9ab2fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55ca3cc1746335bb6ef1d3894ddb6d0c729b3518
refs/heads/master: e7d23dde9b7ebb575e2bcee2abefc9ec1e4adde9
12 changes: 10 additions & 2 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,28 +700,36 @@ int kernel_set_to_readonly;
void set_kernel_text_rw(void)
{
unsigned long start = PFN_ALIGN(_text);
unsigned long end = PFN_ALIGN(__start_rodata);
unsigned long end = PFN_ALIGN(__stop___ex_table);

if (!kernel_set_to_readonly)
return;

pr_debug("Set kernel text: %lx - %lx for read write\n",
start, end);

/*
* Make the kernel identity mapping for text RW. Kernel text
* mapping will always be RO. Refer to the comment in
* static_protections() in pageattr.c
*/
set_memory_rw(start, (end - start) >> PAGE_SHIFT);
}

void set_kernel_text_ro(void)
{
unsigned long start = PFN_ALIGN(_text);
unsigned long end = PFN_ALIGN(__start_rodata);
unsigned long end = PFN_ALIGN(__stop___ex_table);

if (!kernel_set_to_readonly)
return;

pr_debug("Set kernel text: %lx - %lx for read only\n",
start, end);

/*
* Set the kernel identity mapping for text RO.
*/
set_memory_ro(start, (end - start) >> PAGE_SHIFT);
}

Expand Down

0 comments on commit c9ab2fb

Please sign in to comment.