diff options
author | Jason J. Herne <jjherne@us.ibm.com> | 2013-04-25 04:25:51 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-04-26 20:18:25 +0200 |
commit | 3474b679486caa8f6448bae974e131370f360c13 (patch) | |
tree | 89f54e363e4fb01e20409e606ba8f8f89e9836d6 /target-s390x | |
parent | 420840e58b85f7f4e5493dca3f273566f261090a (diff) |
Utilize selective runtime reg sync for hot code paths
Make use of new kvm_s390_get_registers_partial() for kvm_handle_css_inst() and
handle_hypercall() since they only need registers from the partial set and they
are called quite frequently.
Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/kvm.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 02b2e397a2..fb006eeffd 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -467,12 +467,16 @@ static int kvm_handle_css_inst(S390CPU *cpu, struct kvm_run *run, int r = 0; int no_cc = 0; CPUS390XState *env = &cpu->env; + CPUState *cs = ENV_GET_CPU(env); if (ipa0 != 0xb2) { /* Not handled for now. */ return -1; } - cpu_synchronize_state(env); + + kvm_s390_get_registers_partial(cs); + cs->kvm_vcpu_dirty = true; + switch (ipa1) { case PRIV_XSCH: r = ioinst_handle_xsch(env, env->regs[1]); @@ -603,7 +607,10 @@ static int handle_priv(S390CPU *cpu, struct kvm_run *run, static int handle_hypercall(CPUS390XState *env, struct kvm_run *run) { - cpu_synchronize_state(env); + CPUState *cs = ENV_GET_CPU(env); + + kvm_s390_get_registers_partial(cs); + cs->kvm_vcpu_dirty = true; env->regs[2] = s390_virtio_hypercall(env); return 0; @@ -808,7 +815,9 @@ static int handle_tsch(S390CPU *cpu) struct kvm_run *run = cs->kvm_run; int ret; - cpu_synchronize_state(env); + kvm_s390_get_registers_partial(cs); + cs->kvm_vcpu_dirty = true; + ret = ioinst_handle_tsch(env, env->regs[1], run->s390_tsch.ipb); if (ret >= 0) { /* Success; set condition code. */ |