From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by sourceware.org (Postfix) with ESMTPS id 35A763858C52 for ; Tue, 13 Feb 2024 04:18:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 35A763858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 35A763858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707797925; cv=none; b=nSMFBAPbjBGODWp3rRP/CU5RToTEA10p4uNlhEBRcbCQXTATlme0BImcID9tHDaFyyG9bbDcGe5Q+vivx29/WqDYgnxKD43SErVLJJ8vwxUMjLqF5caWAU9bFpl2xsvvCbMNSDzOVlU5q0neU4TvgFtfwCheDJaiwygqlNpptvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707797925; c=relaxed/simple; bh=sB6GDV0dIt7DdCdfzawVF7C/Ocb+EpmgHTAGcL3ggQw=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=sW5S7iqDx2i9IBVbZsfxiUJXzSGYifkMYpk36i3QvCR/hGrnoIKYeB5msJfeckaobNspBMLqyk+OmQcqXbhi16kfLAmq75IjoI0ooMVo78QPSIBM0KxIvAHEz3RtR+I5+bUvKlgu9rj/J8VFVWyrqjjMIJSYW2GT0abXwH3PH1w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-6077a1d441eso7761657b3.1 for ; Mon, 12 Feb 2024 20:18:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707797922; x=1708402722; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=y5kracmflPdLR6DrRaOp5XEZexfNFANMlmIG/I0MwAI=; b=MUVCzGxstabgrESxXzQ350Je5OVuSBALCPi+RjDLv2EmD4LOwkgzldu2cypOGvqyuo 0VPzAC4GxWeAsz3IVgAVTOsP8h4/fNdRpYE3Riw6NDEDiwM5EEBNkzH33DHHrPf69aXy bwKmKUu4ezoe0CYKaDr1RoA+liHdqYxUxOLY2obNAudeM9WkJ0IhX560xtYlh6TCnuZ7 NY2MO0bTq7ryVduGH6scdVCyBAbKoV0siK7gBds4g+9iCNK7u1lBNMnBh3lxsRe18R8G Qok8bHZ6GgcH9FbemIs5kjOYmnudmpF2fwS1+/nENY3uxNeUBmZU5ovq8/gUBPowqPdg AOKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707797922; x=1708402722; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y5kracmflPdLR6DrRaOp5XEZexfNFANMlmIG/I0MwAI=; b=NXeGsOaxC5Xa0TAwwU4cVQWHMLlOKr6uGbBFF5fkPunkYmInlFAjuNe7M0S+LFF4cc M+qi6VX3OWuulPxVS/1MyKfhCu/hUZKiKxL9isW1Q6YXjf7lA0qb7CSExIoBjpQfUIeq UwxHv8SL/l152LHj0hLqdgp62vtusW4Cb+DY9czfQP41Jy4VZQ0hsEIiEm66h+hc3wJI OSTpeWxnxWztjuHKDg4pfB5tdvVl/dvKcA6OosJ3tES1cfPL2emYKb4e66nE/Bv0cSM6 Y/5g7281j93QkAnlPCwwafa1gOWEy5YJQaKbSft7c8jwSOutZxO9MmjFxeO9VwTKVchb Nrvw== X-Gm-Message-State: AOJu0Yw4Rlq2jcS4ScK6Ct9kowKEohhALF+yxAetMgQrNkCXYnCQInJN EqGiaZoXvH+PnUb86xcPN8qWWfQUKI9m1CsK/m4VWkVPuZXaop8Uqp9Q+Lk+KhCQkbbNtFvqiP0 HpF7HlD9RtAEYrl8y/QiEE6o9/OU= X-Google-Smtp-Source: AGHT+IGNbfFCmkbennnn8VzZhWIDEtqvhOqKb7B/FLTfx7Yh/RcZ5r4uRnEu/wAGYuU4Sz2P+zFYIpCiaZgrzfFzobQ= X-Received: by 2002:a0d:dd12:0:b0:5ff:5867:e675 with SMTP id g18-20020a0ddd12000000b005ff5867e675mr5636091ywe.28.1707797922520; Mon, 12 Feb 2024 20:18:42 -0800 (PST) MIME-Version: 1.0 References: <20240212004606.969653-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Mon, 12 Feb 2024 20:18:06 -0800 Message-ID: Subject: Re: [PATCH] x86-64: Save APX registers in ld.so trampoline To: Noah Goldstein Cc: libc-alpha@sourceware.org, fweimer@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3021.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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 Mon, Feb 12, 2024 at 10:16=E2=80=AFAM Noah Goldstein wrote: > > On Mon, Feb 12, 2024 at 12:46=E2=80=AFAM H.J. Lu wr= ote: > > > > Remove bound registers from STATE_SAVE_MASK and add APX registers to > > STATE_SAVE_MASK so that APX registers are saved in ld.so trampoline. > > This fixes BZ #31371. > > --- > > sysdeps/x86/sysdep.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/sysdeps/x86/sysdep.h b/sysdeps/x86/sysdep.h > > index 85d0a8c943..9877a3a46f 100644 > > --- a/sysdeps/x86/sysdep.h > > +++ b/sysdeps/x86/sysdep.h > > @@ -26,9 +26,9 @@ > > aligned to 16 bytes for fxsave and 64 bytes for xsave. */ > > #define STATE_SAVE_OFFSET (8 * 7 + 8) > > > > -/* Save SSE, AVX, AVX512, mask and bound registers. */ > > +/* Save SSE, AVX, AVX512, mask and APX registers. */ > > #define STATE_SAVE_MASK \ > > - ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7)) > > + ((1 << 1) | (1 << 2) | (1 << 5) | (1 << 6) | (1 << 7) | (1 << 19)) > > Not 100% necessary for this patch, but defines for which bit > is associated with which state would probably make this easier > to maintain. > > I.e > #define STATE_BIT_FP (1 << 0) > #define STATE_BIT_SSE (1 << 1) > #define STATE_BIT_YMM (1 << 2) > #define STATE_BIT_BNDREGS (1 << 3) > #define STATE_BIT_BNDCSR (1 << 4) > #define STATE_BIT_OPMASK (1 << 5) > #define STATE_BIT_ZMM_Hi256 (1 << 6) > #define STATE_BIT_Hi16_ZMM (1 << 7) > #define STATE_BIT_APX (1 << 19) I copied the same macros from GDB: https://sourceware.org/git?p=3Dbinutils-gdb.git;a=3Dblob;f=3Dgdbsupport/x86= -xstate.h The v2 patch is the part of this patch set: https://patchwork.sourceware.org/project/glibc/list/?series=3D30854 > #define STATE_SAVE_MASK (STATE_BIT_FP | STATE_BIT_SSE | ...) > > > > /* Constants for bits in __x86_string_control: */ > > > > -- > > 2.43.0 > > --=20 H.J.