Skip to content

Commit

Permalink
[S390] reset cputime accounting after IPL from NSS
Browse files Browse the repository at this point in the history
After an IPL from NSS the uptime of the system is incorrect. The reason
is that the startup code in head.S is not executed in case of an IPL
from NSS. Due to that sched_clock_base_cc which is used to initialze
wall_to_monotonic contains the time stamp when the NSS has been created
instead of the time stamp of the system start.

Reinitialize the cputime accounting values in create_kernel_nss after
the SAVESYS CP command that created the NSS segment.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky authored and Martin Schwidefsky committed Nov 13, 2009
1 parent ccaf655 commit b89031e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static void __init reset_tod_clock(void)
disabled_wait(0);

sched_clock_base_cc = TOD_UNIX_EPOCH;
S390_lowcore.last_update_clock = sched_clock_base_cc;
}

#ifdef CONFIG_SHARED_KERNEL
Expand Down Expand Up @@ -167,6 +168,14 @@ static noinline __init void create_kernel_nss(void)
return;
}

/* re-initialize cputime accounting. */
sched_clock_base_cc = get_clock();
S390_lowcore.last_update_clock = sched_clock_base_cc;
S390_lowcore.last_update_timer = 0x7fffffffffffffffULL;
S390_lowcore.user_timer = 0;
S390_lowcore.system_timer = 0;
asm volatile("SPT 0(%0)" : : "a" (&S390_lowcore.last_update_timer));

/* re-setup boot command line with new ipl vm parms */
ipl_update_parameters();
setup_boot_command_line();
Expand Down

0 comments on commit b89031e

Please sign in to comment.