Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5050335ybl; Tue, 14 Jan 2020 02:39:07 -0800 (PST) X-Google-Smtp-Source: APXvYqz4ffb6k0VR2zKD7rcZQmlgzR1VBSWOv/hYlAc1+dxlavXdYs6xMo+xMbSNpYIayC8VhxCJ X-Received: by 2002:a05:6830:108a:: with SMTP id y10mr16526128oto.81.1578998347302; Tue, 14 Jan 2020 02:39:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578998347; cv=none; d=google.com; s=arc-20160816; b=DO6fV5MiF2lKUOv8ySbXrdj875IuIZakkJ6txsyS8jiAVWpezqQlF1pnl0MB82O9/m 78p5AIyRvTP3MtNAXI4Iz0feGbyzx1NRhWJP5W7ZwiU5gHQ50nIgmywIuLLVEwfDRalR mu5SOUyAIgrP7dMFhza2TuIVkzIzWeNyVd2MRsLKo6XpiFgvzjQV8K/Cm7nDxww3ln9S /bZfOgOiLsmzwvsOzV/BTUWGlCZmgAZxZkMTerg5BEOrkOdnwYqLSjmjdgzRayNPGs5I F+G3jgsape1+aPce4wcihbOeX6fu5dUTpmDWlRxnhzm6iMXi28PRb+NJVEV6OoBfd5Gq 1STQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=BG3bSnKSA7CAUvOFPSN9/PuSqdifHJDmfvCJgkh3atQ=; b=VMacOmhlWG//nEGZDglXSKEGjPTj5/2oHuCB9BHGCgpK3uNJmv/lxFktKym96viFM3 3hpu5bQ2FGddjpfC+T89h6FDRBpHNWmiPeGDLcKHXBQElSptgsEbPflAeBaLi/fNP72O zfuNbSG+yqZyQXWQRW900C3VJeBKh2Tr22H9utxenmIqvHOc7/dABVGqlVUMaexBxd9d Z9HA6wRM4FWGGJ9ZVj/DPAABggOOVtCNOpbhg4ZN556jRKXfIoGv2yDOOkQDkLl54fGa qHy2gmx9mkYjHwUxb6v3aNlCLP63eFHQh29cTAKMuWHGhknKeaeL6HXef7MpCRxqxzab h7eA== 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 t23si8298057otk.304.2020.01.14.02.38.55; Tue, 14 Jan 2020 02:39:07 -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 S1729290AbgANKiG (ORCPT + 99 others); Tue, 14 Jan 2020 05:38:06 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:42469 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgANKiG (ORCPT ); Tue, 14 Jan 2020 05:38:06 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] 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 1irJaA-000077-9A; Tue, 14 Jan 2020 11:37:58 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 7A5D4101DEE; Tue, 14 Jan 2020 11:37:57 +0100 (CET) From: Thomas Gleixner To: Vincenzo Frascino , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, paul.burton@mips.com, salyzyn@android.com, 0x7f454c46@gmail.com, luto@kernel.org Subject: Re: [PATCH v2 2/8] lib: vdso: Build 32 bit specific functions in the right context In-Reply-To: References: <20190830135902.20861-1-vincenzo.frascino@arm.com> <20190830135902.20861-3-vincenzo.frascino@arm.com> <87tv4zq9dc.fsf@nanos.tec.linutronix.de> <87r202qt4x.fsf@nanos.tec.linutronix.de> Date: Tue, 14 Jan 2020 11:37:57 +0100 Message-ID: <87muaqqq62.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vincenzo Frascino writes: > > On 14/01/2020 09:33, Thomas Gleixner wrote: >> Thomas Gleixner writes: >> > [...] > >> >> Bah, it's not fixing it. That's what you get when you compile the wrong >> tree... This part is required to cover the BUILD_VDSO32 guard, but then when the fallback thing is removed it fails again because the 32bit fallbacks are missing. The patch below makes it build again. Thanks, tglx 8<---------------- --- a/arch/arm/include/asm/vdso/gettimeofday.h +++ b/arch/arm/include/asm/vdso/gettimeofday.h @@ -52,6 +52,24 @@ static __always_inline long clock_gettim return ret; } +static __always_inline long clock_gettime32_fallback( + clockid_t _clkid, + struct old_timespec32 *_ts) +{ + register struct old_timespec32 *ts asm("r1") = _ts; + register clockid_t clkid asm("r0") = _clkid; + register long ret asm ("r0"); + register long nr asm("r7") = __NR_clock_gettime; + + asm volatile( + " swi #0\n" + : "=r" (ret) + : "r" (clkid), "r" (ts), "r" (nr) + : "memory"); + + return ret; +} + static __always_inline int clock_getres_fallback( clockid_t _clkid, struct __kernel_timespec *_ts) @@ -63,6 +81,24 @@ static __always_inline int clock_getres_ asm volatile( " swi #0\n" + : "=r" (ret) + : "r" (clkid), "r" (ts), "r" (nr) + : "memory"); + + return ret; +} + +static __always_inline int clock_getres32_fallback( + clockid_t _clkid, + struct old_timespec32 *_ts) +{ + register struct old_timespec32 *ts asm("r1") = _ts; + register clockid_t clkid asm("r0") = _clkid; + register long ret asm ("r0"); + register long nr asm("r7") = __NR_clock_getres; + + asm volatile( + " swi #0\n" : "=r" (ret) : "r" (clkid), "r" (ts), "r" (nr) : "memory");