Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] cio: Call cancel_halt_clear even when actl == 0.
  [S390] cio: Use path verification to check for path state.
  [S390] cio: Fix locking when calling notify function.
  [S390] Fixed handling of access register mode faults.
  [S390] dasd: Use default recovery for SNSS requests
  [S390] check_bugs() should be inline.
  [S390] tape: Compression overwrites crypto setting
  [S390] nss: disable kexec.
  [S390] reipl: move dump_prefix_page out of text section.
  [S390] smp: disable preemption in smp_call_function/smp_call_function_on
  [S390] kprobes breaks BUG_ON
  • Loading branch information
Linus Torvalds committed Mar 7, 2007
2 parents ae5dd8e + 2470b64 commit fe1b4ba
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 161 deletions.
2 changes: 2 additions & 0 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ config SHARED_KERNEL
Select this option, if you want to share the text segment of the
Linux kernel between different VM guests. This reduces memory
usage with lots of guests but greatly increases kernel size.
Also if a kernel was IPL'ed from a shared segment the kexec system
call will not work.
You should only select this option if you know what you are
doing and want to exploit this feature.

Expand Down
11 changes: 8 additions & 3 deletions arch/s390/kernel/head31.S
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ startup_continue:
.long .Lduct # cr2: dispatchable unit control table
.long 0 # cr3: instruction authorization
.long 0 # cr4: instruction authorization
.long 0xffffffff # cr5: primary-aste origin
.long .Lduct # cr5: primary-aste origin
.long 0 # cr6: I/O interrupts
.long 0 # cr7: secondary space segment table
.long 0 # cr8: access registers translation
Expand All @@ -132,8 +132,6 @@ startup_continue:
.long 0 # cr13: home space segment table
.long 0xc0000000 # cr14: machine check handling off
.long 0 # cr15: linkage stack operations
.Lduct: .long 0,0,0,0,0,0,0,0
.long 0,0,0,0,0,0,0,0
.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu
.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp
.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg
Expand All @@ -147,6 +145,13 @@ startup_continue:
.Linittu: .long init_thread_union
.Lstartup_init:
.long startup_init
.align 64
.Lduct: .long 0,0,0,0,.Lduald,0,0,0
.long 0,0,0,0,0,0,0,0
.align 128
.Lduald:.rept 8
.long 0x80000000,0,0,0 # invalid access-list entries
.endr

.org 0x12000
.globl _ehead
Expand Down
11 changes: 8 additions & 3 deletions arch/s390/kernel/head64.S
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ startup_continue:
.quad .Lduct # cr2: dispatchable unit control table
.quad 0 # cr3: instruction authorization
.quad 0 # cr4: instruction authorization
.quad 0xffffffffffffffff # cr5: primary-aste origin
.quad .Lduct # cr5: primary-aste origin
.quad 0 # cr6: I/O interrupts
.quad 0 # cr7: secondary space segment table
.quad 0 # cr8: access registers translation
Expand All @@ -145,14 +145,19 @@ startup_continue:
.quad 0 # cr13: home space segment table
.quad 0xc0000000 # cr14: machine check handling off
.quad 0 # cr15: linkage stack operations
.Lduct: .long 0,0,0,0,0,0,0,0
.long 0,0,0,0,0,0,0,0
.Lpcmsk:.quad 0x0000000180000000
.L4malign:.quad 0xffffffffffc00000
.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
.Lnop: .long 0x07000700
.Lparmaddr:
.quad PARMAREA
.align 64
.Lduct: .long 0,0,0,0,.Lduald,0,0,0
.long 0,0,0,0,0,0,0,0
.align 128
.Lduald:.rept 8
.long 0x80000000,0,0,0 # invalid access-list entries
.endr

.org 0x12000
.globl _ehead
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/kernel/ipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ static void do_reset_calls(void)
reset->fn();
}

extern __u32 dump_prefix_page;
u32 dump_prefix_page;

void s390_reset_system(void)
{
Expand All @@ -1078,7 +1078,7 @@ void s390_reset_system(void)
lc->panic_stack = S390_lowcore.panic_stack;

/* Save prefix page address for dump case */
dump_prefix_page = (unsigned long) lc;
dump_prefix_page = (u32)(unsigned long) lc;

/* Disable prefixing */
set_prefix(0);
Expand Down
21 changes: 7 additions & 14 deletions arch/s390/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,21 +337,14 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
}

p = get_kprobe(addr);
if (!p) {
if (*addr != BREAKPOINT_INSTRUCTION) {
/*
* The breakpoint instruction was removed right
* after we hit it. Another cpu has removed
* either a probepoint or a debugger breakpoint
* at this address. In either case, no further
* handling of this interrupt is appropriate.
*
*/
ret = 1;
}
/* Not one of ours: let kernel handle it */
if (!p)
/*
* No kprobe at this address. The fault has not been
* caused by a kprobe breakpoint. The race of breakpoint
* vs. kprobe remove does not exist because on s390 we
* use stop_machine_run to arm/disarm the breakpoints.
*/
goto no_kprobe;
}

kcb->kprobe_status = KPROBE_HIT_ACTIVE;
set_current_kprobe(p, regs, kcb);
Expand Down
5 changes: 5 additions & 0 deletions arch/s390/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <asm/system.h>
#include <asm/smp.h>
#include <asm/reset.h>
#include <asm/ipl.h>

typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long);

