Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8365022ybl; Thu, 16 Jan 2020 15:25:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxSYgTlv54wm+S0+uHTphTklaakx6uNB++CCuNdePtPdX+MO6FHsrlJ2mYakZPi6AgpaI3T X-Received: by 2002:aca:d787:: with SMTP id o129mr1325290oig.75.1579217127416; Thu, 16 Jan 2020 15:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579217127; cv=none; d=google.com; s=arc-20160816; b=y+62NbffgFxQ3sZrRLucoM5gy+deU1W+kVQI0/08+dzm4gzbJr+C7O6eA6SDY03q4B 9RGbHfdhyCLzHD7u1ZWgDHvFHnJO7nNTpfvxbi4OoePjHM+OxDrwuOxq7O9nXlQvFtHz HhZ5lrfxLctF7bekOk6cmNIF41v/rGy6g57sw/4GDsqnxhRvKt5EMeY0B3M2Ugg88ArZ GHtLD3uYWJeigKkpisxiWUluZo1sFYhou8QEjmVxqiuIVuvm7+FGevIcMp5V0yE2ll7C t5tRyMqkvHhlO9wchNr1rs7HB54/VmhKOYQIYqU22IOPOOqF2UKDqA0X9sJVZY6i+6uD CgLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BZ9FulPrrQG0tKNZm+vLPcbivh5+jYfBaWxvFKpY+vo=; b=LX7CmR3VYyjs8SVJkZNbyeaHdvY7JAkzHhjpdV9KiQ2L4MaetFmFzpGOr5INVXkW1l OPDE86O4tlbAv8nxqbgeYiyjk5J/eANjjZGZFVF2d8hvrOJlhDML7Ak1/9mOTx/GEoEC A41jy9hoRTPht6HY0KLCUoeUSwHSvEBqOnce8jbX57vDpAJmj3O6Kww7oTfP4YFMSE8a BgrL4G9kPY1XyErVg2vOSFxWLp+n3k116r4es940NYS+aE+LvFZXINpN5Mev9lSFlWGW zTz9FZQVdfHh449UrD4AwrwpJtvbN6eC9MHADq+i79eMuoLn08QE5y3QS/tUyg3dKp7n eJGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WjiY6Fz2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si13808783otc.105.2020.01.16.15.25.13; Thu, 16 Jan 2020 15:25:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=WjiY6Fz2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387755AbgAPUW4 (ORCPT + 99 others); Thu, 16 Jan 2020 15:22:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:40262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733278AbgAPUWz (ORCPT ); Thu, 16 Jan 2020 15:22:55 -0500 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ABD922081E for ; Thu, 16 Jan 2020 20:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579206174; bh=AWTq77yPH1eJXFHw5c/ihwZ/W+ttmiGY+qYVIL2DNXo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WjiY6Fz2v1BRFwTw8CEV+ZGeTVwybGg7qEvOG+e6kceB8oCBxevUtjC+sxHFejHAw +oKShNXbfNSUG124nEjNg9pxFVCYhjNP142xTdOd2FqkhnrKlA/xPHMGsS+TxqWkRE U5OV05EgZIcNAZu83S6Cza9kPCZDXt9/fFQCjNYE= Received: by mail-wm1-f53.google.com with SMTP id p9so5156353wmc.2 for ; Thu, 16 Jan 2020 12:22:54 -0800 (PST) X-Gm-Message-State: APjAAAVz0yTMhsVFSlTyDrlUjQIAT0Pa65ponkGojZ9j9DzRFBO38Xy+ 2ObTdk4XnnLAhA1P3eflzNA5CR6bQqmtPDRULS3PMg== X-Received: by 2002:a05:600c:20c7:: with SMTP id y7mr802627wmm.21.1579206173156; Thu, 16 Jan 2020 12:22:53 -0800 (PST) MIME-Version: 1.0 References: <381e547dbb3c48fd39d6cf208033bba38ad048fb.1578934751.git.christophe.leroy@c-s.fr> <87ftghbpuu.fsf@nanos.tec.linutronix.de> <87k15rwuxm.fsf@nanos.tec.linutronix.de> In-Reply-To: <87k15rwuxm.fsf@nanos.tec.linutronix.de> From: Andy Lutomirski Date: Thu, 16 Jan 2020 12:22:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v3 08/12] lib: vdso: allow arches to provide vdso data pointer To: Thomas Gleixner Cc: Christophe Leroy , Andrew Lutomirski , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Vincenzo Frascino , X86 ML , linuxppc-dev , LKML , linux-arm-kernel , "open list:MIPS" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 2:35 AM Thomas Gleixner wrote: > > 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. > > FWIW, I did some experiments on x86 with gcc 9.2. gcc 9.2 uses rip-relative accesses if I simplify the config enough and otherwise materializes the pointer. Presumably it decides that the code size reduction is worth it if there are a lot of accesses. I suspect that tglx's suggestion will be fine or at worst will add negligible overhead on x86_64.