Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46184
b: refs/heads/master
c: 162e006
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Feb 5, 2007
1 parent a51d1c9 commit fa0f3f6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 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: ab14de6c37fae22911ba99f4171613e6d758050b
refs/heads/master: 162e006ef59266b9ebf34e3d15ca1f3d9ee956d7
1 change: 0 additions & 1 deletion trunk/arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define DEFSYS_CMD_SIZE 96
#define SAVESYS_CMD_SIZE 32

extern int _eshared;
char kernel_nss_name[NSS_NAME_SIZE + 1];

#ifdef CONFIG_SHARED_KERNEL
Expand Down
27 changes: 23 additions & 4 deletions trunk/arch/s390/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,34 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
static int __kprobes swap_instruction(void *aref)
{
struct ins_replace_args *args = aref;
u32 *addr;
u32 instr;
int err = -EFAULT;

/*
* Text segment is read-only, hence we use stura to bypass dynamic
* address translation to exchange the instruction. Since stura
* always operates on four bytes, but we only want to exchange two
* bytes do some calculations to get things right. In addition we
* shall not cross any page boundaries (vmalloc area!) when writing
* the new instruction.
*/
addr = (u32 *)ALIGN((unsigned long)args->ptr, 4);
if ((unsigned long)args->ptr & 2)
instr = ((*addr) & 0xffff0000) | args->new;
else
instr = ((*addr) & 0x0000ffff) | args->new << 16;

asm volatile(
"0: mvc 0(2,%2),0(%3)\n"
"1: la %0,0\n"
" lra %1,0(%1)\n"
"0: stura %2,%1\n"
"1: la %0,0\n"
"2:\n"
EX_TABLE(0b,2b)
: "+d" (err), "=m" (*args->ptr)
: "a" (args->ptr), "a" (&args->new), "m" (args->new));
: "+d" (err)
: "a" (addr), "d" (instr)
: "memory", "cc");

return err;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ SECTIONS

#ifdef CONFIG_SHARED_KERNEL
. = ALIGN(1048576); /* VM shared segments are 1MB aligned */
#endif

. = ALIGN(4096);
_eshared = .; /* End of shareable data */
#endif

. = ALIGN(16); /* Exception table */
__start___ex_table = .;
Expand Down
9 changes: 4 additions & 5 deletions trunk/arch/s390/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <linux/pfn.h>
#include <linux/poison.h>
#include <linux/initrd.h>

#include <asm/processor.h>
#include <asm/system.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -96,8 +95,8 @@ static void __init setup_ro_region(void)
pte_t new_pte;
unsigned long address, end;

address = ((unsigned long)&__start_rodata) & PAGE_MASK;
end = PFN_ALIGN((unsigned long)&__end_rodata);
address = ((unsigned long)&_stext) & PAGE_MASK;
end = PFN_ALIGN((unsigned long)&_eshared);

for (; address < end; address += PAGE_SIZE) {
pgd = pgd_offset_k(address);
Expand Down Expand Up @@ -173,8 +172,8 @@ void __init mem_init(void)
datasize >>10,
initsize >> 10);
printk("Write protected kernel read-only data: %#lx - %#lx\n",
(unsigned long)&__start_rodata,
PFN_ALIGN((unsigned long)&__end_rodata) - 1);
(unsigned long)&_stext,
PFN_ALIGN((unsigned long)&_eshared) - 1);
}

void free_initmem(void)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-s390/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

#include <asm-generic/sections.h>

extern char _eshared[];

#endif

0 comments on commit fa0f3f6

Please sign in to comment.