From patchwork Wed Apr 20 11:40:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 8888971 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 08193BF29F for ; Wed, 20 Apr 2016 11:41:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33B0D201C8 for ; Wed, 20 Apr 2016 11:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 659C92010C for ; Wed, 20 Apr 2016 11:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753761AbcDTLky (ORCPT ); Wed, 20 Apr 2016 07:40:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52770 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752383AbcDTLkx (ORCPT ); Wed, 20 Apr 2016 07:40:53 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43E3BC05E16D; Wed, 20 Apr 2016 11:40:53 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-112-34.ams2.redhat.com [10.36.112.34]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3KBenfG029094; Wed, 20 Apr 2016 07:40:50 -0400 From: Laurent Vivier To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: drjones@redhat.com, thuth@redhat.com, dgibson@redhat.com, pbonzini@redhat.com, Laurent Vivier Subject: [kvm-unit-tests PATCH v2] powerpc: don't fail if QEMU does not support alignment exception Date: Wed, 20 Apr 2016 13:40:47 +0200 Message-Id: <1461152447-11381-1-git-send-email-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Thomas Huth Reviewed-by: David Gibson --- 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.