From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 4ACD5385840F for ; Tue, 25 Jul 2023 18:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4ACD5385840F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4R9QFM0d6Dz403g; Tue, 25 Jul 2023 18:15:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R9QFL6pv7z3Nx4; Tue, 25 Jul 2023 18:15:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690308951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0SZ4yD27GAHgE6/QvhK2/3FFPX+RF2BxRzyEPCPhJ6k=; b=u0aKiHsXau6pYLigMf7dTsOG0ANE3G8pNTmX0By+jT1qjDa8CWBCTxgaek/uEX7fu6YfDH iwfAASp4OrYvG7O/Chk0XxHbq2o1+BTc8ZStFxEHLpuaF70J4Exdto0CAg8gJ/Dr2AsVFr 1gPPR01HZLbjqXfUWx5fMzsadu+FKdwU6nBRaZ2Tahc0Smzm4d5LpH210IZUKvJ/u/J58g r53zHMbM8Ja8AUzm29G1xjfTJ0kZP65eVKkKLxqK4OdFhjwQNhlaHiElMBu1vEqXuHZVBn L7s0Miu4iV8sPLTPbyX0tAeAki2uwTy0byano5F/qCITInSV7yDqTkC8KItqmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690308951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0SZ4yD27GAHgE6/QvhK2/3FFPX+RF2BxRzyEPCPhJ6k=; b=EWd3FRFONLSjzsL/RWXHzdMdOv09X+nbZoMgK+2rqwtpfdxx1Z342xJhyXBIvFzodmPBKf 9wTBvIm5hWknsGeMSwz1rXUDs6CXwHI/EyhUV1FiDImbkpEYyvSVsOgGhKEgcKb06VhAtG 6tPQy0851WtNU3esI3ECLhcllWDNHV6Ki5jODF1hsmi8KGNytAWrdNWsTFPl1ZjFL8HqxD 8KAgbv6ddTBz7U+r7zb9l3b6/WTi9pYEz7KE2NoZYcj19S4+ROh2f/z7Or/D3Nc9FOOSuk C5tv8PMb9oxOE0ylygPhWqHrU6bB8Baf6+MxyKjSrZUL60W0NNrtwMUFwx/DRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690308951; a=rsa-sha256; cv=none; b=qSc5SyEcsqQYSucia/7lnSN2EZFt3uKXKZ8tQQELNt30+gNCQqn+z0p6oPoGZYlW+RQPOP pdnGQcfFw7JLEHXLFw5V8oAFronerOAKBhweGQfWRkoGpy+TzNSuTpfaiBKaR2eRLgETNb xi3GBxlRNUSX0sDiFA0u6kKtZX5m8Tw73tSHHaB59IqVfqid7FFfkd5uYFa5fe2dDy5bjV iqu/bWzNKF7cKPWNp1x4dqz6+pDy1efUEnCd4DW1RVD84g2rlQhf5BoyejpbTIuz3Kxam9 KCSt72pB33LsbzKcxdMvfGH8yPabiftXoRdVTvVUAkyH5jHs8Oz4kqbPN2ejjw== Received: from [IPV6:2601:648:8680:16b0:3097:7875:9e86:db21] (unknown [IPv6:2601:648:8680:16b0:3097:7875:9e86:db21]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R9QFL41GrzjHv; Tue, 25 Jul 2023 18:15:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 25 Jul 2023 11:15:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v6 00/15] Handle variable XSAVE layouts Content-Language: en-US To: Keith Seitz , gdb-patches@sourceware.org References: <20230714155151.21723-1-jhb@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 7/25/23 10:17 AM, Keith Seitz wrote: > Hi, > > On 7/14/23 08:51, John Baldwin wrote: >> Changes since V5: >> >> - A few fixes not tied to the new layout handling have been merged to >> master. >> >> - Reworded the comment describing i386_*_core_read_xsave_info in patches >> 6 and 8. >> > > I am sorry I am late to the review here, but I've been testing Sapphire > Rapids this past week (and its expanded register save area), and thought > I would dig into this a bit, testing it on random x86 systems in our (internal) > test farm. > > The (unsurprising) good news is that on RHEL9, this series does not adversely > affect regression testing results on ppc64le, aarch64, or s390x. It also > greatly improves results on Sapphire Rapids CPUs (at least on the native > unix target). > > However, I've run into some pretty consistent problems which I have not yet begun to > investigate (likely all the same bug). > > With either a Raptor Lake CPU ("13th Gen Intel(R) Core(TM) i7-13700") or Sapphire > Rapids ("Intel(R) Xeon(R) Gold 5418Y"), I can get gdb to consistently segfault in > memcpy in several tests using gdbserver w/-m32: > > $ make check RUNTESTFLAGS="--target_board native-gdbserver/-m32" TESTS=gdb.base/auxv.exp > [snip] > === gdb Summary === > > # of expected passes 6 > # of unexpected failures 1 > # of unresolved testcases 5 > # of unsupported tests 3 > > From gdb.log: > > (gdb) PASS: gdb.base/auxv.exp: info auxv on live process > gcore /root/test-fsf-master/gdb/build-x86_64-redhat-linux-gnu/gdb/testsuite/outputs/gdb.base/auxv/auxv.gcore > > > Fatal signal: Segmentation fault > ----- Backtrace ----- > 0x55ef54b9acda gdb_internal_backtrace_1 > ../../gdb/bt-utils.c:122 > 0x55ef54b9acda _Z22gdb_internal_backtracev > ../../gdb/bt-utils.c:168 > 0x55ef54b9acda _Z22gdb_internal_backtracev > ../../gdb/bt-utils.c:154 > 0x55ef54cc086e handle_fatal_signal > ../../gdb/event-top.c:889 > 0x55ef54cc0a78 handle_sigsegv > ../../gdb/event-top.c:962 > 0x7fd237654dcf ??? > 0x55ef54d4e9bf memcpy > /usr/include/bits/string_fortified.h:29 > 0x55ef54d4e9bf _Z18i387_collect_xsavePK8regcacheiPvi > ../../gdb/i387-tdep.c:1543 Can you confirm where this is in your patched copy? For me this line is here: if (gcore) { /* Clear XSAVE extended state. */ memset (regs, 0, tdep->xsave_layout.sizeof_xsave); /* Update XCR0 and `xstate_bv' with XCR0 for gcore. */ if (tdep->xsave_xcr0_offset != -1) >>> memcpy (regs + tdep->xsave_xcr0_offset, &tdep->xcr0, 8); memcpy (XSAVE_XSTATE_BV_ADDR (regs), &tdep->xcr0, 8); } If you have a core handy, could you provide the output of 'p tdep->xsave_layout' and 'p tdep->xsave_xcr0_offset'? -- John Baldwin