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 766573858D1E for ; Thu, 22 Dec 2022 22:33:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 766573858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-x633.google.com with SMTP id w20so3286970ply.12 for ; Thu, 22 Dec 2022 14:33:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oUqs8vcCeo3WHQ/wZsX/ATHWp0759Uw7X3vsCU3FtHY=; b=DwnHKs3c9lTnGCWPnEzrJd+HhxNJulfG2ievlpH2dXgxDg7pINpzCpKD8PFkAq4lvp OdzF1+9aG+FHTRi9Wa5C0W2LKepu1HbsED+iz/mAlHxrqhOnIcJPcei0dNgfQYTKU0to Sp3/v3vTR/c6mHaDigsc1vtniqXux4MPjatC7soqFopT56aPnWsYQAZVBT3eUtEZtNYD a137DrIn7gCuvJ65bLjneCZ++COlZ1G0hSL52cS7C+ZZWU7p/D327yHiGfei6n5IMzKt oiIp6OUmNScsilZl/rie6tId5bqQlxQRWlukBsTTYJb10kBIuNZfHNur0ymEFVmV/j1d OPzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to: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=oUqs8vcCeo3WHQ/wZsX/ATHWp0759Uw7X3vsCU3FtHY=; b=PCNtG9l5rqXfJJwYjEPLzdoGMVlINUlTuCiWv8eLxy1ZxeWJa5bFkBIaEqwKMKLP3U slzYHjvZkQtUORqMYsA3Vsgkj4ouX+MD//PIaeK/4FyeLMj/vXH6dvAA1B8tt/JBLuw0 4f9dlDbcAbZkWD74yT9qTpNC1NQleAGbs4AztWNcmRKuP9j7TWYIv7AYKgJxOPDG1XfA s/BIUezGH295ijoCmsm13ZMky3BW3Fkq5pxAyvqWNYU372hn9CVXjFIsWFoQ86D58kBT iEJ+etL4fmikcq3zDlYqUAqIqJ4+KagNnU/ZbLjE18iNxrSdrcEAZJft548PgQWp4ZwJ vYQA== X-Gm-Message-State: AFqh2krJxpkRCkfAq7SMcKQByxga4jnrzeoJHtuaM1JJuTgX3WeS+1zV DemBOHpylHwiGbjGD3fGmVoQTQ== X-Google-Smtp-Source: AMrXdXtIMyF6DUH+b6qp7alupaBEj70iepcAoTKuZjgt46jEFosCxcG59S9c6rru4hIHDbMvEpz6wA== X-Received: by 2002:a17:902:bc45:b0:191:3c3d:86fd with SMTP id t5-20020a170902bc4500b001913c3d86fdmr8146280plz.48.1671748409505; Thu, 22 Dec 2022 14:33:29 -0800 (PST) Received: from [192.168.101.16] ([75.147.178.105]) by smtp.gmail.com with ESMTPSA id l6-20020a170903120600b00190c6518e30sm961407plh.243.2022.12.22.14.33.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Dec 2022 14:33:28 -0800 (PST) Message-ID: <68fdb6e2-ed53-32ea-52ca-1e4d913ff7f3@linaro.org> Date: Thu, 22 Dec 2022 14:33:25 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Adding V-ext regs to signal context w/o expanding kernel struct sigcontext to avoid glibc ABI break Content-Language: en-US To: Andy Chiu Cc: Vineet Gupta , Vincent Chen , Florian Weimer , Rich Felker , Andrew Waterman , Palmer Dabbelt , Kito Cheng , =?UTF-8?Q?Christoph_M=c3=bcllner?= , davidlt@rivosinc.com, Arnd Bergmann , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Philipp Tomsich , Szabolcs Nagy , Greentime Hu , Aaron Durbin , Andrew de los Reyes , linux-riscv , GNU C Library References: <1631497278-29829-1-git-send-email-vincent.chen@sifive.com> <1631497278-29829-3-git-send-email-vincent.chen@sifive.com> <871r5sd1zq.fsf@oldenburg.str.redhat.com> <20210913135247.GL13220@brightrain.aerifal.cx> <87sfy5ndid.fsf@oldenburg.str.redhat.com> <73c0124c-4794-6e40-460c-b26df407f322@rivosinc.com> <50c598a6-e3b3-3062-abe7-23a406067533@rivosinc.com> <7430f494-9b43-5e03-c1e9-6b83e2611a11@rivosinc.com> From: Richard Henderson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 12/22/22 10:33, Andy Chiu wrote: > I wrote a PoC patch for this and it has been pushed into the following git tree: > https://github.com/sifive/riscv-linux/tree/dev/andyc/for-next-v13 I had a look at your include/uapi/, and it looks good. Mere nits: > struct __riscv_q_ext_state { > __u64 f[64] __attribute__((aligned(16))); > __u32 fcsr; > /* > * Reserved for expansion of sigcontext structure. Currently zeroed > * upon signal, and must be zero upon sigreturn. > */ > __u32 reserved[3]; > }; > > struct __riscv_ctx_hdr { > __u32 magic; > __u32 size; > __u32 reserved; > }; Thinking about the _next_ extension on the chain, perhaps drop the 3rd word from here, so that (&hdr + 1) is 8-byte aligned (which may be enough depending on what the extension contains)? > struct __riscv_extra_ext_header { > __u64 ignored[64] __attribute__((aligned(16))); > __u32 padding; > /* > * Reserved for expansion of sigcontext structure. Currently zeroed > * upon signal, and must be zero upon sigreturn. > */ > struct __riscv_ctx_hdr hdr; > }; __u32 __padding[129] or __u64 __padding[65] depending on your answer to the above? It might reduce confusion to move (or replicate, for redundancy) the aligned(16) from the innermost __riscv_q_ext_state.f[] to the outermost sc_fpregs and/or sigcontext.