From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 81EAA3858415 for ; Mon, 12 Feb 2024 18:16:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81EAA3858415 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 81EAA3858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707761784; cv=none; b=PGnAnvmfjfkQ3X+0FqiNaxanMulg9U1pLO3HQDnMO83V91/Ga+9z1D24kQzsf2yUqAgcly8hfCe63vOrv9N42k+wYjl+sMGvvg9CLU4pnmsE9MFaFyyWjGl7faLyGW2grjBfHaK4/8+ppOWWTgjT0c6IEwJ7g6w1/6zpI0DiNlc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707761784; c=relaxed/simple; bh=1jZlJMpkCekAcY/UaDkMC6DmCQLUynXyeuTBXWC+T6Y=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=IbIoc03heTQendaQSa4+JX+OatpssAU4K0KGnTlXm8Bl/RF/T/vClZnnqIn2Acwal0Ekq1aL/h1QDeWucvasfs2CNbRfsjgSQf/NZ8ih4WhXZuCRRD2tntcFyvBszyFt5JZsmIlv9wIlWCW+1P6s/Mqa2W3EtwZQU0KyXivOcb4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-20536d5c5c7so2704544fac.2 for ; Mon, 12 Feb 2024 10:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707761780; x=1708366580; 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=7czIn3q6sEcjTQx3ntlscXpZ3LrLGs7NEzyKKqjar8k=; b=l+bmo+hLOcZmA7O8hYETeVozKpatN+0TBBqplC/iUTV+vFy3+U2zT7Id8FsF54Ia23 uENLXJzKqeDqjzqgWWzCCl1xItOd1L+x85CqrxrkN34UIfUeJMTL+9gXZdWX+Nywbz4D hRSARHeVXaVOiJCJDfjST4gnAT88DD4PU5qU3CeSxayKZrCICY1JiNsnG0hQHbw3mysA H3Tib4dDOcKjfC0xWWiCcU/9Gq1mEaFPPmbe5OOLBvwyfDaIftLWAYsWES+AuP25FHc0 ZAqxSJ1JOYq8rY6YH5GtihU328Au3JirCeBMnS6SqX23cLNDNZ48jqifgP8WV5QQ5HQI JMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707761780; x=1708366580; 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=7czIn3q6sEcjTQx3ntlscXpZ3LrLGs7NEzyKKqjar8k=; b=al/SD726fq7zzT5bU0qdZnpbOQmIrOIne9Kpgbwu/WzcyUhw2THk9chzUBKp/FFE5r bgfTRYvV3jgdQirjNcvS3b8er0qN+fYbrwZ+0JqqhviOEsJflv0pckczPqQy01ZRa7Yn RyVOXnxMvZ6hd6+3ApmY2PmONbNM2s1K835EarYnBHRUFkSJp+5oVj8dW0tFIShvm3bx cCpwnJt38WMYq56cKkwNmuLqHAopDoOl63Zmk4CyZZBaZxNg9ZGlfdtZ48sV/CD056tW Yly3pX1bA9fJWxvCqDKPALrheK9M7G37GJU501eLUrIbPq1Y7spb3IuRNrMN2yZGYCzP 8Tog== X-Gm-Message-State: AOJu0YyISzMj1o2ipb8YnPHUKekoph4bMFII5geGn44W70+A8Nr5twcX cj402DAOwNEYCM/EtotTCHo1Roz0Sm5hghSrrgCmnUiO/BaByXnt9CIhhv6bSK/C+V82XS66gNc /01BBwCkTfxQOadDRJuohqFfGzZohKM8oG1M= X-Google-Smtp-Source: AGHT+IEdFjBy0CNXkCZmeHf/DEndt8CXYTaWyKCJKR2a72JTIsKaRoh8x16ycpQ+Yk7f/DCL8KfesrRaqVgB0SlRlB0= X-Received: by 2002:a05:6871:72c:b0:218:61af:1c75 with SMTP id f44-20020a056871072c00b0021861af1c75mr6836049oap.37.1707761780623; Mon, 12 Feb 2024 10:16:20 -0800 (PST) MIME-Version: 1.0 References: <20240212004606.969653-1-hjl.tools@gmail.com> In-Reply-To: <20240212004606.969653-1-hjl.tools@gmail.com> From: Noah Goldstein Date: Mon, 12 Feb 2024 18:16:09 +0000 Message-ID: Subject: Re: [PATCH] x86-64: Save APX registers in ld.so trampoline To: "H.J. Lu" 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=-9.1 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 12:46=E2=80=AFAM H.J. Lu wrot= e: > > 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) #define STATE_SAVE_MASK (STATE_BIT_FP | STATE_BIT_SSE | ...) > > /* Constants for bits in __x86_string_control: */ > > -- > 2.43.0 >