From patchwork Tue Apr 19 13:36:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 8880131 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4DBE49F1C1 for ; Tue, 19 Apr 2016 13:37:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCAF120263 for ; Tue, 19 Apr 2016 13:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 646D720268 for ; Tue, 19 Apr 2016 13:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754493AbcDSNgw (ORCPT ); Tue, 19 Apr 2016 09:36:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54728 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754480AbcDSNgv (ORCPT ); Tue, 19 Apr 2016 09:36:51 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 4904A7F342; Tue, 19 Apr 2016 13:36:50 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-112-40.ams2.redhat.com [10.36.112.40]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3JDalsS019313; Tue, 19 Apr 2016 09:36:48 -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] powerpc: don't fail if QEMU does not support alignment exception Date: Tue, 19 Apr 2016 15:36:34 +0200 Message-Id: <1461072994-13567-1-git-send-email-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 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 --- powerpc/emulator.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/powerpc/emulator.c b/powerpc/emulator.c index 4dc341f..9720723 100644 --- a/powerpc/emulator.c +++ b/powerpc/emulator.c @@ -245,8 +245,16 @@ static void test_lswx(void) "xer", "r11", "r12", "memory"); #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - report("alignment", alignment); - return; + /* + * 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; + } #else report("partial", regs[0] == 0x01020300 && regs[1] == (uint64_t)-1); #endif