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 1EFBB3858D28 for ; Mon, 28 Aug 2023 18:37:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1EFBB3858D28 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 [IPv6:2610:1c1:1:606c::19:1]) (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 4RZK781d2Wz4chw; Mon, 28 Aug 2023 18:37:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4RZK780lhqz3XVH; Mon, 28 Aug 2023 18:37:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693247876; 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=y6sfJHbnTw3eogEPQokqyj2dsEUUO9gKORvfJhyODA4=; b=f/RxhcpvF+DHEDnhRW7BYvOdfhpLXrCs1t19BsrJPvIC8KPACLbvlDkIRTtJ7/NH+3pXz7 dYM8g2jtpaf0klNu3KJMRTMSVleBoUzkEAEibsF9L5/h6AyU4qIbxI/4GpDnST6JmEs75i ZaKybOKplP5mcrt1JXCCt1ZZJlraZ3P7UTiLR832PFpboqvGkwrSDMITrUKj24aBfovunu VjbcmheOj3mLXw+rKR2btfl1oRICqZUwfI+ZnIRA0VMGC0M5oi3waTuLiJEFqx6JG2fNfN jg2/lh3/rp7vIz1yXkRi4HGGJgkNVe5lkitiGrzQ6Vvoa0te1N8E5FIlLN3izQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693247876; a=rsa-sha256; cv=none; b=OFwb1ZHZxBBr6qgktoHJ1HnlJGvhFMnSNQKqq+0Uq7wfu2ZUu7fkS71pIZrvcR7pBFrfV9 IE1J8C+kRyoeZPrV72oB+3Lj9eq2rZcSGqgp8SPXW6dP9eY/4da+K42jQXXRTx7SrcxlC2 Qjs1ik3nIb8qeTI55ZO0AUibQmdRBZT//SgtptlTfjsKtbfsT1Hh04HmAenoQtsPyCqpr3 Rb651hJmvBWqcQWMcu0oXadmprh5T8jYASurW3835J8WX/PLwF8MrWFGQWVTzxhMAwWptK NnlJdWNxp6pxZn6lG2TP27zQxYFuF69CjHK4HeyUNaX2FrNyAuUcq9CiC8Ng2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693247876; 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=y6sfJHbnTw3eogEPQokqyj2dsEUUO9gKORvfJhyODA4=; b=q+XfIKOVbrt+enHs9CocNqPkNJm0vVMwiXUCjLhkCNOtAoa/25pymkD2qYXE5sShJ66FHR 7UZVPklr9r5SEHP3jGExaOJXLH6oyyWJisyYnIFYQNq16lQ/nDu89h6T3AWDN5kCi2Z0Wf dVyr0jlm+vhwWiiiVT29FbuCjhjLSrNbM2VbduPmlcB5DASPZGe30r8ddFyIM4pfY8oIWV Gww5lcHcvjaLOAfUl7yBqPMTxyKI3Y71Mw7q0KFncruFnmvrelDszxo3nl+A7mX+NBzYhp 9Mx4TCZPVGSmTgm39KKtBoTKKgURqMlyNvm16/UPLCWR9OnpgUd9HhU0CcapoQ== Received: from [IPV6:2601:648:8683:a9e0:3858:44e8:8d12:eaf0] (unknown [IPv6:2601:648:8683:a9e0:3858:44e8:8d12:eaf0]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RZK774kskzBsb; Mon, 28 Aug 2023 18:37:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 28 Aug 2023 11:37:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v6 13/15] gdbserver: Use x86_xstate_layout to parse the XSAVE extended state area. Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org References: <20230714155151.21723-1-jhb@FreeBSD.org> <20230714155151.21723-14-jhb@FreeBSD.org> <8e44e9be-cc90-4b1e-ac01-79bd82f85416@polymtl.ca> From: John Baldwin In-Reply-To: <8e44e9be-cc90-4b1e-ac01-79bd82f85416@polymtl.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP 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 8/28/23 11:15 AM, Simon Marchi wrote: > On 7/14/23 11:51, John Baldwin wrote: >> From: Aleksandar Paunovic >> >> Replace the extended state area fields of i387_xsave with methods which >> return an offset into the XSAVE buffer. >> >> The two changed functions are called within all tests which runs >> gdbserver. >> >> Signed-off-by: Aleksandar Paunovic >> Co-authored-by: John Baldwin >> --- >> gdbserver/i387-fp.cc | 117 +++++++++++++++++++++++++------------------ >> 1 file changed, 69 insertions(+), 48 deletions(-) >> >> diff --git a/gdbserver/i387-fp.cc b/gdbserver/i387-fp.cc >> index a122e2d860b..f53a6cfc477 100644 >> --- a/gdbserver/i387-fp.cc >> +++ b/gdbserver/i387-fp.cc >> @@ -82,6 +82,8 @@ struct i387_fxsave { >> }; >> >> struct i387_xsave : public i387_fxsave { >> + /* Size of i387_fxsave is 416 bytes. */ > > Add a gdb_static_assert to make sure of that? Yes, I can add that. I thought of that when re-reading the patch today myself. >> + /* Memory address of 16 512-bit zmm16-31 values. */ >> + unsigned char *zmm_space () >> + { return xsave () + xsave_layout.zmm_offset; } > > Since this doesn't Would it be clearer to call this field (and method) zmm16_offset > (zmm16_space), to make it clear that it's the space for the zmm > registers starting at 16? Oh, yeah, that's a good suggestion. > In any case: > > Approved-By: Simon Marchi > > Simon -- John Baldwin