From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH v2] powerpc: don't fail if QEMU does not support alignment exception Date: Wed, 20 Apr 2016 13:45:42 +0200 Message-ID: <57176BE6.1090701@redhat.com> References: <1461152447-11381-1-git-send-email-lvivier@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: drjones@redhat.com, dgibson@redhat.com, pbonzini@redhat.com To: Laurent Vivier , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49839 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753843AbcDTLpq (ORCPT ); Wed, 20 Apr 2016 07:45:46 -0400 In-Reply-To: <1461152447-11381-1-git-send-email-lvivier@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 20.04.2016 13:40, Laurent Vivier wrote: > As for lswi, lswx is supposed to cause an alignment exception in > little endian mode, but QEMU does not support it. So in case we do > not get an exception, this is an expected failure and we run the other > tests. > > Signed-off-by: Laurent Vivier > --- > v2: move report("partial",...) out of #if..#endif block > > powerpc/emulator.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/powerpc/emulator.c b/powerpc/emulator.c > index 4dc341f..0e5f7a3 100644 > --- a/powerpc/emulator.c > +++ b/powerpc/emulator.c > @@ -245,11 +245,18 @@ static void test_lswx(void) > "xer", "r11", "r12", "memory"); > > #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ > - report("alignment", alignment); > - return; > -#else > - report("partial", regs[0] == 0x01020300 && regs[1] == (uint64_t)-1); > + /* > + * lswx is supposed to cause an alignment exception in little endian > + * mode, but QEMU does not support it. So in case we do not get an > + * exception, this is an expected failure and we run the other tests > + */ > + report_xfail("alignment", !alignment, alignment); > + if (alignment) { > + report_prefix_pop(); > + return; > + } > #endif > + report("partial", regs[0] == 0x01020300 && regs[1] == (uint64_t)-1); > > /* check an old know bug: the number of bytes is used as > * the number of registers, so try 32 bytes. > Looks fine! Reviewed-by: Thomas Huth