From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 1/6] target-arm: kvm: save/restore mp state Date: Tue, 03 Mar 2015 12:06:40 +0100 Message-ID: <54F595C0.5060004@redhat.com> References: <1424880159-29348-1-git-send-email-alex.bennee@linaro.org> <1424880159-29348-2-git-send-email-alex.bennee@linaro.org> <8761ai73j1.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 68B8A4782B for ; Tue, 3 Mar 2015 06:00:55 -0500 (EST) Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n8fll7DADqKf for ; Tue, 3 Mar 2015 06:00:53 -0500 (EST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 9A4D747829 for ; Tue, 3 Mar 2015 06:00:53 -0500 (EST) In-Reply-To: <8761ai73j1.fsf@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: =?UTF-8?B?QWxleCBCZW5uw6ll?= , Peter Maydell Cc: kvm-devel , Marc Zyngier , QEMU Developers , "kvmarm@lists.cs.columbia.edu" , arm-mail-list List-Id: kvmarm@lists.cs.columbia.edu CgpPbiAwMy8wMy8yMDE1IDExOjU2LCBBbGV4IEJlbm7DqWUgd3JvdGU6Cj4gPiA+IFRoaXMgYWRk cyB0aGUgc2F2aW5nIGFuZCByZXN0b3JlIG9mIHRoZSBjdXJyZW50IE11bHRpLVByb2Nlc3Npbmcg c3RhdGUKPiA+ID4gb2YgdGhlIG1hY2hpbmUuIFdoaWxlIHRoZSBLVk1fR0VUL1NFVF9NUF9TVEFU RSBBUEkgZ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bG1hbi9saXN0aW5mby9rdm1hcm0K From mboxrd@z Thu Jan 1 00:00:00 1970 From: pbonzini@redhat.com (Paolo Bonzini) Date: Tue, 03 Mar 2015 12:06:40 +0100 Subject: [PATCH 1/6] target-arm: kvm: save/restore mp state In-Reply-To: <8761ai73j1.fsf@linaro.org> References: <1424880159-29348-1-git-send-email-alex.bennee@linaro.org> <1424880159-29348-2-git-send-email-alex.bennee@linaro.org> <8761ai73j1.fsf@linaro.org> Message-ID: <54F595C0.5060004@redhat.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 03/03/2015 11:56, Alex Benn?e wrote: > > > This adds the saving and restore of the current Multi-Processing state > > > of the machine. While the KVM_GET/SET_MP_STATE API exposes a number of > > > potential states for x86 we only use two for ARM. Either the process is > > > running or not. > > > > By this you mean "is the CPU in the PSCI powered down state or not", > > right? > > From the vcpu's perspective it is either running or not. However it is > the same mechanism that is used when PSCI_0_2_FN_CPU_OFF is passed the > VM, internally setting vcpu->arch.paused. I suggest that you define a new MP_STATE constant for this. HALTED in x86 and s390 is the state an ARM processor enters when you execute wfi. Right now this is not migrated on ARM if I remember correctly, but perhaps you'll want to add it in the future. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSkfc-0006CA-J8 for qemu-devel@nongnu.org; Tue, 03 Mar 2015 06:07:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSkfX-0000Ic-7G for qemu-devel@nongnu.org; Tue, 03 Mar 2015 06:07:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSkfX-0000Ho-0F for qemu-devel@nongnu.org; Tue, 03 Mar 2015 06:07:19 -0500 Message-ID: <54F595C0.5060004@redhat.com> Date: Tue, 03 Mar 2015 12:06:40 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1424880159-29348-1-git-send-email-alex.bennee@linaro.org> <1424880159-29348-2-git-send-email-alex.bennee@linaro.org> <8761ai73j1.fsf@linaro.org> In-Reply-To: <8761ai73j1.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/6] target-arm: kvm: save/restore mp state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QWxleCBCZW5uw6ll?= , Peter Maydell Cc: kvm-devel , Marc Zyngier , QEMU Developers , Christoffer Dall , "kvmarm@lists.cs.columbia.edu" , arm-mail-list On 03/03/2015 11:56, Alex Benn=C3=A9e wrote: > > > This adds the saving and restore of the current Multi-Processing st= ate > > > of the machine. While the KVM_GET/SET_MP_STATE API exposes a number= of > > > potential states for x86 we only use two for ARM. Either the proces= s is > > > running or not. > > > > By this you mean "is the CPU in the PSCI powered down state or not", > > right? >=20 > From the vcpu's perspective it is either running or not. However it is > the same mechanism that is used when PSCI_0_2_FN_CPU_OFF is passed the > VM, internally setting vcpu->arch.paused. I suggest that you define a new MP_STATE constant for this. HALTED in x86 and s390 is the state an ARM processor enters when you execute wfi. Right now this is not migrated on ARM if I remember correctly, but perhaps you'll want to add it in the future. Paolo