From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 84AA43858D1E for ; Thu, 22 Dec 2022 05:32:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 84AA43858D1E 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-x630.google.com with SMTP id l10so996059plb.8 for ; Wed, 21 Dec 2022 21:32:55 -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:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Eu29fG3f+7YAspRkfHmhlvcLA9unjimxDV2WGeyIfAQ=; b=OQlLH7dfBS7CrWRapBdlamhi4y17+k7pmnhPa5dlgmYB/MZ2GgqCfeSgDl2nFEW4vW crevkFvB6WCsxoIHb3UqXtXvx2J2Vuglc7Szt8+APxZDho+LdZUIyM5BC9nTc+6xn0Np KzKYk4hBPY6Dpi6avJnTFfV9rBmaTS9CK13NkqxamZRxg2PUkcs7luVBEchh7aCcCcl2 /e4f+EMHs93/S9yrPJYQIycD35t8bGv2myy27Pd7KVDjOseaUxJOR/sgL69MNw5iJW9V p8L3UmzlgMlp9L7uJgifXEwhQlg7CIGXc1TMMXdnyYwQ3KqDYj9kmQ6LhLtbSuP4QuXJ lN9g== 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:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Eu29fG3f+7YAspRkfHmhlvcLA9unjimxDV2WGeyIfAQ=; b=iBJeV93muzknUtyJR278fWPx1dY+io9LonZMUimL/WJlVc5Fomocv39PUoK7MkLdqa 9j+2xJ17aBN4BsYoWhdom8GYs6u/55oCy39ipPfRASDZF+umnhhOekB3QfEXEwDGM5Mk 9+hAnK20TK/U0QF2N0VUWOFRe2yDL7+hTtMkliwiRhiKJQ4evJLQYN3W8FVbDntOpif4 tUVO0ZQM1OLBoVrWUMhuxCm8PrZXNE0D49WcHxWdv9L4IsMpiQ7FdKXMPd1gysN+dheB 5l2oDVPJRQxOyhYIJCusvOUUSWAEWfpG96LeQPkzU9TtCurYKvYHXMGcixswJes5tWS9 yyuA== X-Gm-Message-State: AFqh2kr2mWl7KFofh/dGeDBBkU/rVrcYjfZJZDkzOhn8ZQlCROmbYwZq UML71KDW+ecZfZw1dfpc7uGCpw== X-Google-Smtp-Source: AMrXdXtdMADeU7OKpTbjIQ6RMUIrdUHWJE7iWDrTvMpa8G4Z24aqdq/bTyQDx/X4qA4YDO9lmzUjCg== X-Received: by 2002:a17:902:7c89:b0:188:59e2:5f91 with SMTP id y9-20020a1709027c8900b0018859e25f91mr4226319pll.59.1671687174556; Wed, 21 Dec 2022 21:32:54 -0800 (PST) Received: from ?IPV6:2602:47:d48c:8101:716e:2242:a3b5:8079? ([2602:47:d48c:8101:716e:2242:a3b5:8079]) by smtp.gmail.com with ESMTPSA id k15-20020a170902c40f00b001869b988d93sm12432107plk.187.2022.12.21.21.32.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Dec 2022 21:32:54 -0800 (PST) Message-ID: Date: Wed, 21 Dec 2022 21:32:51 -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 To: Vineet Gupta , Vincent Chen Cc: 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 , Andy Chiu , 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> Content-Language: en-US From: Richard Henderson In-Reply-To: <7430f494-9b43-5e03-c1e9-6b83e2611a11@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 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/21/22 11:52, Vineet Gupta wrote: > This is not an issue, if we don't change sigcontext (in kernel and glibc) - it is > essentially the case of existing binaries. kernel still saves regs on user stack, in > rt_sigframe, its just that userspace is not able to access them in SA_SIGINFO signal > handers. aarch64 have this implemented this approach and it is likely they can't do > that either for SVE regs. aarch64 can certainly access the SVE regs on the signal stack. It simply requires that you parse the chain of extensions within __reserved to find it. It's quite well designed, really. What you can't do is "only" declare a sigcontext_t and be able to construct a new context, nor copy the entire context via structure assignment. There is room within the risc-v context for a similar scheme, via sigcontext.sc_fpregs.q.reserved[3] E.g. reserved[0] -> magic reserved[1] -> displacement to "extension area" reserved[2] -> size of "extension area" Thus the area can be located anywhere within 4GB and expand to 4GB. Not that I'd hope any signal frame would require 4GB. :-) r~