From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b5]) by sourceware.org (Postfix) with ESMTPS id 88D99396E872 for ; Thu, 8 Dec 2022 03:47:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88D99396E872 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <6d615a11-b863-1d76-e0ce-1f064cda06f1@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1670471267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0qF5/RtHG175q8g+36kV294jbONt9NNYZHlM+D96rsc=; b=NCmfiQLsmBAtBQyone2PGnzNWi3w+HRh6XAfU/DKLWtfWI1PYQUP2GnvEr5P4SM9riv7C6 skrGCr92VANFLgSu0XIhdNHlaro5VpSQ3X3cTQ3jBKtcPAVWe7ejcMvl2A376yCUyig3/J mmd9R/VDy2ZkH3NUO241glRsgvd4HCM= Date: Wed, 7 Dec 2022 19:47:43 -0800 MIME-Version: 1.0 X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US To: libc-help@sourceware.org Cc: siddhesh@gotplt.org, goldstein.w.n@gmail.com, hjl.tools@gmail.com X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vineet Gupta Subject: glibc tunables to disable axv not updating memcpy Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: Hi, I've been playing with x86_64 tunables to see how they are plumbed into ifunc machinery, but running into a something which I don't understand (this is glibc 2.35 so pretty recent). I'm disabling AVX and friends as: export GLIBC_TUNABLES=glibc.cpu.hwcaps=--SSSE3,-SSE4_2,AVX,-AVX2,-AVX512F,-AVX512VL A simple program which calls memcpy, seems to be calling __memmove_evex_unaligned_erms() despite my tunable disabling AVX512VL. | | main (argc=2, argv=0x7fffffffdce8) at test-mcpu.c:10 | 10 memcpy(dest, src, atoi(argv[1])); | (gdb) s | __memmove_evex_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:307 | 307 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S glibc dependency on AVX512VL for the said routine/ | IFUNC_IMPL_ADD (array, i, memmove, | CPU_FEATURE_USABLE (AVX512VL), | __memmove_evex_unaligned_erms) | There used to be AVX*_Usable for tunables but it seems that was changed in 107e6a3c2212ba7a3a (" x86: Support usable check for all CPU features") I also don't understand how the memcpy is being redirected to memmove, since assembler in test has a PLT call to memcpy. LD_DEBUG=all doesn't print any ifunc related info. I've tried hacking x86 elf_machine_lazy_rel() add dl_debug_printf() around R_X86_64_IRELATIVE - which seems to work but there's too less info to help answer the exact ifunc plumbing. Any ideas where to look ? Thx, -Vineet