From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [66.216.25.90]) by sourceware.org (Postfix) with ESMTPS id 937823858CDB for ; Fri, 14 Jul 2023 15:55:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 937823858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.com (c-98-35-126-114.hsd1.ca.comcast.net [98.35.126.114]) by mail.baldwin.cx (Postfix) with ESMTPSA id F03141A84B9B for ; Fri, 14 Jul 2023 11:55:48 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v6 00/15] Handle variable XSAVE layouts Date: Fri, 14 Jul 2023 08:51:36 -0700 Message-Id: <20230714155151.21723-1-jhb@FreeBSD.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Fri, 14 Jul 2023 11:55:49 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,FORGED_SPF_HELO,KAM_DMARC_STATUS,KHOP_HELO_FCRDNS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. Aleksandar Paunovic (2): gdbserver: Refactor the legacy region within the xsave struct gdbserver: Use x86_xstate_layout to parse the XSAVE extended state area. John Baldwin (13): x86: Add an x86_xsave_layout structure to handle variable XSAVE layouts. gdb: Store an x86_xsave_layout in i386_gdbarch_tdep. core: Support fetching x86 XSAVE layout from architectures. nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count. x86 nat: Add helper functions to save the XSAVE layout for the host. gdb: Update x86 FreeBSD architectures to support XSAVE layouts. gdb: Support XSAVE layouts for the current host in the FreeBSD x86 targets. gdb: Update x86 Linux architectures to support XSAVE layouts. gdb: Support XSAVE layouts for the current host in the Linux x86 targets. gdb: Use x86_xstate_layout to parse the XSAVE extended state area. gdbserver: Add a function to set the XSAVE mask and size. x86: Remove X86_XSTATE_SIZE and related constants. gdbserver: Simplify handling of ZMM registers. gdb/amd64-fbsd-nat.c | 40 +-- gdb/amd64-fbsd-tdep.c | 12 +- gdb/amd64-linux-nat.c | 6 +- gdb/amd64-linux-tdep.c | 11 +- gdb/configure.nat | 8 +- gdb/corelow.c | 21 ++ gdb/gdbarch-gen.h | 9 + gdb/gdbarch.c | 32 +++ gdb/gdbarch.h | 1 + gdb/gdbarch_components.py | 11 + gdb/i386-fbsd-nat.c | 39 +-- gdb/i386-fbsd-tdep.c | 72 ++--- gdb/i386-fbsd-tdep.h | 14 +- gdb/i386-linux-nat.c | 8 +- gdb/i386-linux-tdep.c | 67 ++--- gdb/i386-linux-tdep.h | 25 +- gdb/i386-tdep.c | 18 +- gdb/i386-tdep.h | 4 + gdb/i387-tdep.c | 522 +++++++++++++++++++++++-------------- gdb/i387-tdep.h | 9 + gdb/nat/x86-cpuid.h | 32 +++ gdb/nat/x86-xstate.c | 67 +++++ gdb/nat/x86-xstate.h | 35 +++ gdb/target-debug.h | 20 ++ gdb/target-delegates.c | 27 ++ gdb/target.c | 6 + gdb/target.h | 7 + gdb/x86-fbsd-nat.c | 21 ++ gdb/x86-fbsd-nat.h | 19 ++ gdb/x86-linux-nat.c | 3 + gdb/x86-linux-nat.h | 7 + gdbserver/configure.srv | 12 +- gdbserver/i387-fp.cc | 268 +++++++++---------- gdbserver/i387-fp.h | 4 +- gdbserver/linux-x86-low.cc | 10 +- gdbsupport/x86-xstate.h | 77 ++++-- 36 files changed, 1027 insertions(+), 517 deletions(-) create mode 100644 gdb/nat/x86-xstate.c create mode 100644 gdb/nat/x86-xstate.h -- 2.40.0