From: Jens Freimann <jfrei@linux.vnet.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
Alexander Graf <agraf@suse.de>,
Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: David Hildenbrand <dahi@linux.vnet.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/5] s390x/kvm: execute sigp orders on the target vcpu thread
Date: Thu, 28 Aug 2014 13:58:50 +0200 [thread overview]
Message-ID: <1409227132-55354-4-git-send-email-jfrei@linux.vnet.ibm.com> (raw)
In-Reply-To: <1409227132-55354-1-git-send-email-jfrei@linux.vnet.ibm.com>
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
All sigp orders that can result in ioctls on the target vcpu should be executed
on the associated vcpu thread.
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
---
target-s390x/kvm.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index a32d91a..421ff43 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -916,23 +916,30 @@ static int handle_diag(S390CPU *cpu, struct kvm_run *run, uint32_t ipb)
return r;
}
-static int kvm_s390_cpu_start(S390CPU *cpu)
+static void sigp_cpu_start(void *arg)
{
+ CPUState *cs = arg;
+ S390CPU *cpu = S390_CPU(cs);
+
s390_add_running_cpu(cpu);
- qemu_cpu_kick(CPU(cpu));
DPRINTF("DONE: KVM cpu start: %p\n", &cpu->env);
- return 0;
}
-int kvm_s390_cpu_restart(S390CPU *cpu)
+static void sigp_cpu_restart(void *arg)
{
+ CPUState *cs = arg;
+ S390CPU *cpu = S390_CPU(cs);
struct kvm_s390_irq irq = {
.type = KVM_S390_RESTART,
};
kvm_s390_vcpu_interrupt(cpu, &irq);
s390_add_running_cpu(cpu);
- qemu_cpu_kick(CPU(cpu));
+}
+
+int kvm_s390_cpu_restart(S390CPU *cpu)
+{
+ run_on_cpu(CPU(cpu), sigp_cpu_restart, CPU(cpu));
DPRINTF("DONE: KVM cpu restart: %p\n", &cpu->env);
return 0;
}
@@ -980,10 +987,12 @@ static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
switch (order_code) {
case SIGP_START:
- cc = kvm_s390_cpu_start(target_cpu);
+ run_on_cpu(CPU(target_cpu), sigp_cpu_start, CPU(target_cpu));
+ cc = 0;
break;
case SIGP_RESTART:
- cc = kvm_s390_cpu_restart(target_cpu);
+ run_on_cpu(CPU(target_cpu), sigp_cpu_restart, CPU(target_cpu));
+ cc = 0;
break;
case SIGP_SET_ARCH:
*statusreg &= 0xffffffff00000000UL;
--
1.9.3
next prev parent reply other threads:[~2014-08-28 11:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 11:58 [Qemu-devel] [PATCH 0/5] s390x/kvm: avoid synchronize_rcu's in kernel Jens Freimann
2014-08-28 11:58 ` [Qemu-devel] [PATCH 1/5] kvm: run cpu state synchronization on target vcpu thread Jens Freimann
2014-08-28 11:58 ` [Qemu-devel] [PATCH 2/5] s390x/kvm: run guest triggered resets on the " Jens Freimann
2014-08-28 11:58 ` Jens Freimann [this message]
2014-08-28 11:58 ` [Qemu-devel] [PATCH 4/5] s390x/kvm: execute "system reset" cpu resets on the " Jens Freimann
2014-08-28 11:58 ` [Qemu-devel] [PATCH 5/5] s390x/kvm: execute the first cpu reset " Jens Freimann
2014-08-28 12:58 ` [Qemu-devel] [PATCH 0/5] s390x/kvm: avoid synchronize_rcu's in kernel Christian Borntraeger
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=1409227132-55354-4-git-send-email-jfrei@linux.vnet.ibm.com \
--to=jfrei@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).