Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4604398pja; Thu, 21 Nov 2019 22:41:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwKoPpgcGpG8bNVJEgVXkBbcYvJgOwUx3GCo0r1hpkkmGQPoCVxLVAo9Sk8r1io7jrTA7m7 X-Received: by 2002:adf:a1c5:: with SMTP id v5mr16579165wrv.62.1574404891525; Thu, 21 Nov 2019 22:41:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574404891; cv=none; d=google.com; s=arc-20160816; b=iBWIHAH5ogsZOjOx4uQ6AUqOfN7Kdy9kJZ45zBMvq3MX/12uzHun2uohVbuJDBr41x yEeidErQPKgwcsgXHsiWV9TwWLcyOXakX9cET8xCYZ1fACQw+viEXFi6AEBo6vIaMz0s /ikCQsz3S2ta5c6JAvdjmi+oypzaDcXLLf+UaQ+qbj5BxmBtDLAyG/lft/r11H34zxZX 3hF1+/xs/gP+IL3DOkN2cJ8oc6oYo4lna7kSg3EwH9RtbXjWKjrrjFtLQfj83K+SFutV z/n1hGhUdp7Yk0oj7lOzoLDOWd8JN0+/meqt72CGesYHbZX6vdIbXD+RgHF0JlBAcTkO /UDw== 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:dkim-signature; bh=O7/VgByh0kELL+hCDieOk0V4L3SfM21aebUVlLh2wuk=; b=b/8Zfj/hUVI5TZLFBxo+PaGcmnAQ1bJA4h2iEeGpuGE9TXC4b/DDDWjHP+HcZaBDp2 4LaLQQ44pkKnjBS3dYqSxNhZUkA21326GRqq84oDMzp4N6QJRBEUKi+PEzguzT2x2BGG V1hQ/3+YF/NNNfeulOkVW+jGRzvKF9AxvUE1NPoMDuGIAylntOjJ8KHuOmrZwg/srf3a dmhxyxhjuj0QwCcFXHqY+BfAbvXk5cI3waUUqBajo//nEyQ9qENFRp+yk0podbacrdwa /Lcy55vbuKLvcGe8wUw8rSWsx6ku6hqEF/OSEaP0lBMO8oufBXD4rcuQl0dlpUi95s3i d73Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=OBHi6fWU; 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 h37si2311739eda.249.2019.11.21.22.41.07; Thu, 21 Nov 2019 22:41:31 -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=@ellerman.id.au header.s=201909 header.b=OBHi6fWU; 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 S1726921AbfKVGjE (ORCPT + 99 others); Fri, 22 Nov 2019 01:39:04 -0500 Received: from ozlabs.org ([203.11.71.1]:55191 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfKVGjD (ORCPT ); Fri, 22 Nov 2019 01:39:03 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 47K6GD59YRz9sRX; Fri, 22 Nov 2019 17:39:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1574404741; bh=G+AmjtFXhWfePPRBroJHra92tzfQkUR5z1klVZslTXI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OBHi6fWUGgkscxnwYu3sN6qZEfYGLeISY44fRnyp9fQfgtwygzmI5pJNFi9DmBbRa TAAu9ao6Zdk6tZguYe4qLAlFyOJ98Cl6P6rmYd2EsUaarnuscoZoupMgyyx5UPyhVg /9Qvtp4hrEnSm+iLaJFe2QUplrOCy7Q/g9ygqhAnjcr7qedngrRoR0OltoFh1+XLcd BchX66YLkvr2etfENHQf5i4oT8O8yai7wap83o0iBk+kHq52GahIxq4iDauUOrskt1 8c5fdMm/QWoDraDUGkAdsIq+YVD3gqcWiOjd2tDInkpMe/T4WnapviOlHY8LpoLk3S HOudl8UcoMRVQ== From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v3 4/8] powerpc/vdso32: inline __get_datapage() In-Reply-To: <874kywbrjv.fsf@mpe.ellerman.id.au> References: <9c9fe32df8633e6ba8e670274dc3eef82a1b5a65.1572342582.git.christophe.leroy@c-s.fr> <874kywbrjv.fsf@mpe.ellerman.id.au> Date: Fri, 22 Nov 2019 17:38:57 +1100 Message-ID: <871ru0beke.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michael Ellerman writes: > Christophe Leroy writes: >> __get_datapage() is only a few instructions to retrieve the >> address of the page where the kernel stores data to the VDSO. >> >> By inlining this function into its users, a bl/blr pair and >> a mflr/mtlr pair is avoided, plus a few reg moves. >> >> The improvement is noticeable (about 55 nsec/call on an 8xx) >> >> vdsotest before the patch: >> gettimeofday: vdso: 731 nsec/call >> clock-gettime-realtime-coarse: vdso: 668 nsec/call >> clock-gettime-monotonic-coarse: vdso: 745 nsec/call >> >> vdsotest after the patch: >> gettimeofday: vdso: 677 nsec/call >> clock-gettime-realtime-coarse: vdso: 613 nsec/call >> clock-gettime-monotonic-coarse: vdso: 690 nsec/call >> >> Signed-off-by: Christophe Leroy > > This doesn't build with gcc 4.6.3: > > /linux/arch/powerpc/kernel/vdso32/gettimeofday.S: Assembler messages: > /linux/arch/powerpc/kernel/vdso32/gettimeofday.S:41: Error: unsupported relocation against __kernel_datapage_offset > /linux/arch/powerpc/kernel/vdso32/gettimeofday.S:86: Error: unsupported relocation against __kernel_datapage_offset > /linux/arch/powerpc/kernel/vdso32/gettimeofday.S:213: Error: unsupported relocation against __kernel_datapage_offset > /linux/arch/powerpc/kernel/vdso32/gettimeofday.S:247: Error: unsupported relocation against __kernel_datapage_offset > make[4]: *** [arch/powerpc/kernel/vdso32/gettimeofday.o] Error 1 Actually I guess it's binutils, which is v2.22 in this case. Needed this: diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h index 12785f72f17d..0048db347ddf 100644 --- a/arch/powerpc/include/asm/vdso_datapage.h +++ b/arch/powerpc/include/asm/vdso_datapage.h @@ -117,7 +117,7 @@ extern struct vdso_data *vdso_data; .macro get_datapage ptr, tmp bcl 20, 31, .+4 mflr \ptr - addi \ptr, \ptr, __kernel_datapage_offset - (.-4) + addi \ptr, \ptr, (__kernel_datapage_offset - (.-4))@l lwz \tmp, 0(\ptr) add \ptr, \tmp, \ptr .endm cheers