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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F308C33CB3 for ; Thu, 16 Jan 2020 10:35:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D96922072B for ; Thu, 16 Jan 2020 10:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726410AbgAPKfg convert rfc822-to-8bit (ORCPT ); Thu, 16 Jan 2020 05:35:36 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:51161 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgAPKff (ORCPT ); Thu, 16 Jan 2020 05:35:35 -0500 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1is2Uf-00048X-Ra; Thu, 16 Jan 2020 11:35:17 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 7755E101B66; Thu, 16 Jan 2020 11:35:17 +0100 (CET) From: Thomas Gleixner To: Christophe Leroy , luto@kernel.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , arnd@arndb.de, vincenzo.frascino@arm.com, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org Subject: Re: [RFC PATCH v3 08/12] lib: vdso: allow arches to provide vdso data pointer In-Reply-To: References: <381e547dbb3c48fd39d6cf208033bba38ad048fb.1578934751.git.christophe.leroy@c-s.fr> <87ftghbpuu.fsf@nanos.tec.linutronix.de> Date: Thu, 16 Jan 2020 11:35:17 +0100 Message-ID: <87k15rwuxm.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Le 15/01/2020 à 07:15, Christophe Leroy a écrit : > From your point of view, what should I do: > A/ __arch_get_vdso_data() handled entirely at arch level and arches > handing over the vdso data pointer to generic C VDSO functions all the > time (as in my v2 series) ? No. That's again moving the same code to all architectures. > B/ Data pointer being handed over all the way up for arches wanting to > do so, no changes at all for others (as in my v3 series) ? Too much ifdeffery > C/ __arch_get_vdso_data() being called at the outermost generic level > for arches not interested in handling data pointer from the caller (as > suggested by Thomas) ? > > Andy, with A/ you were concerned about arches being able to do PC > related accesses. Would it be an issue for C/ as well ? If not, I guess > C/ would be cleaner than B/ allthought not as clean as A which doesn't > add any #ifdefery at all. You can avoid ifdeffery with C if you do: static __maybe_unused int __cvdso_data_clock_gettime(clockid_t clock, struct __kernel_timespec *ts, const struct vdso_data *vd) { ..... } static __maybe_unused int __cvdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) { const struct vdso_data *vd = __arch_get_vdso_data(); return __cvdso_data_clock_gettime(clock, ts, vd); } and then use __cvdso_data_clock_gettime on PPC and let the other archs unmodified. Thanks, tglx 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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4007CC33CB1 for ; Thu, 16 Jan 2020 10:37:46 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 B79892075B for ; Thu, 16 Jan 2020 10:37:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B79892075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47z0yG2t4NzDqby for ; Thu, 16 Jan 2020 21:37:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linutronix.de (client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linutronix.de Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA256 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47z0vm5bjdzDqYh for ; Thu, 16 Jan 2020 21:35:32 +1100 (AEDT) Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1is2Uf-00048X-Ra; Thu, 16 Jan 2020 11:35:17 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 7755E101B66; Thu, 16 Jan 2020 11:35:17 +0100 (CET) From: Thomas Gleixner To: Christophe Leroy , luto@kernel.org Subject: Re: [RFC PATCH v3 08/12] lib: vdso: allow arches to provide vdso data pointer In-Reply-To: References: <381e547dbb3c48fd39d6cf208033bba38ad048fb.1578934751.git.christophe.leroy@c-s.fr> <87ftghbpuu.fsf@nanos.tec.linutronix.de> Date: Thu, 16 Jan 2020 11:35:17 +0100 Message-ID: <87k15rwuxm.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Mackerras , vincenzo.frascino@arm.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Christophe Leroy writes: > Le 15/01/2020 =C3=A0 07:15, Christophe Leroy a =C3=A9crit=C2=A0: > From your point of view, what should I do: > A/ __arch_get_vdso_data() handled entirely at arch level and arches=20 > handing over the vdso data pointer to generic C VDSO functions all the=20 > time (as in my v2 series) ? No. That's again moving the same code to all architectures. > B/ Data pointer being handed over all the way up for arches wanting to=20 > do so, no changes at all for others (as in my v3 series) ? Too much ifdeffery > C/ __arch_get_vdso_data() being called at the outermost generic level=20 > for arches not interested in handling data pointer from the caller (as=20 > suggested by Thomas) ? > > Andy, with A/ you were concerned about arches being able to do PC=20 > related accesses. Would it be an issue for C/ as well ? If not, I guess=20 > C/ would be cleaner than B/ allthought not as clean as A which doesn't=20 > add any #ifdefery at all. You can avoid ifdeffery with C if you do: static __maybe_unused int __cvdso_data_clock_gettime(clockid_t clock, struct __kernel_timespec *ts, const struct vdso_data *vd) { ..... } static __maybe_unused int __cvdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) { const struct vdso_data *vd =3D __arch_get_vdso_data(); return __cvdso_data_clock_gettime(clock, ts, vd); } and then use __cvdso_data_clock_gettime on PPC and let the other archs unmodified. Thanks, tglx 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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0395C33CB7 for ; Thu, 16 Jan 2020 10:35:37 +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 A2A772072B for ; Thu, 16 Jan 2020 10:35:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AItfOMIu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2A772072B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uvwk3vjJDC/cgi890yZGBxT4rCYYdy9yCHfpZSwGfLs=; b=AItfOMIuS8uFXC bm1SQP1AkA+wLG3xzk0/ZLgKZK+RKPLC4mey5E7XbzDH03bgDkEPlN0ZWwSFVfdrVT6/3ntX2jNLF tJw/wU1r5QNBGj9NHYmZda6iQ8JiQUA4NDI3Odwr5yYR92Dc0ncM5dNypjCBolLFpD+IuGVHOYKQ/ S7eEDWzxT14LhW9Vz4QD/y9AASliAzFFm+c9R4M0ZVzgvPIe9zhrnQnLYz17PNd+jGrn/rQq4aSm/ cCksWyidVoADf11zOOMFbTUpc9icRY++vY/DYQn02qzKl4943s0O1A70kqdnTdAoeoPLukxHDRHYL BuwjRcbUypi1KU178EKQ==; 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 1is2Uu-0006y5-V9; Thu, 16 Jan 2020 10:35:32 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1is2Uo-0006p1-I6 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jan 2020 10:35:31 +0000 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1is2Uf-00048X-Ra; Thu, 16 Jan 2020 11:35:17 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 7755E101B66; Thu, 16 Jan 2020 11:35:17 +0100 (CET) From: Thomas Gleixner To: Christophe Leroy , luto@kernel.org Subject: Re: [RFC PATCH v3 08/12] lib: vdso: allow arches to provide vdso data pointer In-Reply-To: References: <381e547dbb3c48fd39d6cf208033bba38ad048fb.1578934751.git.christophe.leroy@c-s.fr> <87ftghbpuu.fsf@nanos.tec.linutronix.de> Date: Thu, 16 Jan 2020 11:35:17 +0100 Message-ID: <87k15rwuxm.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200116_023526_756002_54283908 X-CRM114-Status: GOOD ( 11.16 ) 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: arnd@arndb.de, Benjamin Herrenschmidt , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Mackerras , Michael Ellerman , vincenzo.frascino@arm.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Q2hyaXN0b3BoZSBMZXJveSA8Y2hyaXN0b3BoZS5sZXJveUBjLXMuZnI+IHdyaXRlczoKPiBMZSAx NS8wMS8yMDIwIMOgIDA3OjE1LCBDaHJpc3RvcGhlIExlcm95IGEgw6ljcml0wqA6Cj4gIEZyb20g eW91ciBwb2ludCBvZiB2aWV3LCB3aGF0IHNob3VsZCBJIGRvOgo+IEEvIF9fYXJjaF9nZXRfdmRz b19kYXRhKCkgaGFuZGxlZCBlbnRpcmVseSBhdCBhcmNoIGxldmVsIGFuZCBhcmNoZXMgCj4gaGFu ZGluZyBvdmVyIHRoZSB2ZHNvIGRhdGEgcG9pbnRlciB0byBnZW5lcmljIEMgVkRTTyBmdW5jdGlv bnMgYWxsIHRoZSAKPiB0aW1lIChhcyBpbiBteSB2MiBzZXJpZXMpID8KCk5vLiBUaGF0J3MgYWdh aW4gbW92aW5nIHRoZSBzYW1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