From patchwork Thu Jan 30 16:08:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 11358249 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8511714E3 for ; Thu, 30 Jan 2020 16:08:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5DED721734 for ; Thu, 30 Jan 2020 16:08:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UaDHA/+C"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=c-s.fr header.i=@c-s.fr header.b="FQUlvhVm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DED721734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:To:Subject: From:Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=/UR+KZj/co0dz962dI2ry+zZnIc8l8Lp0jY7iybOqEo=; b=UaD HA/+CKdfJmPkVMIxnEsB7Ep5adfHJmLwYll4Fn0NpN7MOO1kYU6qWVurNrV+qLDanp+LE3gw+DxKA sGkhnzZnbVOMaFz4+jt1k5FO964SLUpecrNGOamfKxUtxDSC+MCoqCpAqmmyKpdZ1YN41yYHwHemH JimGgM6IiYfiFvIeNaSNOHyGa6aVRNOVwb8ugtMZGJm2Nb7hgRBo3ihOIlVDlnYWXZLgUP9k9/uWt RnG8jp4dDSPzwFWjpYIv/QjJYcV6AhQE5LeeeifVNqmno7bdEOKzOM+UbkDr50OVUq+uYBAL8zNMM QEUA26Bs1SdD0wK3o/reRti+nb9lsVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixCN1-0000Zg-JQ; Thu, 30 Jan 2020 16:08:43 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixCMx-0000W5-SW for linux-arm-kernel@lists.infradead.org; Thu, 30 Jan 2020 16:08:41 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 487ldY3xydz9v6KM; Thu, 30 Jan 2020 17:08:33 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=FQUlvhVm; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id wIEqw9oDIA6F; Thu, 30 Jan 2020 17:08:33 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 487ldY2t0xz9v6KL; Thu, 30 Jan 2020 17:08:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1580400513; bh=4gy05PHuez6bivrIGkJNuEVnZ24TDpRGy3B+DHczM3E=; h=From:Subject:To:Cc:Date:From; b=FQUlvhVmZKvZxXxg7cK4U5Cfll3ntifWapTKxoZctIQ9egTmZuqdjZGKPp9nTug6Y SFhbCQOntoMGKsAkvyYbYKF1dVGaz47UChW4nIF7Q8ug/ClNbVsLD3QigiDc3CoiJ3 0QSsV+tT2aHX7KbBaYenl5hgYHuwpiiX8gCCS4LI= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E0CFD8B87B; Thu, 30 Jan 2020 17:08:34 +0100 (CET) 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 paLKA8Pe3ank; Thu, 30 Jan 2020 17:08:34 +0100 (CET) Received: from po14934vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9C3CD8B877; Thu, 30 Jan 2020 17:08:34 +0100 (CET) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 2FE7465283; Thu, 30 Jan 2020 16:08:34 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v5 0/6] powerpc: switch VDSO to C implementation. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , nathanl@linux.ibm.com, arnd@arndb.de, tglx@linutronix.de, vincenzo.frascino@arm.com, luto@kernel.org Date: Thu, 30 Jan 2020 16:08:34 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200130_080840_231261_50E7C97E X-CRM114-Status: GOOD ( 10.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [93.17.236.30 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This is a fifth version of a series to switch powerpc VDSO to generic C implementation. All previous where RFCs. This one has reached a mature status. It is tested on PPC32 (mpc885 and mpc8321E). It is build tested on kisskb (http://kisskb.ellerman.id.au/kisskb/head/abf15916bd65f808b07fe9a2377db965a37071e4/) In PPC64 mode it now builds both VDSO64 and VDSO32. The two first patches are optimisation around the way vdso datapage is handled. They are worth merging now even if we want to wait a little more for the entire series. The next three patches are optimisations to the GENERIC C VDSO code. Without them, the performance of the VDSO time functions are too degraded compared to the current ASM version to be worth switching the C VDSO. This series applies on today's powerpc/merge branch. See the last patch for details on changes and performance. Christophe Leroy (6): powerpc/vdso64: Switch from __get_datapage() to get_datapage inline macro powerpc/vdso: Remove __kernel_datapage_offset and simplify __get_datapage() lib/vdso: Allow architectures to provide the vdso data pointer lib/vdso: Allow fixed clock mode lib/vdso: Allow architectures to override the ns shift operation powerpc/vdso: Switch VDSO to generic C implementation. arch/powerpc/Kconfig | 2 + arch/powerpc/include/asm/vdso/gettimeofday.h | 158 ++++++++++ arch/powerpc/include/asm/vdso/vsyscall.h | 25 ++ arch/powerpc/include/asm/vdso_datapage.h | 51 ++-- arch/powerpc/kernel/asm-offsets.c | 49 +--- arch/powerpc/kernel/time.c | 90 ------ arch/powerpc/kernel/vdso.c | 58 +--- arch/powerpc/kernel/vdso32/Makefile | 32 +- arch/powerpc/kernel/vdso32/cacheflush.S | 2 +- arch/powerpc/kernel/vdso32/config-fake32.h | 34 +++ arch/powerpc/kernel/vdso32/datapage.S | 7 +- arch/powerpc/kernel/vdso32/gettimeofday.S | 291 +------------------ arch/powerpc/kernel/vdso32/vdso32.lds.S | 7 +- arch/powerpc/kernel/vdso32/vgettimeofday.c | 29 ++ arch/powerpc/kernel/vdso64/Makefile | 23 +- arch/powerpc/kernel/vdso64/cacheflush.S | 9 +- arch/powerpc/kernel/vdso64/datapage.S | 31 +- arch/powerpc/kernel/vdso64/gettimeofday.S | 243 +--------------- arch/powerpc/kernel/vdso64/vdso64.lds.S | 7 +- arch/powerpc/kernel/vdso64/vgettimeofday.c | 29 ++ lib/vdso/gettimeofday.c | 98 +++++-- 21 files changed, 467 insertions(+), 808 deletions(-) create mode 100644 arch/powerpc/include/asm/vdso/gettimeofday.h create mode 100644 arch/powerpc/include/asm/vdso/vsyscall.h create mode 100644 arch/powerpc/kernel/vdso32/config-fake32.h create mode 100644 arch/powerpc/kernel/vdso32/vgettimeofday.c create mode 100644 arch/powerpc/kernel/vdso64/vgettimeofday.c