Expand All @@ -29,6 +30,10 @@ int machine_kexec_prepare(struct kimage *image)
{
void *reboot_code_buffer;

/* Can't replace kernel image since it is read-only. */
if (ipl_flags & IPL_NSS_VALID)
return -ENOSYS;

/* We don't support anything but the default image type for now. */
if (image->type != KEXEC_TYPE_DEFAULT)
return -EINVAL;
Expand Down
13 changes: 7 additions & 6 deletions arch/s390/kernel/reipl.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

#include <asm/lowcore.h>

#
# do_reipl_asm
# Parameter: r2 = schid of reipl device
#
.globl do_reipl_asm
do_reipl_asm: basr %r13,0
.Lpg0: lpsw .Lnewpsw-.Lpg0(%r13)
Expand All @@ -16,12 +20,12 @@ do_reipl_asm: basr %r13,0
stm %r0,%r15,__LC_GPREGS_SAVE_AREA
stctl %c0,%c15,__LC_CREGS_SAVE_AREA
stam %a0,%a15,__LC_AREGS_SAVE_AREA
mvc __LC_PREFIX_SAVE_AREA(4),dump_prefix_page-.Lpg0(%r13)
l %r10,.Ldump_pfx-.Lpg0(%r13)
mvc __LC_PREFIX_SAVE_AREA(4),0(%r10)
stckc .Lclkcmp-.Lpg0(%r13)
mvc __LC_CLOCK_COMP_SAVE_AREA(8),.Lclkcmp-.Lpg0(%r13)
stpt __LC_CPU_TIMER_SAVE_AREA
st %r13, __LC_PSW_SAVE_AREA+4

lctl %c6,%c6,.Lall-.Lpg0(%r13)
lr %r1,%r2
mvc __LC_PGM_NEW_PSW(8),.Lpcnew-.Lpg0(%r13)
Expand Down Expand Up @@ -55,6 +59,7 @@ do_reipl_asm: basr %r13,0
.align 8
.Lclkcmp: .quad 0x0000000000000000
.Lall: .long 0xff000000
.Ldump_pfx: .long dump_prefix_page
.align 8
.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1
.Lpcnew: .long 0x00080000,0x80000000+.Lecs
Expand All @@ -79,7 +84,3 @@ do_reipl_asm: basr %r13,0
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.globl dump_prefix_page
dump_prefix_page:
.long 0x00000000

13 changes: 9 additions & 4 deletions arch/s390/kernel/reipl64.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
*/

#include <asm/lowcore.h>

#
# do_reipl_asm
# Parameter: r2 = schid of reipl device
#

.globl do_reipl_asm
do_reipl_asm: basr %r13,0
.Lpg0: lpswe .Lnewpsw-.Lpg0(%r13)
Expand All @@ -20,7 +26,8 @@ do_reipl_asm: basr %r13,0
stg %r0,__LC_GPREGS_SAVE_AREA-0x1000+8(%r1)
stctg %c0,%c15,__LC_CREGS_SAVE_AREA-0x1000(%r1)
stam %a0,%a15,__LC_AREGS_SAVE_AREA-0x1000(%r1)
mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),dump_prefix_page-.Lpg0(%r13)
lg %r10,.Ldump_pfx-.Lpg0(%r13)
mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),0(%r10)
stfpc __LC_FP_CREG_SAVE_AREA-0x1000(%r1)
stckc .Lclkcmp-.Lpg0(%r13)
mvc __LC_CLOCK_COMP_SAVE_AREA-0x1000(8,%r1),.Lclkcmp-.Lpg0(%r13)
Expand Down Expand Up @@ -64,6 +71,7 @@ do_reipl_asm: basr %r13,0
.align 8
.Lclkcmp: .quad 0x0000000000000000
.Lall: .quad 0x00000000ff000000
.Ldump_pfx: .quad dump_prefix_page
.Lregsave: .quad 0x0000000000000000
.align 16
/*
Expand Down Expand Up @@ -103,6 +111,3 @@ do_reipl_asm: basr %r13,0
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.globl dump_prefix_page
dump_prefix_page:
.long 0x00000000
15 changes: 8 additions & 7 deletions arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
int cpu, local = 0;

/*
* Can deadlock when interrupts are disabled or if in wrong context,
* caller must disable preemption
* Can deadlock when interrupts are disabled or if in wrong context.
*/
WARN_ON(irqs_disabled() || in_irq() || preemptible());
WARN_ON(irqs_disabled() || in_irq());

/*
* Check for local function call. We have to have the same call order
Expand Down Expand Up @@ -152,17 +151,18 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
* Run a function on all other CPUs.
*
* You must not call this function with disabled interrupts or from a
* hardware interrupt handler. Must be called with preemption disabled.
* You may call it from a bottom half.
* hardware interrupt handler. You may call it from a bottom half.
*/
int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
int wait)
{
cpumask_t map;

preempt_disable();
map = cpu_online_map;
cpu_clear(smp_processor_id(), map);
__smp_call_function_map(func, info, nonatomic, wait, map);
preempt_enable();
return 0;
}
EXPORT_SYMBOL(smp_call_function);
Expand All @@ -178,16 +178,17 @@ EXPORT_SYMBOL(smp_call_function);
* Run a function on one processor.
*
* You must not call this function with disabled interrupts or from a
* hardware interrupt handler. Must be called with preemption disabled.
* You may call it from a bottom half.
* hardware interrupt handler. You may call it from a bottom half.
*/
int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic,
int wait, int cpu)
{
cpumask_t map = CPU_MASK_NONE;

preempt_disable();
cpu_set(cpu, map);
__smp_call_function_map(func, info, nonatomic, wait, map);
preempt_enable();
return 0;
}
EXPORT_SYMBOL(smp_call_function_on);
Expand Down
Loading

0 comments on commit fe1b4ba

Please sign in to comment.