From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 319763858D1E for ; Wed, 20 Mar 2024 13:24:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 319763858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 319763858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710941062; cv=none; b=S3TVVYaCvpuf3zTb5sdirTN5UNwHxTOtpwpKDvpPtgPLNnlgosXV2qzzlUDO4MNy1wIw5bglyHaqWZLy+aT4PhiX1TOd3GeLVacztWjhWaCo2JaFbU1ewYqaTIuJAikOGHx33w/CGrkJ+uKfVaft+m6z9BEpE0Ouz2WZKQWDjGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710941062; c=relaxed/simple; bh=tIGuFlzuH+I6zKulWem9xZoTSXub8cwCWsrCiqC7gBg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=xfXOGe/majsywqTjAuzajO3POUXETNLYHoFxjPLqXAUL6qwOyzL7y04U/effTejc98seLOwkMo2njrmH86+OWvGR4DZzVS0+COyLudzVmFxzIdcf2QbxuaXb6WQ7fdYD8jmuIbu6Bz+c5Qqsx89NMuQmU0qB9vHB4hZeIE5P2rs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1e036b76725so23961285ad.1 for ; Wed, 20 Mar 2024 06:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710941059; x=1711545859; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=sWf8n8MBg1LCUfGd9j671/BK6632DY85mQ+shl2OokY=; b=KFe72ElRhAHA+FZKNdIOCOtjAc6BV+OXUimA4uGzFRYKD5QICBlqZMZcc53mGpdxd4 occLF+4d1CSUNgFZs7lWAiKUshvp6KYFrWFv65uI3d4huMZE6fvjh33ZhFirbHzSz6Ar 7WES0TrIHvWo3pQod+R4OAOsd0Xf3F+CPfjidrxLnbGRxhJ0bmDpXPXDTy95DxSElXSv MVbJk43ZSNjh4/gsapCFwXXIE4FWZnJPTYUeAY0fNzvKo1Us7FuOBV5YwoTPxOJiUxBV CvXqxyEyCaeQ9ifPOuMp+0hbN0aVtTglZoERioGb2wtpwmqinuAmNleH8NFp8sp3PAwQ C9Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710941059; x=1711545859; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sWf8n8MBg1LCUfGd9j671/BK6632DY85mQ+shl2OokY=; b=rrB8tkeijaYI3GWEJZg0qGLTIkcgOuIlkOFp3tV+/LT6IAWH4B5+r5pmCPhTe2VHd6 P9bt2pVqHtVZncLM3uaoC/SPrMGOePYYnkqQYA4kP8yH+0LGxd6CYCpahuteEwIFAKwM ZvSYla+q5QgJkB8gGrHF/tFFdOmQTPBrkhCiTM2YvgpgA+HRLQE3sxKGhmtmhA1Njd5n pXz1qVv+jnlnhECVbCGsnysTVTQWL1JO0tdQhXwINzE+USCyN513OHanwp5pDHj0gzK6 EIl9IalQ37WEO7uJ6dZ1MqU2YIKLGD9ZyZD3ntp0PZtsyMmxym5LGg5ynIf3jgNyWUIN IHTw== X-Forwarded-Encrypted: i=1; AJvYcCWzFg2Curlx9a5FnIJvHWbu5R6aNF745fLqTky45FaUhNMl0NaI9/TirVhtJelWJIxpMTnolM0qu3CIwxty431qsC21s0PlFsAl X-Gm-Message-State: AOJu0YzyYeFHBRZhRHkmMbHe9hSr35DoO1td11chb1ze4ckTxXtaYaJx Xa/Q8y6zkSUUwShsHAOjezvQU8wg0/IcEMjtYIOyqBvGkpD3kAYjAl9hkFufN6shBjbJviRRatx 8 X-Google-Smtp-Source: AGHT+IHegDffOemMkZRr1z5clHHoRm+28+LcT/mSIGMlqusLmTlMetnOCFLFjbavGCGyLgXAe6Kozw== X-Received: by 2002:a17:902:c3c6:b0:1dd:9da3:59ff with SMTP id j6-20020a170902c3c600b001dd9da359ffmr1727363plj.42.1710941059052; Wed, 20 Mar 2024 06:24:19 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:1d04:9481:20ec:563b:127c? ([2804:1b3:a7c3:1d04:9481:20ec:563b:127c]) by smtp.gmail.com with ESMTPSA id z6-20020a170903018600b001dde2c3fea5sm13425741plg.50.2024.03.20.06.24.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Mar 2024 06:24:18 -0700 (PDT) Message-ID: Date: Wed, 20 Mar 2024 10:24:15 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] or1k: Fix Linux user space signal ABI Content-Language: en-US To: Stafford Horne , GLIBC patches Cc: Linux OpenRISC References: <20240319214244.736981-1-shorne@gmail.com> <20240319214244.736981-2-shorne@gmail.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20240319214244.736981-2-shorne@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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). > --- > sysdeps/unix/sysv/linux/or1k/sys/ucontext.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sysdeps/unix/sysv/linux/or1k/sys/ucontext.h b/sysdeps/unix/sysv/linux/or1k/sys/ucontext.h > index b17e919154..1b428592ee 100644 > --- a/sysdeps/unix/sysv/linux/or1k/sys/ucontext.h > +++ b/sysdeps/unix/sysv/linux/or1k/sys/ucontext.h > @@ -38,6 +38,7 @@ typedef struct > unsigned long int __gprs[__NGREG]; > unsigned long int __pc; > unsigned long int __sr; > + unsigned long int __fpcsr; > } mcontext_t; > > /* Userlevel context. */