Received: from eggs.gnu.org ([2001:4830:134:3::10]:42913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsvbW-0005ut-1D for qemu-devel@nongnu.org; Tue, 17 Dec 2013 09:26:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsvbO-00086A-9B for qemu-devel@nongnu.org; Tue, 17 Dec 2013 09:26:33 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:39310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsvbO-00085k-00 for qemu-devel@nongnu.org; Tue, 17 Dec 2013 09:26:26 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Dec 2013 14:26:23 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id E915D17D805C for ; Tue, 17 Dec 2013 14:26:18 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBHEQ81e62128338 for ; Tue, 17 Dec 2013 14:26:08 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBHEQJEp009929 for ; Tue, 17 Dec 2013 07:26:20 -0700 Date: Tue, 17 Dec 2013 15:26:17 +0100 From: Thomas Huth Message-ID: <20131217152617.77d09322@oc7435384737.ibm.com> In-Reply-To: <50F6C646-5709-413F-A821-CFB97F422C03@suse.de> References: <1387286530-31516-1-git-send-email-jfrei@linux.vnet.ibm.com> <1387286530-31516-6-git-send-email-jfrei@linux.vnet.ibm.com> <50F6C646-5709-413F-A821-CFB97F422C03@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/8] s390x/kvm: Implemented SIGP START List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Christian Borntraeger , Jens Freimann , QEMU Developers Hi Alex, On Tue, 17 Dec 2013 14:56:33 +0100 Alexander Graf wrote: > > On 17.12.2013, at 14:22, Jens Freimann wrote: > > > From: Thomas Huth > > > > This patch adds the missing START order to the SIGP instruction handler. > > Does the spec define what happens on START when the CPU is already running? As far as I can see, the spec does not explicitely defines the behavior in that case, it says only: "The order is effective only when the addressed CPU is in the stopped state". But according to my experiments (I wrote a test program that I ran without additional hypervisor), the START order is simply ignored when the CPU is already running and CC0 is returned. This is also what happens with the code below, since s390_add_running_cpu() only does something if the "halted" flag is set, and kicking a CPU that is already running does not hurt either, as far as I can see. > Does START modify any register state? No, the CPU simply continues running with the state where it has been stopped before. Thomas > > > > > Signed-off-by: Thomas Huth > > Reviewed-by: Cornelia Huck > > Signed-off-by: Jens Freimann > > --- > > target-s390x/kvm.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c > > index 8c54134..fcc159f 100644 > > --- a/target-s390x/kvm.c > > +++ b/target-s390x/kvm.c > > @@ -588,6 +588,14 @@ static int handle_diag(S390CPU *cpu, struct kvm_run *run, uint32_t ipb) > > return r; > > } > > > > +static int kvm_s390_cpu_start(S390CPU *cpu) > > +{ > > + 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) > > { > > kvm_s390_interrupt(cpu, KVM_S390_RESTART, 0); > > @@ -642,6 +650,9 @@ static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) > > } > > > > switch (order_code) { > > + case SIGP_START: > > + r = kvm_s390_cpu_start(target_cpu); > > + break; > > case SIGP_RESTART: > > r = kvm_s390_cpu_restart(target_cpu); > > break; > > -- > > 1.8.3.4 > > >