From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Date: Tue, 22 Mar 2016 08:25:58 +0000 Subject: Re: [kvm-unit-tests PATCH v2 5/5] powerpc: Check lswx in little-endian mode. Message-Id: <56F10196.3020905@redhat.com> List-Id: References: <1458560014-28862-1-git-send-email-lvivier@redhat.com> <1458560014-28862-6-git-send-email-lvivier@redhat.com> <20160322105609.1bed546e@voom.fritz.box> <56F0FE6F.8010501@redhat.com> In-Reply-To: <56F0FE6F.8010501@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Huth , David Gibson Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com On 22/03/2016 09:12, Thomas Huth wrote: > On 22.03.2016 00:56, David Gibson wrote: >> On Mon, 21 Mar 2016 12:33:34 +0100 >> Laurent Vivier wrote: >> >>> For lswx in little-endian mode, an alignment interrupt occurs. >>> >>> Signed-off-by: Laurent Vivier >>> Reviewed-by: Thomas Huth >> >> I'm not entirely clear here; will the test fail if the alignment >> exception doesn't occur in little endian mode? > > I think so, yes. > >> The general trend in Power has been for less and less things to trigger >> alignment exceptions, so failing to cause an alignment exception >> shouldn't cause a test failure (as long as the unaligned case is >> correctly processed, of course). > > According to the PowerISA 2.07, chapter 6.5.8, lswx should always > trigger an alignment exception in little endian mode. So that's > architected behavior and the test should be OK, as far as I can see... > In case this gets changed with a future CPU, I think the test could be > adapted later, too? Exactly. Then in the kernel, the instruction is emulated. It's why I didn't understand why this test case fails with kvm in little endian mode, while is was working on a real host or in a guest. Laurent From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Subject: Re: [kvm-unit-tests PATCH v2 5/5] powerpc: Check lswx in little-endian mode. Date: Tue, 22 Mar 2016 09:25:58 +0100 Message-ID: <56F10196.3020905@redhat.com> References: <1458560014-28862-1-git-send-email-lvivier@redhat.com> <1458560014-28862-6-git-send-email-lvivier@redhat.com> <20160322105609.1bed546e@voom.fritz.box> <56F0FE6F.8010501@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com To: Thomas Huth , David Gibson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56414 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755474AbcCVI0C (ORCPT ); Tue, 22 Mar 2016 04:26:02 -0400 In-Reply-To: <56F0FE6F.8010501@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 22/03/2016 09:12, Thomas Huth wrote: > On 22.03.2016 00:56, David Gibson wrote: >> On Mon, 21 Mar 2016 12:33:34 +0100 >> Laurent Vivier wrote: >> >>> For lswx in little-endian mode, an alignment interrupt occurs. >>> >>> Signed-off-by: Laurent Vivier >>> Reviewed-by: Thomas Huth >> >> I'm not entirely clear here; will the test fail if the alignment >> exception doesn't occur in little endian mode? > > I think so, yes. > >> The general trend in Power has been for less and less things to trigger >> alignment exceptions, so failing to cause an alignment exception >> shouldn't cause a test failure (as long as the unaligned case is >> correctly processed, of course). > > According to the PowerISA 2.07, chapter 6.5.8, lswx should always > trigger an alignment exception in little endian mode. So that's > architected behavior and the test should be OK, as far as I can see... > In case this gets changed with a future CPU, I think the test could be > adapted later, too? Exactly. Then in the kernel, the instruction is emulated. It's why I didn't understand why this test case fails with kvm in little endian mode, while is was working on a real host or in a guest. Laurent