Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7612170ybl; Thu, 16 Jan 2020 02:38:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyCg8lq1h2hI9NQKYedE4Bzjv3NTxy4hjJZ8zLtkiOGqpxiUijqc5LJMrk+8ibgwFhpsNws X-Received: by 2002:aca:43c1:: with SMTP id q184mr3346630oia.116.1579171109844; Thu, 16 Jan 2020 02:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579171109; cv=none; d=google.com; s=arc-20160816; b=Ei+JujlQjqB0uhwrKXdCybML55O3UFU7KYPPA6FFslgYFoPN+WeOV6t8ItKXdk6s6c lQ6xXP5JdsaTX/XufFgEtNOYew5AysaFrgrgAU+LmX+oIb+6kL76uS7JpNdZ5p0og+XT zUplKBL5GHKhkd7sreUvp2EXrMLJBEJcH3uqdM98nfymeXRJ1qzSmrO0c/iWMd0hBfs4 7wloheAkqfQSsEjcvXPDIGCAph8qOMQ5N8Z6eiRhwcHa7nMexMpEWxXvRzogIxXvlMFo bXVsbHF2xMFRaL7B0ACpRdHtYT9ED42SSqX+9Hcv25h3ZQXyFsKBBG/v9RrgQHtLbmGE UKPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=DlSR1S1XFNwBViIJEjPjmCeXPFl1r7O97bxZunP1cgI=; b=HmfO/dgBjSp4SH0ayfbjsN30iTABr2pAF5ZbyYxx2oD6huO1L7PVqgfa1cI71q7rhe F0VvXMK++GiQrBhOOoauSX6DmS4IPD+SxSeyhZr5DOly8UwMQbU0lmrXUwQ+/DWDCyLt UF22X68DffeTCvS6/9cgRqLNWiX3WGYB20nfPEWak89x/8NMcf5ooTOPmsCfaDj8yNUR iIIWkpmxcU8mFNc6hb7Tmd90hTakzBvdprRr3QhSoYWyWIvL46lCPLv0DNyo5b33lBYh URdXZ+XdQlaxeHBAafrdMwuvvJlEDDqmdT8947pSFt9jFFi2AGJp3iv1EBFp74iayexe u4/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si10888124oib.115.2020.01.16.02.38.17; Thu, 16 Jan 2020 02:38:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726370AbgAPKfg convert rfc822-to-8bit (ORCPT + 99 others); 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