From patchwork Tue Sep 25 03:28:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 29531 Received: (qmail 82041 invoked by alias); 25 Sep 2018 03:29:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 82024 invoked by uid 89); 25 Sep 2018 03:29:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy=U*simon.marchi, simonmarchiericssoncom, sk:simon.m, sk:simonm X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Sep 2018 03:29:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1537846145; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kYh0khiD2iiPNtkRr6TP9CQD/5EDr6DBx6lovR0iefU=; b=gpSQtQt4V357niU34oeLfuh7m7w/kKzp5tb2xKus7IdTy5WcuH+YST4ypzrUZheH 2dx5dITrv+k0zLXHldLrudE6rj155tP+KvVmS5RxdJETuLapkzoS7fUKOdKaWvgT jPEZNfqKdDWF7EQgmUj9I8TlMp0LRCbDXubfFygs7FA=; Received: from ESESSMB501.ericsson.se (Unknown_Domain [153.88.183.119]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id B0.4E.05037.18BA9AB5; Tue, 25 Sep 2018 05:29:05 +0200 (CEST) Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 25 Sep 2018 05:28:53 +0200 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Tue, 25 Sep 2018 05:28:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bi1w63SZODj/OM9li9mKertlM/bLa9BcXrkEURL8dBI=; b=jJotWNKV88RYuDKsgnniitZ13VGwVxY2CwGjmdilCwLuqRUrAvELJxyB7FYonCzSSptSshPr3q0TrZnQVmT4cteANK0bYd2oJu4BXIWq0FYQaWYY6h2Wtdykvg1TUDzsna82/a9Zp17/e0M3XvbLn3tNkjTMSlKPok7eo9e6/Mg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [100.94.56.191] (192.176.1.95) by BYAPR15MB2391.namprd15.prod.outlook.com (2603:10b6:a02:8c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Tue, 25 Sep 2018 03:28:44 +0000 Subject: Re: [PATCH] x86-64: fix ZMM register state tracking To: Jan Beulich , Simon Marchi CC: , GDB References: <5B8FD8B302000078001E5940@prv1-mh.provo.novell.com> <369f9b84-77e3-3fa4-f363-a89ee503cff4@ericsson.com> <5B960E3D020000780013C85E@prv1-mh.provo.novell.com> <5BA0FFB102000078001E97B0@prv1-mh.provo.novell.com> From: Simon Marchi Message-ID: <0e0d9f23-2cbf-eb5a-64fa-6cda3392053a@ericsson.com> Date: Mon, 24 Sep 2018 23:28:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5BA0FFB102000078001E97B0@prv1-mh.provo.novell.com> Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes On 2018-09-18 09:37 AM, Jan Beulich wrote: >>>> On 10.09.18 at 15:01, wrote: >> On 2018-09-10 07:25, Jan Beulich wrote: >>>>>> Simon Marchi 09/08/18 1:13 AM >>> >>>> Would it be possible to update or create a test to exercise that? >>>> arch-specific tests are in testsuite/gdb.arch. >>> >>> I'm sure it would be possible, but while I was happy to invest the time >>> to >>> fix the actual bug (because it affects work I'm doing), I'm afraid I >>> don't have >>> the time to learn how gdb test cases are to be constructed (I'm >>> familiar >>> only with the binutils / gas side of things). >> >> I understand. If you can provide: >> >> - a minimal source file (C + assembly in this case, I suppose) >> - GDB commands to reproduce the bug >> - actual and expected output > > Attached. vzero.s is the source file used (no C file needed). gdb.log > is a transcript of a session with a broken gdb (the one installed on > the system), while gdb.txt is a transcript for the fixed one that I've > built myself. > >> I can take care of turning it in a GDB test case. > > Thanks. > > Jan > > Hi Jan, Thanks for the instructions. There is already a test covering AVX512 instructions, so I figured I would add it there. However, I don't have a processor that supports AVX512, so I'm unable to run the test. Here's a patch, can you try to confirm that the test fails without the fix and passes with the fix? I probably screwed up somewhere, but it should be pretty close. You can run the test with $ make check TESTS="gdb.arch/i386-avx512.exp" in the gdb/ build directory. The gdb/testsuite/gdb.log file is useful to look at in case something fails. Feel free to integrate this in your eventual v2 if there is one, and feel free to add a comment in the test to say what we are testing here, as I am not too sure how to describe it. Thanks! Simon From a167d21f452f6f3f19eac6623fa872fde1162128 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 24 Sep 2018 23:21:19 -0400 Subject: [PATCH] AVX512 test --- gdb/testsuite/gdb.arch/i386-avx512.c | 5 +++++ gdb/testsuite/gdb.arch/i386-avx512.exp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gdb/testsuite/gdb.arch/i386-avx512.c b/gdb/testsuite/gdb.arch/i386-avx512.c index 9349f09d62e..537adb3ab86 100644 --- a/gdb/testsuite/gdb.arch/i386-avx512.c +++ b/gdb/testsuite/gdb.arch/i386-avx512.c @@ -249,6 +249,11 @@ main (int argc, char **argv) move back to array and check values. */ move_zmm_data_to_memory (); asm ("nop"); /* sixth breakpoint here */ + + asm ("vpternlogd $0xff, %zmm0, %zmm0, %zmm0\n" + "vpternlogd $0xff, %zmm0, %zmm0, %zmm16\n" + "vzeroupper\n"); + asm ("nop"); /* seventh breakpoint here */ } return 0; diff --git a/gdb/testsuite/gdb.arch/i386-avx512.exp b/gdb/testsuite/gdb.arch/i386-avx512.exp index d806d5f9a94..de2f62c3e1f 100644 --- a/gdb/testsuite/gdb.arch/i386-avx512.exp +++ b/gdb/testsuite/gdb.arch/i386-avx512.exp @@ -174,3 +174,11 @@ for { set r 0 } { $r < $nr_regs } { incr r } { ".. = \\{f = \\{[expr $r + 30], [expr $r.125 + 30], [expr $r.25 + 20], [expr $r.375 + 20], [expr $r.5 + 10], [expr $r.625 + 10], [expr $r.75 + 10], [expr $r.875 + 10]\\}\\}.*" \ "check contents of zmm_data\[$r\] after writing XMM regs" } + +gdb_test "break [gdb_get_line_number "seventh breakpoint here"]" \ + "Breakpoint .* at .*i386-avx512.c.*" \ + "set seventh breakpoint in main" +gdb_continue_to_breakpoint "continue to seventh breakpoint in main" +for { set r 16 } { $r < $nr_regs } { incr r } { + gdb_test "print \$zmm${r}.v16_int32" "{-1 }" +}