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 44D7BCD5BDF for ; Thu, 5 Sep 2024 16:55:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE9766B0083; Thu, 5 Sep 2024 12:55:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B98B76B0088; Thu, 5 Sep 2024 12:55:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A87506B008A; Thu, 5 Sep 2024 12:55:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8A8B66B0083 for ; Thu, 5 Sep 2024 12:55:36 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 37CD51603CA for ; Thu, 5 Sep 2024 16:55:36 +0000 (UTC) X-FDA: 82531285872.27.C453B36 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf29.hostedemail.com (Postfix) with ESMTP id C757D120028 for ; Thu, 5 Sep 2024 16:55:33 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725555236; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aOdfcFQetM01+z8mECluqz2SOuHThTJ5QWdrVy+40ic=; b=TKARtFxLPl4p1LktJ1lwUqoP99mQwH/ObCZeo6KKKhz+1D+QGFB4p/DCLNn4+k2V2x7i6V OKZhA8nbO7NCFMGPG5hqBIeQe+7lH3MbcjrECyK7K/ugZzqx+1tI4X5BOjMqfKqEJxg1x1 5tk7QlgYGPS21lvLIBP3FgNKoWbWZDY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725555236; a=rsa-sha256; cv=none; b=aU2eZosMy8WmTCdTz2SwJNiHc0O6Bz47OMaUiGdpBgiaZoUx7Xuuo1rXiu1ku3a2bE6BI7 afSgeplNMFzYSSjrDYurwamqjYemAtHht99LQaUfr5MqF6yjuzHVgqmUF5fGM63VgRS9+K D8kUsVB5xoBffzuZHIpO2yhWWFrq2Yo= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4X058M1gffz9sRs; Thu, 5 Sep 2024 18:55:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id utC0CxKuXD61; Thu, 5 Sep 2024 18:55:31 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4X058M0gPbz9sRr; Thu, 5 Sep 2024 18:55:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 046AF8B77C; Thu, 5 Sep 2024 18:55:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ScrEPCzszJ3z; Thu, 5 Sep 2024 18:55:30 +0200 (CEST) Received: from [192.168.235.60] (unknown [192.168.235.60]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EB2C58B778; Thu, 5 Sep 2024 18:55:29 +0200 (CEST) Message-ID: <85c02620-e8b2-4c97-9905-685a9a4e556d@csgroup.eu> Date: Thu, 5 Sep 2024 18:55:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32 To: "Jason A. Donenfeld" 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 References: <1f49c2ce009f8b007ab0676fb41187b2d54f28b2.1725304404.git.christophe.leroy@csgroup.eu> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: u437ie516c4jp9r1tc3xq5djcouod9b9 X-Rspamd-Queue-Id: C757D120028 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725555333-461013 X-HE-Meta: U2FsdGVkX1/Bjkgu7U3XHUz6Ka1kxXso3ktV07zTu3grEcF8ON8LeI/NQ2f6FtBPc5844UWs1XTkRggh9GpP98zjpVZAB2DkBkhjtEDH12LaDqybHnxTgY2MwOSFZotjmRsKw3RhBdF4EFFQ3N7HHuR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xzsMzQJNk9Tcl98opVvo6sBGGvV89QAA== 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: Le 05/09/2024 à 18:13, Jason A. Donenfeld a écrit : >> +/* >> + * 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. Did I write that ? I can't remember and neither can I remember testing it with time namespaces. > > 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. What is the command to use to test with time namespace ? > > Can you figure out what's going on and send a fix, which I'll squash > into this commit? Sure > > Jason > > [1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.zx2c4.com%2Flinux-rng%2Fcommit%2F%3Fh%3Djd%2Fvdso-test-harness&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C59fa9061064945c73a1608dccdc5b51c%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638611496253413014%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=ZUJqhcnZL7SYkuXUIt9Nlo46sZj26VYW%2F8I%2BrBLRpBE%3D&reserved=0