From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
KVM list <kvm@vger.kernel.org>, Alexander Graf <agraf@suse.de>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Carsten Otte <cotte@de.ibm.com>
Subject: [PATCH 1/2]: kvm-s390: use guest flush inline function
Date: Tue, 20 Dec 2011 12:40:25 +0100 [thread overview]
Message-ID: <4EF07429.2000203@de.ibm.com> (raw)
In-Reply-To: <4EF05EDA.2040604@redhat.com>
From: Christian Borntraeger <borntraeger@de.ibm.com>
Move all open-coded guest flush operations into an inline function.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
arch/s390/kvm/interrupt.c | 2 +-
arch/s390/kvm/kvm-s390.c | 2 +-
arch/s390/kvm/kvm-s390.h | 7 ++++++-
3 files changed, 8 insertions(+), 3 deletions(-)
Index: b/arch/s390/kvm/interrupt.c
===================================================================
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -237,7 +237,7 @@ static void __do_deliver_interrupt(struc
inti->prefix.address);
vcpu->stat.deliver_prefix_signal++;
vcpu->arch.sie_block->prefix = inti->prefix.address;
- vcpu->arch.sie_block->ihcpu = 0xffff;
+ flush_guest_cpu(vcpu);
break;
case KVM_S390_RESTART:
Index: b/arch/s390/kvm/kvm-s390.c
===================================================================
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -291,7 +291,6 @@ static void kvm_s390_vcpu_initial_reset(
vcpu->arch.sie_block->gpsw.mask = 0UL;
vcpu->arch.sie_block->gpsw.addr = 0UL;
vcpu->arch.sie_block->prefix = 0UL;
- vcpu->arch.sie_block->ihcpu = 0xffff;
vcpu->arch.sie_block->cputm = 0UL;
vcpu->arch.sie_block->ckc = 0UL;
vcpu->arch.sie_block->todpr = 0;
@@ -301,6 +300,7 @@ static void kvm_s390_vcpu_initial_reset(
vcpu->arch.guest_fpregs.fpc = 0;
asm volatile("lfpc %0" : : "Q" (vcpu->arch.guest_fpregs.fpc));
vcpu->arch.sie_block->gbea = 1;
+ flush_guest_cpu(vcpu);
}
int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
Index: b/arch/s390/kvm/kvm-s390.h
===================================================================
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -1,7 +1,7 @@
/*
* kvm_s390.h - definition for kvm on s390
*
- * Copyright IBM Corp. 2008,2009
+ * Copyright IBM Corp. 2008,2011
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2 only)
@@ -47,6 +47,11 @@ static inline int __cpu_is_stopped(struc
return atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_STOP_INT;
}
+static inline void flush_guest_cpu(struct kvm_vcpu *vcpu)
+{
+ vcpu->arch.sie_block->ihcpu = 0xffff;
+}
+
int kvm_s390_handle_wait(struct kvm_vcpu *vcpu);
enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);
void kvm_s390_tasklet(unsigned long parm);
next prev parent reply other threads:[~2011-12-20 11:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 9:38 [PATCH]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs Christian Borntraeger
2011-12-20 9:52 ` Avi Kivity
2011-12-20 9:59 ` Christian Borntraeger
2011-12-20 10:09 ` Avi Kivity
2011-12-20 11:40 ` Christian Borntraeger [this message]
2011-12-20 11:41 ` [PATCH 2/2]: " Christian Borntraeger
2011-12-20 14:20 ` Alexander Graf
2011-12-20 16:16 ` Christian Borntraeger
2011-12-20 16:28 ` Alexander Graf
2011-12-21 6:52 ` Christian Borntraeger
2011-12-21 7:10 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EF07429.2000203@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).