Received: by 10.213.65.68 with SMTP id h4csp585943imn; Sat, 17 Mar 2018 16:01:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELuBCLA7+uHyfwo6Oh0IJeXMg2G+MGs7j56R9ZhzU+xbRDWjnq3IFdOJnMz5BOgUxmyxufiF X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr6950656plc.403.1521327697800; Sat, 17 Mar 2018 16:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521327697; cv=none; d=google.com; s=arc-20160816; b=Xg/p3Ms2E0JC9Kv2iPtNzOCYAd7mYsX2yifSed7NS+n6ktOmut71OX2kzjeqlq4MH2 kINOtDT4k/bdviEnnJeawWl1kj6s863SxcaceUwA0mmIm44W/yhxzXE58YtcJ1sXWpXd iJ/o6qtUUnVZ1BkiJxUwXl1jsqddH8+M8cFcA17nDLzWdRFTUHJVFlMKmnTSm8+7cQ3h 3brjQ+qcZum+C2VJ4LCQ7BhGNl0iqt+tyZxkaqBbN6f3K3jK1g63g2BWJKWn3PM87cv3 Sfz8d7Jn2Oe3K03rY4W3ciMfUVs1er7A++bcZg7UrmdvFKt16whpEYhwC9nve81ZK4ot qZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=YdgcSDPT1iRW44d7KHTrKvlBb43gJYmFZM2kOhF8Hac=; b=L2ISbLqpPHEgE/KEmbcMQCCeOz5UtCpuQjauCzGMCH/gGaGjY9Ld7++KYNdx1aEtPM PUhDdVoB22F9qOzyOm3DkXG8Lg8uV/InuCr+Hap2EvYQmfKb/uAU8hmZOfwZfBscK0vI dAH3fl2gkrlTRs3MJ+w7RJz1i2a3Ljsk6gkN4wTSrDOkb5qOnTus5Wces+VrTzP6UVjL yVX3gPkMOgp2gMMRfqwi0kUjTt+Wr8X0dg1jib6jCsc+R0KPY9eosj+EHnxzEBKaGexd mZ9/26kj88/0ZwcuQfzNn0HDKVxGGDThShrgpLkkVipE9V80UEcS/4b1efRzwgCuUmZu nTjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@firstfloor.org header.s=mail header.b=hZXgtPLZ; 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 d69si7224320pgc.60.2018.03.17.16.01.22; Sat, 17 Mar 2018 16:01:37 -0700 (PDT) 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=@firstfloor.org header.s=mail header.b=hZXgtPLZ; 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 S1752948AbeCQXAY (ORCPT + 99 others); Sat, 17 Mar 2018 19:00:24 -0400 Received: from one.firstfloor.org ([193.170.194.197]:54514 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359AbeCQXAX (ORCPT ); Sat, 17 Mar 2018 19:00:23 -0400 Received: by one.firstfloor.org (Postfix, from userid 503) id 2E82986BAB; Sun, 18 Mar 2018 00:00:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firstfloor.org; s=mail; t=1521327621; bh=AkXiquLjWpx1to6HZvX4YDb7Nhxqpn+D4XsNNcuRbB4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hZXgtPLZ3Z7zeWWmPIyGIDnGOH+AzUHN8nTL3DG9/wPxz4Ek4G+OwmCq2r8playjg 4mCdp3z1D+4LpSGmx4Ns8nbAch+1+s5opaFmjm3PiJoFm9jnYrZ+GwLm6c2oGraDoE ZJy9wZdrFbcFefZurkT7OjFG+gKzyKFbGJjabgfA= Date: Sat, 17 Mar 2018 16:00:21 -0700 From: Andi Kleen To: jason.vas.dias@gmail.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, andi@firstfloor.org Subject: Re: [PATCH v4.16-rc5 2/2] x86/vdso: VDSO should handle clock_gettime(CLOCK_MONOTONIC_RAW) without syscall Message-ID: <20180317230020.ensccrtuajqgxsxa@two.firstfloor.org> References: <1521296974-12142-1-git-send-email-jason.vas.dias@gmail.com> <1521296974-12142-3-git-send-email-jason.vas.dias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521296974-12142-3-git-send-email-jason.vas.dias@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 17, 2018 at 02:29:34PM +0000, jason.vas.dias@gmail.com wrote: > This patch allows compilation to succeed with compilers that support -DRETPOLINE - > it was kindly contributed by H.J. Liu in GCC Bugzilla: 84908 : > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84908 > > Apparently the GCC retpoline implementation has a limitation that it cannot > handle switch statements with more than 5 clauses, which vclock_gettime.c's > __vdso_clock_gettime function now conts. That's quite a mischaracterization of the issue. gcc works as intended, but the kernel did not correctly supply a indirect call retpoline thunk to the vdso, and it just happened to work by accident with the old vdso. > > The automated test builds should now succeed with this patch. How about just adding the thunk function to the vdso object instead of this cheap hack? The other option would be to build vdso with inline thunks. But just disabling is completely the wrong action. -Andi > > > diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile > index 1943aeb..cb64e10 100644 > --- a/arch/x86/entry/vdso/Makefile > +++ b/arch/x86/entry/vdso/Makefile > @@ -76,7 +76,7 @@ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \ > -fno-omit-frame-pointer -foptimize-sibling-calls \ > -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO > > -$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) $(CFL) > +$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS) -DRETPOLINE,$(KBUILD_CFLAGS)) $(CFL) > > # > # vDSO code runs in userspace and -pg doesn't help with profiling anyway. > @@ -143,6 +143,7 @@ KBUILD_CFLAGS_32 := $(filter-out -mcmodel=kernel,$(KBUILD_CFLAGS_32)) > KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32)) > KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32)) > KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32)) > +KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS) -DRETPOLINE,$(KBUILD_CFLAGS_32)) > KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic > KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector) > KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls) >