From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alYk6-0001Py-Pp for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:18:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alYk1-0003va-NV for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:18:18 -0400 References: <1459357980-29330-1-git-send-email-lvivier@redhat.com> <20160331102945.5a31dbe5@voom.fritz.box> <56FCC99C.2030809@suse.de> <56FCCC6A.7000002@redhat.com> <56FCCEA3.5030705@suse.de> <56FCE4C5.1040706@redhat.com> <56FCE7CE.10702@suse.de> From: Thomas Huth Message-ID: <56FCEB52.7070001@redhat.com> Date: Thu, 31 Mar 2016 11:18:10 +0200 MIME-Version: 1.0 In-Reply-To: <56FCE7CE.10702@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-ppc: Multiple/String Word alignment exception List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Laurent Vivier , David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 31.03.2016 11:03, Alexander Graf wrote: > On 03/31/2016 10:50 AM, Thomas Huth wrote: >> On 31.03.2016 09:15, Alexander Graf wrote: >>> On 31.03.16 09:06, Laurent Vivier wrote: >>>> On 31/03/2016 08:54, Alexander Graf wrote: >>>>> On 31.03.16 01:29, David Gibson wrote: >>>>>> On Wed, 30 Mar 2016 19:13:00 +0200 >>>>>> Laurent Vivier wrote: >>>>>> >>>>>>> If the processor is in little-endian mode, an alignment interrupt >>>>>>> must >>>>>>> occur for the following instructions: lmw, stmw, lswi, lswx, >>>>>>> stswi or stswx. >>>>>>> >>>>>>> This is what happens with KVM, so change TCG to do the same. >>>>>>> >>>>>>> As the instruction can be emulated by the kernel, enable the chan= ge >>>>>>> only in softmmu mode. >>>>>>> >>>>>>> Signed-off-by: Laurent Vivier >>>>>> I guess this makes sense given the existing hardware behaviour, ev= en >>>>>> though it seems a bit perverse to me to make the emulator strictly >>>>>> less >>>>>> functional. >>>>>> >>>>>> Alex, what do you think? >>>>> In general we only implement strict checks if it breaks guests not = to >>>>> have them. Are you aware of any such case? >> Well, the new "emulator" test for kvm-unit-tests only works right if >> this is done correctly ;-) >> >>> That's basically what David was trying to say with POWER9. How do you >>> know that POWER9 still requires strong alignment checks for indexed L= E >>> instructions? If it doesn't, we'd have to add a case in TCG to not th= e >>> the checks again. These multiply very quickly :). >> I'd agree with you in case something is not properly defined in the IS= A >> or marked as implementation specific. But in this case, this behavior = is >> properly documented in the PowerISA spec. IMHO, if something is >> documented in the ISA, we should follow that behavior in QEMU, too, i.= e. >=20 > It's not even necessarily about documented or not. It's about > differences in different PowerISA versions :). As Laurent already mentioned it in another mail, it's defined like this in pretty much all of the ISAs - at least from 2.01 to 2.07 as far as I can see, too. (I don't have an older version of the PowerISA than 2.01). I just checked also the "User Manuals" of the PPC 601, the PPC 603, and the MPC750, and they also specify that these instructions cause an alignment exception in little endian mode, so I think this really should occur pretty much with every PPC chip that can run in little endian mode. Thomas