Commit 1c767347 authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik

s390/vtime: use cpu alternative for stck/stckf

Use a cpu alternative to switch between stck and stckf instead of
making it compile time dependent. This will also make kernels compiled
for old machines, but running on newer machines, use stckf.
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 80841ad8
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/time.h> #include <linux/time.h>
#include <asm/alternative.h>
#include <asm/vtimer.h> #include <asm/vtimer.h>
#include <asm/vtime.h> #include <asm/vtime.h>
#include <asm/cpu_mf.h> #include <asm/cpu_mf.h>
...@@ -128,16 +128,13 @@ static int do_account_vtime(struct task_struct *tsk) ...@@ -128,16 +128,13 @@ static int do_account_vtime(struct task_struct *tsk)
timer = S390_lowcore.last_update_timer; timer = S390_lowcore.last_update_timer;
clock = S390_lowcore.last_update_clock; clock = S390_lowcore.last_update_clock;
asm volatile( /* Use STORE CLOCK by default, STORE CLOCK FAST if available. */
" stpt %0\n" /* Store current cpu timer value */ alternative_io("stpt %0\n .insn s,0xb2050000,%1\n",
#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES "stpt %0\n .insn s,0xb27c0000,%1\n",
" stckf %1" /* Store current tod clock value */ 25,
#else ASM_OUTPUT2("=Q" (S390_lowcore.last_update_timer),
" stck %1" /* Store current tod clock value */ "=Q" (S390_lowcore.last_update_clock)),
#endif ASM_NO_INPUT_CLOBBER("cc"));
: "=Q" (S390_lowcore.last_update_timer),
"=Q" (S390_lowcore.last_update_clock)
: : "cc");
clock = S390_lowcore.last_update_clock - clock; clock = S390_lowcore.last_update_clock - clock;
timer -= S390_lowcore.last_update_timer; timer -= S390_lowcore.last_update_timer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment