From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A539CD5BCF for ; Thu, 5 Sep 2024 16:13:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B92B6B0088; Thu, 5 Sep 2024 12:13:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8687F6B0089; Thu, 5 Sep 2024 12:13:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 730D06B008A; Thu, 5 Sep 2024 12:13:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 548C96B0088 for ; Thu, 5 Sep 2024 12:13:43 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B47BF160701 for ; Thu, 5 Sep 2024 16:13:42 +0000 (UTC) X-FDA: 82531180284.16.EDDDA3B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id CE73640011 for ; Thu, 5 Sep 2024 16:13:40 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=HegSE7me; spf=pass (imf12.hostedemail.com: domain of "SRS0=ehJl=QD=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=ehJl=QD=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=quarantine) header.from=zx2c4.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725552796; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=55bJknDRImEIEh83mNWUbwqRYAr8coQT4CUKKDd4gNA=; b=KHPpyuNRG2fGLmOjhAEMkyfzzSYLWiNt11xL84fZfkGCu9vlTz6UvdCmKSmaAmfPgAOjWV MsNORcgxx+JPtFOBFaiDGuqimwB+JDms1aRnSSt/Z28Lu5/g1KXwAr8BzrSuno/XBoeh8S v9XD6omktTISxVvphPoTsmfLVVvGaQI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=HegSE7me; spf=pass (imf12.hostedemail.com: domain of "SRS0=ehJl=QD=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=ehJl=QD=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=quarantine) header.from=zx2c4.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725552796; a=rsa-sha256; cv=none; b=NDWwMN3TDQRQQBJFsYiX7s1gL53ETCH4kJK830cJ1Zq9xX5aFlw/fSNLgbxfqyIbNLVqSl WGSDNhb/N2G226Lmv6TNH2HN6YIsvybjue7pLPr4DeMvuYafMgWISkwoN0AooilAt6QFiA +TGE3/wXOhxxejerCdlJcAakzI3+264= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 26A3C5C571E; Thu, 5 Sep 2024 16:13:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5C3EC4CEC3; Thu, 5 Sep 2024 16:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1725552814; 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: in-reply-to:in-reply-to:references:references; bh=55bJknDRImEIEh83mNWUbwqRYAr8coQT4CUKKDd4gNA=; b=HegSE7mehyaj6SAp/VnhlvGaaf85fyzlVkfWcnn7sUGLHgxLA3R706+39iH7IugfbGGag4 p5FlY4bhYQq8YynPTQwVluyERdi6BU1onSw+v7PJ1EWAFn80DQmJzY/8vYGa8CRoj7fR1k Bvw94kDNyDv1iVrUc3RWVgEGHcyil8w= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 9ecc21b4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 5 Sep 2024 16:13:33 +0000 (UTC) Date: Thu, 5 Sep 2024 18:13:29 +0200 From: "Jason A. Donenfeld" To: Christophe Leroy Cc: Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Shuah Khan , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, Adhemerval Zanella , Xi Ruoyao Subject: Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32 Message-ID: References: <1f49c2ce009f8b007ab0676fb41187b2d54f28b2.1725304404.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1f49c2ce009f8b007ab0676fb41187b2d54f28b2.1725304404.git.christophe.leroy@csgroup.eu> X-Rspam-User: X-Stat-Signature: rfobdxxa8fhyseyhy46zy7f5nwcrtp94 X-Rspamd-Queue-Id: CE73640011 X-Rspamd-Server: rspam11 X-HE-Tag: 1725552820-795357 X-HE-Meta: U2FsdGVkX19ahQqyUe7AJcmMMtxbfSVivkv5z3aQNgM/ftm0Z22by+8h3ANZtj2yItS8B9bSrg1eZk+Mb88veW+FRM+P1B8XHJ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nQo27kH4oEE6oklvaeoD9HxTnkwSwg+UaVwK2dTjfrogAKfFnKrFI/82zVmIijMxJpM0yTO8iDWYNjSVguDKuCnqItXfBLRxc5j/tBmb/qqYLK0o2zH7jjjk9V85dJ5vyrNaTAg+SS1CCSEn1SPuQuo///Ts5lWn5sNokXjW6yF0UaFDz44M7Kk6Trr1QOYm2dfKX/kLNzTx3pAasa0fovkgaiyibLjjpT6uWPKe5X0PQeI9IUpo2953DiPcCylPOXqTNgZr0QZ9Cckj+8I9EzIVq++wXY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: > +/* > + * The macro sets two stack frames, one for the caller and one for the callee > + * because there are no requirement for the caller to set a stack frame when > + * calling VDSO so it may have omitted to set one, especially on PPC64 > + */ > + > +.macro cvdso_call funct > + .cfi_startproc > + PPC_STLU r1, -PPC_MIN_STKFRM(r1) > + .cfi_adjust_cfa_offset PPC_MIN_STKFRM > + mflr r0 > + PPC_STLU r1, -PPC_MIN_STKFRM(r1) > + .cfi_adjust_cfa_offset PPC_MIN_STKFRM > + PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) > + .cfi_rel_offset lr, PPC_MIN_STKFRM + PPC_LR_STKOFF > + get_datapage r8 > + addi r8, r8, VDSO_RNG_DATA_OFFSET > + bl CFUNC(DOTSYM(\funct)) > + PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) > + cmpwi r3, 0 > + mtlr r0 > + addi r1, r1, 2 * PPC_MIN_STKFRM > + .cfi_restore lr > + .cfi_def_cfa_offset 0 > + crclr so > + bgelr+ > + crset so > + neg r3, r3 > + blr > + .cfi_endproc > +.endm You wrote in an earlier email that this worked with time namespaces, but in my testing that doesn't seem to be the case. >From my test harness [1]: Normal single thread vdso: 25000000 times in 12.494133131 seconds libc: 25000000 times in 69.594625188 seconds syscall: 25000000 times in 67.349243972 seconds Time namespace single thread vdso: 25000000 times in 71.673057436 seconds libc: 25000000 times in 71.712774121 seconds syscall: 25000000 times in 66.902318080 seconds I'm seeing this on ppc, ppc64, and ppc64le. Can you figure out what's going on and send a fix, which I'll squash into this commit? Jason [1] https://git.zx2c4.com/linux-rng/commit/?h=jd/vdso-test-harness