From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id 4620B3858C2D for ; Mon, 27 Nov 2023 17:59:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4620B3858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4620B3858C2D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=96.47.72.81 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701107953; cv=pass; b=v7xvPw7Fk13YRlRzPrsZv0hA3ZTkP0GTXfTYMaKn3siVLLI891m5Nku07RcY2irkMUaPqw4ZVtA20j5rPFf+FDLy1toR1LnQODllfSBzjvbeibGUOaQsuIahA33tfDSiym4m7vjSnUs3AOJ8zUjYGOqmtLyDrPjRQ/jNwdrOM/o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701107953; c=relaxed/simple; bh=ia8Uf5rgqEbQqrHiWKF6bzQhbwS7DO2JUJ0cwrI69BQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=O6+TwdqNv5N2NGq9xU8+IcNLIilxkXjYej5fYqpg/1W/n5rFlDHk9kdNz3j8zf2rPV5MYYyN+ozy+CNV5JXOzMIg4q01gvZsbnPWEc8i3p4FAFlhdcEHMKlUuNg1U8jmPv6Bd+WcLyMVfQsVISNNI4fi14Q781To4RQyjLzsl/4= ARC-Authentication-Results: i=2; server2.sourceware.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 4SfCyQ5g8mz3W8F; Mon, 27 Nov 2023 17:59:10 +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 4SfCyQ4xnZz4KBL; Mon, 27 Nov 2023 17:59:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701107950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5u7gx/joeFBW/M4IcdqqzgpIK1k81S7VfyevjzsUW/k=; b=KXoWyhIH/UugwtroXeQqs8yfGGE+OSDJrx6te8tCOXiry1SZ9443c3i4EHKt4SP3sCqe/p hOGuIgXWpkxw5qtGj9iGQVJjw8YPdgX2CRzgx8cwX+n9V6v4Ldri6hrOXKI4mD0p3VpZaG fJ9yFgpur3esFBUuU06yFqgIcSBqg7k9J69Hyxmxg5QvZ0dQ9plg3FcCdnVN64jTN1aWRy VRBOfMXqJKSNUJeTJc630WoXW73jixU4GC7VaofaePBpxNIFzrFIy5wjMLUrP2698BTXcX t3WYIkC/FQ8f8FTxgW3DJ6c8UQan4NIv4zLxWwvsibufcAr611E1+Cx7xPjA6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701107950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5u7gx/joeFBW/M4IcdqqzgpIK1k81S7VfyevjzsUW/k=; b=E32SZkI6sVLD/joBxVRz1SoObfbdzPrBPKx24lI+HvTLsMciHxbFkMGLtwe/hcFairXs57 JjvU48T3zPFYgMEAvYXOql+jUMh2xJfUjylJXSMTbwOcBXzRrXRALJsqP73rPUskQT2hE3 z1naYPSr5LuUIT7JCEVaOyUUERwkchYNeOrM8owOxMunF3abRqMbphW5NQ9n/4pOxdoe87 3Qi4BTh8sH3FmRKxTeJjObz3ISCWYEd7uoNcnSDL+zZY7mNaQA0EHJfN1R3m2ulsJ6M8kV S3tyCfjjyGKvy8jaElj/Na1mWPqoWq8EVmeHBL2h8FGN3Ia+IUZAjEgVsS4wKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701107950; a=rsa-sha256; cv=none; b=OrqYTKeCGAskZW4ZNCf6B3gBvhDR11v0tl8iUsEjcTX3mNZRtOVx17FG8oFaCRZQzImYBL dDQBMhw1D989qpndhtB79nOT7pRzUMGv0Ps8k5IpJoNeZWMY+KQUbFrP2yZ19z6sjs9xQk TGeEUSECiwZWlh3Tak63e0LVaZguyVhSUeezoaheCazb9PnzEd8mozIfYhMFTruiWHvRwH TrJKflmkSEt1r2AZb8NSK3tzPrJkdrRzyHLrRea7ssbkzfA7FYsqQnBsvJk7suoxQbHwUx 37Vz3gsUFTwwFJMYAkx2EXWsQ04+9SlZo2UmVmzIF357ksoLsFHv5Pbnw0vISQ== Received: from [IPV6:2601:648:8384:fd00:bc78:e4e1:3e17:3e10] (unknown [IPv6:2601:648:8384:fd00:bc78:e4e1:3e17:3e10]) (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 4SfCyQ0NGSzxcG; Mon, 27 Nov 2023 17:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <62bbffe2-95c2-4852-960b-0b950bb3a73c@FreeBSD.org> Date: Mon, 27 Nov 2023 09:59:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] i386: Use a fallback XSAVE layout for remote targets Content-Language: en-US To: Joel Brobecker Cc: gdb-patches@sourceware.org References: <20231121220931.48497-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=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 11/26/23 8:36 PM, Joel Brobecker wrote: > Hi everyone, > > Just a quick note that the 14.1 release is currently being put on hold > pending this initial resolution (thanks John for the patch!). > > On Tue, Nov 21, 2023 at 02:09:29PM -0800, John Baldwin wrote: >> If a target provides a target description including registers from the >> XSAVE extended region, but does not provide an XSAVE layout, use a >> fallback XSAVE layout based on the included registers. This fallback >> layout matches GDB's behavior in earlier releases which assumes the >> layout from Intel CPUs. >> >> This fallback layout is currently only used for remote targets since >> native targets which support XSAVE provide an explicit layout derived >> from CPUID. >> >> PR gdb/30912 >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30912 > > I don't know about the XSAVE area, but still still skimmed the patch, > and it looked reasonable to me - in particular, I don't think it can > make things worse, since all of it is conditioned on cases where > the target does not provide the XSAVE layout. One minor formatting > nit I found... > >> --- >> gdb/i386-tdep.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ >> gdb/i387-tdep.c | 48 +++++++++++++++++++++++++++++++ >> gdb/i387-tdep.h | 5 ++++ >> 3 files changed, 128 insertions(+) >> >> diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c >> index f5ff55de47a..8efd8584fcd 100644 >> --- a/gdb/i386-tdep.c >> +++ b/gdb/i386-tdep.c >> @@ -8297,6 +8297,72 @@ i386_floatformat_for_type (struct gdbarch *gdbarch, >> return default_floatformat_for_type (gdbarch, name, len); >> } >> >> +/* Compute an XCR0 mask based on a target description. */ >> + >> +static uint64_t >> +i386_xcr0_from_tdesc (const struct target_desc *tdesc) >> +{ >> + if (! tdesc_has_registers (tdesc)) >> + return 0; >> + >> + const struct tdesc_feature *feature_core; >> + >> + const struct tdesc_feature *feature_sse, *feature_avx, *feature_mpx, >> + *feature_avx512, *feature_pkeys; > > ... there. Should the second line be indented 2 spaces relative to the > start of the first line? > > Nothing else past this. Oh, humm, I just copied that from another function below that validates the tdesc and adds register numbers. The GNU style in emacs agrees with your suggestion. -- John Baldwin