From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0EDC21F44D for ; Thu, 21 Mar 2024 15:44:06 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=J6P9NsXk; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BAF7385843A for ; Thu, 21 Mar 2024 15:44:04 +0000 (GMT) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 170EA3858CD1 for ; Thu, 21 Mar 2024 15:43:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 170EA3858CD1 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 170EA3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::631 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711035824; cv=none; b=aDdu85+2UvH7P0QYbXDfxFNkHwK8pYvLm7UJXChHxO2JPev/y6/mf9FWM3Lqscf32Jw7rKZiBZR6BUty6zThCvswB3YHPeEm0TEnc7Rqt+3Gv8yq60bGn3mPms9S40arMV+jxHSItr6gncCQ5xgmdzZ+fhyWRHOH3ta/4jufdio= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711035824; c=relaxed/simple; bh=MJfX0o4RP6wam9Hk9nmiRSBU21IQB+eStqj+XWzQTTc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=RRJ4hpk2NvTbobLRWWyZrqRzEJGOKlrRwjtLQLzjXUjR9s3U5uH2mmKqsF0WqDSUFy/9gZRxOjW/NoB3ct5whuZp6ygYSoBbPlPOTm+Oa4v5IGyvqJKty6tt5quSPw/M5uxxi0hWm//Vsdf5oolxIF86fnj8NcHSmp9VmPQOD7k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1dff837d674so9077865ad.3 for ; Thu, 21 Mar 2024 08:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711035821; x=1711640621; 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=yEHG7eapCKRUu/Idh4TtRJvKr62yjfnW1Pbi2futEAY=; b=J6P9NsXk3Xl7hxxko6rkGdRuyBVDzWxLCdeQ5Qs/0i5wd8PQndoBt9lLFPiFVS1ZYi DiDEu6N1ZSXj0l27H6kA5VGrDQj10mf1mptai8MW7lCa282x08Ij7ckwHMjRakh3/ACH YePm1HXK8d2t8vnsoybyi2BnYZJeoGsmZQkl9HOwwTCWAh4k4qBDooM66ic0gOlbTqgc IHsBxZI1BQ1R0L1k+OptLgZa2y9o7T5ACSU7sEvF/YjRmlBXvoQaGoxEXPAZB6igzFvq zjA9ej89bMYKYgR2vsg0KkQqWuhMGATo+bP0LYqz9VbR8mmHCt0RDsTyd2+4Yx+u/zWL 2Lgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711035821; x=1711640621; 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=yEHG7eapCKRUu/Idh4TtRJvKr62yjfnW1Pbi2futEAY=; b=myffVfd6tChd4t5Tje0dfRv6hLghNiOrRNWC+2aoRXSRsEDq/tZmgq/wH2fCIRaIHP /j2Fqpy0kLgefo1mbuYz9Xl0CpC3SBSrCmBhs3XLvtEQq1asp6CEoJ7q0E7uIi+xnfhC 9+ywLOhBghvH00RW0roVJV2GtLtBLc+VzdP4QOcX6J8tKJY/yo2Idwlc7VEUuJTA0yZJ O4KsKI0JzvkgDem1EWW33qmlV+bRqwe2OM3xmR8DXlChwxqaDB7rlwnGKOicwUrjVXr6 3oqAHeUSTjUXKiUSXhoYEtDfyqYg9GM8cjpXHLCT7NVCnFkM8g3w9Q36/5OCLvphXIf9 tJWw== X-Forwarded-Encrypted: i=1; AJvYcCWrIIV56EXip3y608SxsKUBK64ZiPrKH7S2SIh/GG6dTUgiiOJ3tIKrdl3NRD5urIObJt9BuAZINPzXkSYikJAK3kviOCXFTz2/ X-Gm-Message-State: AOJu0Yxq56op4CAJEVzR2n1hrNaZhW9BniInwNDzGrTNAp2d8heHPEY3 WnJIq5os1Svvl49fxSeP6jbZqh3pN6pXeXctFI2XKtz285Bf/ZSJWs6pAKF9CJI= X-Google-Smtp-Source: AGHT+IGZHZ7pdSw/D9UzJX3ItKrhnEjPWjIwKq0Z2eIZeYmT3kzfnrM+MlIw+k3dxzAevCFIKx8j1A== X-Received: by 2002:a17:903:1108:b0:1de:f95a:2677 with SMTP id n8-20020a170903110800b001def95a2677mr6450801plh.52.1711035820932; Thu, 21 Mar 2024 08:43:40 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:1d04:bcc1:505d:b612:f9f0? ([2804:1b3:a7c3:1d04:bcc1:505d:b612:f9f0]) by smtp.gmail.com with ESMTPSA id jc14-20020a17090325ce00b001dd707d5fe6sm16011607plb.158.2024.03.21.08.43.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Mar 2024 08:43:40 -0700 (PDT) Message-ID: <65f5177c-f7a3-40e9-9ab8-a91a91087f67@linaro.org> Date: Thu, 21 Mar 2024 12:43:36 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] AArch64: Check kernel version for SVE ifuncs Content-Language: en-US To: Florian Weimer , Szabolcs Nagy Cc: Wilco Dijkstra , 'GNU C Library' References: <87r0g4q5e6.fsf@oldenburg3.str.redhat.com> <87o7b7zu63.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87o7b7zu63.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org On 21/03/24 08:44, Florian Weimer wrote: > * Szabolcs Nagy: > >> The 03/20/2024 16:39, Florian Weimer wrote: >>> * Szabolcs Nagy: >>> >>>> The 03/18/2024 14:14, Wilco Dijkstra wrote: >>>>> >>>>> v2: Add __LINUX_KERNEL_VERSION #ifdefs, improve parser, use 8:8:8 format. >>>>> >>>>> Old Linux kernels disable SVE after every system call. Calling the >>>>> SVE-optimized memcpy afterwards will then cause a trap to reenable SVE. >>>>> As a result, applications with a high use of syscalls may run slower with >>>>> the SVE memcpy. This is true for kernels between 4.15.0 and before 6.2.0, >>>>> except for 5.14.0 which was patched. Avoid this by checking the kernel >>>>> version and selecting the SVE ifunc on modern kernels. >>>>> >>>>> Parse the kernel version reported by uname() into a 24-bit kernel.major.minor >>>>> value without calling any library functions. If uname() is not supported or >>>>> if the version format is not recognized, assume the kernel is modern. >>>>> >>>>> Passes regress, OK for commit? >>>> >>>> OK to commit. (clearly a hack but what can we do..) >>>> >>>> Reviewed-by: Szabolcs Nagy >>> >>> I have not had a chance to test this yet with the el9 kernel. >>> >>> I will try to do this tomorrow. >>> >>> Do we need to include other distribution LTS kernels in the version >>> check? >> >> i checked some (suse,ubuntu,debian) and they didn't have the >> SVE backport (maybe we should request those backports, but >> today the version check looks ok) > > I think we should make this change in one commit if at all possible, > otherwise we risk creating too much divergence. But if you consider > further kernel backports unlikely, the v2 patch is okay. > > Anyway, I verified this against 4.18 and 5.14 kernels, and got the > expected results (__memcpy_generic and __memcpy_sve). If you have check through the string tests, you might not get the correct answer since it uses the ifunc-impl-list.c and this patch does not changes the reported functions. > > Tested-by: Florian Weimer > > Thanks, > Florian >