From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 3DA293858D33 for ; Wed, 11 Jan 2023 01:22:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DA293858D33 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-x62e.google.com with SMTP id d15so15122017pls.6 for ; Tue, 10 Jan 2023 17:22:43 -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=hTL/z7TYLmenYRsL7oKxA3VtgR9zwFc2T1cHpmtPgHA=; b=vkStbrjZ8vNbtsrCtY9AdIhEdxVfGWDNaE/s13iPOdleVehk75vl3bfa8rCZMj9dT9 rT8B6K755LektbTBOiYUObJ0QUMGUIQh1BNh3KiKHvlYifnoSp8ftsLJwhX29YZxtiRT dY8Nd0iiakDbmAeHizUUR5VlCvvV+u1wEXbvvgDJBmXtk7INBF+USMNcmjzArZYBWC6v k+cdCSGuCewXLjFbLz3pbfR4sqIrq5Ciw1cvKUfxMvD2AW8xxkxgs8lM0sH8wLUDJfI9 aymt3PfHRbYkO82foArxZrR+Z6kGMF/zSD7aGiOaDboQfkeeVM4JEGmXuWxMKDd5hB4x rFgg== 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=hTL/z7TYLmenYRsL7oKxA3VtgR9zwFc2T1cHpmtPgHA=; b=bPhvA/sV1HFMDaqZnXTY1GlxqzmUrNteT5VqVxnWk60BIWCGU2LwmExQMezsgdSjCU lr9out3X5zXvJPLhKu/NhLSqSTI1b/6M1jwsAEZUS/OVg0kqJumqrnE8boN2LZoaDQtQ bpKAW3Ty+mna7N5N6Md5OyL01oW0tnsgb5QOYrNCyJ4Qrcd2y9mq/S7CmF4d/La5/ebD 8OpLg/tsXVPtF9Em+urKwAZTEgGhkxXHO/I49F4BUXsWpVaFCe6JqqoP0sNnZlslkMHr 1r70gsqiVoTo7ciqTM3wIYRlIiMv6ZQpj4DgpOZh7QUzDVMkxReE2no+xF1XON+o3MxO X7lA== X-Gm-Message-State: AFqh2kqv0NgEyepC+NnbuWwRUE3fR4+wxI4Ic6HfhtFHqCvD7IUXOids 77357vB4cIm3gZip5cbiERdmpw== X-Google-Smtp-Source: AMrXdXvbL7c7Q6mjTqDlD18bK+d9ngDorZ7YFFQsEzv3N2nzE8B1b1qAziM2zmlBz2aZlWvRJN1vMA== X-Received: by 2002:a05:6a20:3955:b0:b5:ee36:59a8 with SMTP id r21-20020a056a20395500b000b5ee3659a8mr9571480pzg.2.1673400162098; Tue, 10 Jan 2023 17:22:42 -0800 (PST) Received: from [192.168.0.115] (63-157-97-90.dia.static.qwest.net. [63.157.97.90]) by smtp.gmail.com with ESMTPSA id ik9-20020a170902ab0900b00189743ed3b6sm8801912plb.64.2023.01.10.17.22.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 17:22:41 -0800 (PST) Message-ID: <3923eeee-e4dc-0911-40bf-84c34aee962d@linaro.org> Date: Tue, 10 Jan 2023 17:22:37 -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: Auto-enabling V unit and/or use of elf attributes (was Re: Adding V-ext regs to signal context w/o expanding kernel struct sigcontext to avoid glibc ABI break) To: Vineet Gupta , Kito Cheng Cc: Philipp Tomsich , Andy Chiu , Vincent Chen , Florian Weimer , Rich Felker , Andrew Waterman , Palmer Dabbelt , =?UTF-8?Q?Christoph_M=c3=bcllner?= , davidlt@rivosinc.com, Arnd Bergmann , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , 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> <50c598a6-e3b3-3062-abe7-23a406067533@rivosinc.com> <7430f494-9b43-5e03-c1e9-6b83e2611a11@rivosinc.com> <91ef3c45-165f-d2b3-7c77-322c01802c41@rivosinc.com> <18465ca3-934f-5b3e-170c-1ff0edea3a89@rivosinc.com> <1f8f1d21-4a19-54fe-8b29-bf9e2a8501d7@rivosinc.com> <3a838afe-974b-60bb-a0e5-83e366ec652e@rivosinc.com> Content-Language: en-US From: Richard Henderson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 1/10/23 10:07, Vineet Gupta wrote: > Yes bulk of glibc might not have vector code, but those V ifunc routines do and IMO this > information needs to be recorded somewhere in the elf. Case in point being the current > issue with how to enable V unit. Community wants a per-process enable, using an explicit > prctl from userspace (since RV doesn't have fault-on-first use hardware mechanism unlike > some of the other arches). But how does the glibc loader know to invoke prctl. We can't > just rely on user env GLIBC_TUNABLE etc since that might not be accurate. It needs > somethign concrete which IMO can come from elf attributes. If not, do you have suggestions > on how to solve this issue ? Why not just fault on first use to enable? That's vastly less complicated than trying to plumb anything through elf resulting in a prctl. You might say "but the fault could fail to allocate memory", but honestly, the prctl isn't able to fail either -- if it doesn't work, the process must exit. And, surely, there's some minimal vector configuration for which the allocation must succeed. r~