From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 54A933858C3A for ; Wed, 20 Mar 2024 14:13:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54A933858C3A 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 54A933858C3A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710944035; cv=none; b=bZWtJc/XjNPMfKugORbuc8eZwA8zc/nDtKrc/QVoRRid9uhJpto4yeY8cvIDu9FnkTeE+dMlMTH5/PGbLU83zPt3J3ScA59Fh1h8gjp1oe73rmI3tEUzVX8HG9wVGTEYCxc/qx+q6CwBdWwF0XMf6hSf+9ojiZdTxeiRPa1O0s8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710944035; c=relaxed/simple; bh=hL3IIlsZoHgI2i8qdvTIeuFhB8vfdRynE7d9k8lZkgU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=nN2TjbiA86fOkjn2WboDxi8IbaX88A0HAaehryfEOPUDa2h2IbShhKkF6rwGF4cIC6S5Lt3nztvIjJqv0RoktYQ196hV7hZJNJGCgnBQNfxC+ko6XY3NFz0zcu07R7tQJBe0Q2t9eDKkihv86ppn2ZGA7lCAvG8aX9c4Vv58RI8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33ff53528ceso2679435f8f.0 for ; Wed, 20 Mar 2024 07:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710944031; x=1711548831; darn=sourceware.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YhYwsG2mOYwzEym2DhIU02QGvWkIFZG1dzTkOTEZIbI=; b=Qp15gU9Cho9FzspSaJqSio4oAmHHcZwa+3cvo2H5IXEffMmymb5MZzAtBU7eb81Ef5 zfqqNn1EB6p8dlW0JLJ27XiqrDDNOvaa+J+7d/nUo5dzyCdj3/hTqTfqPtc/COzKCU4T EobvnSD9rXtGOd0gQg/194VRipaUbxURQtloffewp+OSfG3X2/g2llJOBW02pbHQsokj jt6pJ8V2u680X88fffiQFOADZ9QGASydcPDCYqjwLy0LjYu+5T0icfGrqYKPXrIakZMi Qr2T0wmusOhb2Uh0qtoCRw30dBy2+anZw3ScT6F+OthuTa3xFU/v/PeTR6rPXPzObRXQ f9WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710944031; x=1711548831; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YhYwsG2mOYwzEym2DhIU02QGvWkIFZG1dzTkOTEZIbI=; b=tbRbUZOIzAq4FxWs5pZ2w1xXBJbIU3LxUcRVvYE0MszBFa9nBVRvsExJ7iJ+vyUf2k x0opBCCGDEXYlhQjdQrmAcuYgn1blhyuPrSOFHmxVHy/53tQDJsReJOvdQH6rhyrdEwY EzEu44z1JzPlvcmqnYIyAqAZjjfM8vqY0JiUY3N0WV1QbHDCqnIXOYzv/EyqH4HEcvis 1zqQiOD5e9JBdJLYUAuvfE37X9r8zlo9HnY1uvys6IWvbdRtCjD9yHK7EyiqRMEhwCQS w3dNT1uxX3iZxay9yMrXezEEf/jdPXI/L9vzzEK0KqHyrP52GpAJqr+891Uz6YTU3/e7 FFOg== X-Gm-Message-State: AOJu0YwZh6Sq+7Y3iHdwlNN1re5i2bYNrARG8P3y7Z6sqUs7LQj6lSuT WCub0YMZToSRQnppHAQTTbQPwqlq8rBTSBSBf9HYBv7UheOZpzsZ X-Google-Smtp-Source: AGHT+IGSdjzYsQ5Zx1IU9/UX+FxI9xK0cNN7VsbWxygqSdFflhB8sY0SlhbNum5snq0laQYgEt/IDA== X-Received: by 2002:adf:f6c1:0:b0:33d:5f98:82e3 with SMTP id y1-20020adff6c1000000b0033d5f9882e3mr12789705wrp.13.1710944030406; Wed, 20 Mar 2024 07:13:50 -0700 (PDT) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id p6-20020adff206000000b0033cf5094fcesm14786010wro.36.2024.03.20.07.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 07:13:49 -0700 (PDT) Date: Wed, 20 Mar 2024 14:13:48 +0000 From: Stafford Horne To: Adhemerval Zanella Netto Cc: GLIBC patches , Linux OpenRISC Subject: Re: [PATCH 1/4] or1k: Fix Linux user space signal ABI Message-ID: References: <20240319214244.736981-1-shorne@gmail.com> <20240319214244.736981-2-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Wed, Mar 20, 2024 at 10:24:15AM -0300, Adhemerval Zanella Netto wrote: > > > On 19/03/24 18:42, Stafford Horne wrote: > > The OpenRISC sigcontext structure has always been defined as: > > > > struct user_regs_struct { > > /* GPR R0-R31... */ > > unsigned long gpr[32]; > > unsigned long pc; > > unsigned long sr; > > }; > > > > struct sigcontext { > > struct user_regs_struct regs; /* needs to be first */ > > unsigned long oldmask; /* unused */ > > }; > > > > With Linux v6.8 we added FPU support and repurposed the oldmask > > to use for the FPCSR (floating point control status register). > > > > struct sigcontext { > > struct user_regs_struct regs; /* needs to be first */ > > union { > > unsigned long fpcsr; > > unsigned long oldmask; /* unused */ > > }; > > }; > > > > The definition of mcontext_t was always missing the extra space for > > oldmask. This patch adds the field __fpcsr to mcontext_t to fix the ABI > > mismatch between glibc and Linux. > > This is strictly an ABI break, this won't make the swapcontext functions > to fail (since they are not update to take in consideration the new field), > but it also means that the fpcsr won't be save/restore and the application > can potentially read uninitialized values. > > But I take that the fpu support will be a new ABI, so I suggest to fix > when you add it (along with proper support to context functions). OK, I got it. I will post this when the hard float code is added and also fixup swapcontext etc to populated it correctly with or without hard float. Note there is broken ABI already, as programs will not be able to access sigmask if needed due to: Linux definition: struct ucontext { unsigned long uc_flags; struct ucontext *uc_link; stack_t uc_stack; struct sigcontext uc_mcontext; <-- size differs between glibc and linux sigset_t uc_sigmask; <-- won't be able to access if needed }; But still I will leave as is for now. This hasn't cause any issues as far as I have seen so far. -Stafford