Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88755
b: refs/heads/master
c: 4e4eee0
h: refs/heads/master
i:
  88753: 4095fae
  88751: 81c069b
v: v3
  • Loading branch information
Mathieu Desnoyers authored and Ingo Molnar committed Apr 17, 2008
1 parent a945f49 commit ab0d8bd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 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: e587cadd8f47e202a30712e2906a65a0606d5865
refs/heads/master: 4e4eee0e0139811b36a07854dcfa9746bc8b16d3
24 changes: 8 additions & 16 deletions trunk/arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,25 +723,17 @@ void mark_rodata_ro(void)
unsigned long start = PFN_ALIGN(_text);
unsigned long size = PFN_ALIGN(_etext) - start;

#ifndef CONFIG_KPROBES
#ifdef CONFIG_HOTPLUG_CPU
/* It must still be possible to apply SMP alternatives. */
if (num_possible_cpus() <= 1)
#endif
{
set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
printk(KERN_INFO "Write protecting the kernel text: %luk\n",
size >> 10);
set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
printk(KERN_INFO "Write protecting the kernel text: %luk\n",
size >> 10);

#ifdef CONFIG_CPA_DEBUG
printk(KERN_INFO "Testing CPA: Reverting %lx-%lx\n",
start, start+size);
set_pages_rw(virt_to_page(start), size>>PAGE_SHIFT);
printk(KERN_INFO "Testing CPA: Reverting %lx-%lx\n",
start, start+size);
set_pages_rw(virt_to_page(start), size>>PAGE_SHIFT);

printk(KERN_INFO "Testing CPA: write protecting again\n");
set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT);
#endif
}
printk(KERN_INFO "Testing CPA: write protecting again\n");
set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT);
#endif
start += size;
size = (unsigned long)__end_rodata - start;
Expand Down
20 changes: 2 additions & 18 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,24 +635,7 @@ EXPORT_SYMBOL_GPL(rodata_test_data);

void mark_rodata_ro(void)
{
unsigned long start = (unsigned long)_stext, end;

#ifdef CONFIG_HOTPLUG_CPU
/* It must still be possible to apply SMP alternatives. */
if (num_possible_cpus() > 1)
start = (unsigned long)_etext;
#endif

#ifdef CONFIG_KPROBES
start = (unsigned long)__start_rodata;
#endif

end = (unsigned long)__end_rodata;
start = (start + PAGE_SIZE - 1) & PAGE_MASK;
end &= PAGE_MASK;
if (end <= start)
return;

unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata);

printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
(end - start) >> 10);
Expand All @@ -675,6 +658,7 @@ void mark_rodata_ro(void)
set_memory_ro(start, (end-start) >> PAGE_SHIFT);
#endif
}

#endif

#ifdef CONFIG_BLK_DEV_INITRD
Expand Down

0 comments on commit ab0d8bd

Please sign in to comment.