From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXMxu-0008Fy-9B for qemu-devel@nongnu.org; Thu, 03 Sep 2015 01:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXMxp-0005Of-CD for qemu-devel@nongnu.org; Thu, 03 Sep 2015 01:21:38 -0400 Date: Thu, 3 Sep 2015 15:18:23 +1000 From: Paul Mackerras Message-ID: <20150903051823.GE3380@iris.ozlabs.ibm.com> References: <20150703060102.GB16378@voom.redhat.com> <559CDF1D.9090103@linux.vnet.ibm.com> <20150807033745.GA4645@tungsten.ozlabs.ibm.com> <55C75B3E.70409@suse.de> <20150810040555.GA9392@tungsten.ozlabs.ibm.com> <55E58707.1030904@linux.vnet.ibm.com> <20150902063401.GA12512@tungsten.ozlabs.ibm.com> <20150902235320.GC6537@voom.redhat.com> <20150903032421.GA4355@tungsten.ozlabs.ibm.com> <20150903050521.GK6537@voom.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150903050521.GK6537@voom.redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 0/4] target-ppc: Add FWNMI support in qemu for powerKVM guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: benh@au1.ibm.com, Alexander Graf , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Aravinda Prasad , Sam Bobroff On Thu, Sep 03, 2015 at 03:05:21PM +1000, David Gibson wrote: > On Thu, Sep 03, 2015 at 01:24:21PM +1000, Sam Bobroff wrote: > > PAPR only says SPRGs 0 to 3 are for software use, but the kernel (see > > arch/powerpc/include/asm/reg.h) defines SPRG2 as an exception scratch= register > > so it should be the right one to use here. >=20 > Uh.. no. If 0..3 are for software (i.e. OS) use, then this needs to > use a different one, since it's being used as a firmware resource > here. Linux might treat SPRG2 as scratch, but another OS would be > within its rights to use it for something persistent. PAPR says in requirement R1-14.1.2-3 "To avoid conflict with the platform=E2=80=99s hypervisor, the OS must be prepared to share use of SP= RG2 as the interrupt scratch register whenever an hcall() is made, or a machine check or reset interrupt is taken." So, SPRG2 is the one to use here. Paul.