Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp600029img; Wed, 20 Mar 2019 07:10:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsOIa1VrwZ44RNrocDF6ge6b4pWvx9xm1eKVYWHPBDT3Ntb4JypXSnM7a4KrwoohaLcdMW X-Received: by 2002:a62:b618:: with SMTP id j24mr8026136pff.120.1553091031176; Wed, 20 Mar 2019 07:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553091031; cv=none; d=google.com; s=arc-20160816; b=wbqEeRApdPJg761GNnd3CdzETl4L1Iw8WNhW81x/fgIxHwSsipeFiaEHjktqoZzSC2 HVu9peSkU/sKB/h/xZ745UNil+bLZoGsXo+w7sBPytxqu7P08Qhj5O0fa4crlvdcOwcr HewTwfLzhkAbXhPdtTWwWuuhhaM1bJWhGxm/lHotAT9wpAZB18eGcepqLjxZOgjVCxV8 xvZMhZCdYWCBMzj3UHPnvoaOztm9aIMoC4ozZCQU4CWuUO4/Ov7vEL6kbOWAqMiJi9SP YDMKgiGJIDFRgA1O2Z+M3yZT26U6ydtleSoujH9Z3r0wrxN7unH+A/IK62o7tKU8hUQO 0whw== 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:dkim-filter; bh=ZpljRSfbGyTC2cPvq+XXud3imeukOcnalEgs+TCdt60=; b=uhTTUJuwrOZFJrri7d9eVOF3NrKWRpUH/xBmA9nTATbmDzohSCzoKuxENo2JiReBq1 Chb38W61UF96w/csjhHCKWcTs8MV3Yv9Wq2YbWI52hnl9n8UXduqtC6LQkQbpLqCuucC BPaOPVSBe34CtPIv6SAJinmo1Q1F/x4Xd1hkZSezIbPyiah21aLRiUo6Qxf3NlBdfr0M Gf7swt0xyS/GOnsYD7VIPelu8yl0Jao/71m9z+hiW5DBQKv4ShYt6KGKTuXzm+O+Goh8 SsNhKnuULqfYCIp14dWH/n5TyjdgvL6v15//hRcKA/rdQg9Xv23KnqjXJ/VSZWOPXHq1 Vi4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RnueoKjw; 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 j1si1725670pfa.138.2019.03.20.07.10.15; Wed, 20 Mar 2019 07:10:31 -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=@nifty.com header.s=dec2015msa header.b=RnueoKjw; 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 S1727426AbfCTOHG (ORCPT + 99 others); Wed, 20 Mar 2019 10:07:06 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:50348 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfCTOHG (ORCPT ); Wed, 20 Mar 2019 10:07:06 -0400 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) (authenticated) by conssluserg-06.nifty.com with ESMTP id x2KE6v9Z008986 for ; Wed, 20 Mar 2019 23:06:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x2KE6v9Z008986 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553090817; bh=ZpljRSfbGyTC2cPvq+XXud3imeukOcnalEgs+TCdt60=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RnueoKjwW5zEWXGUBWDDVvFrIK4vXQrVwc7sdqlOyrROLJyiA7ydZqCb5eZ0pf2Gk SFYy+jBwplUlSk3vIsO6fsLw3hTZ/6UNzB+P0BDZtq9Ll9l2ETKbzF/TgDVC6mdz+P H39MUJQ/JCyYlhyVG/L9jcdfqOS+EcToIQmwytPreT6DhnNJAQYJAtOk43Uok91agS tEhiP8AITTuX0iCC+if9QKaeQOMVZs1qN3rXPgKaJrP++tl82HdWcHqSPenlILFXAb ALqB6iVnHJrsU4rDbNQ53w16P8KS44PKuUougWNFR6aELwlkM0qYvlI/SoQL9u2XCv cUoT1HVcy72Mg== X-Nifty-SrcIP: [209.85.217.42] Received: by mail-vs1-f42.google.com with SMTP id z6so1566528vsc.0 for ; Wed, 20 Mar 2019 07:06:57 -0700 (PDT) X-Gm-Message-State: APjAAAUWRxeTM0zgrsI1o+04WAmuRboV2vh5nCUxDKE6mSmXTAkZRd5A bQiQ1bDoKWgKEgDG7a326s7jTywN/+B8WAI8FL8= X-Received: by 2002:a67:7c04:: with SMTP id x4mr4999206vsc.155.1553090816117; Wed, 20 Mar 2019 07:06:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Wed, 20 Mar 2019 23:06:20 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/vdso: include generic __lshrdi3 in 32-bit vDSO To: Nick Desaulniers Cc: Matthias Kaehlcke , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , X86 ML , LKML , Manoj Gupta , Tiancong Wang , Stephen Hines , clang-built-linux@googlegroups.com 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 Sat, Mar 16, 2019 at 6:32 AM Nick Desaulniers wrote: > > On Fri, Mar 15, 2019 at 12:54 PM Matthias Kaehlcke wrote: > > > > Building the 32-bit vDSO with a recent clang version fails due > > to undefined symbols: > > > > arch/x86/entry/vdso/vdso32.so.dbg: undefined symbols found > > > > The undefined symbol in this case is __lshrdi3, which is part of > > the compiler runtime library, however the vDSO isn't linked against > > this library. > > > > Include the kernel version of __lshrdi3 in the 32-bit vDSO build. > > __lshrdi3 is used for "logical shift right double-word by int" (best > guess), so anywhere there's a right shift of a u64. Looks like > there's a few of these in arch/x86/entry/vdso/, so it's legal for the > compiler to emit this libcall. Do you know which function > specifically in the .so has a relocation referencing __lshrdi3 > specifically? > > Is there a config I can set to reproduce this, in order to help test? > > > > > Signed-off-by: Matthias Kaehlcke > > --- > > arch/x86/entry/vdso/Makefile | 7 ++++++- > > lib/lshrdi3.c | 4 +++- > > 2 files changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile > > index 5bfe2243a08f..7517cd87e10b 100644 > > --- a/arch/x86/entry/vdso/Makefile > > +++ b/arch/x86/entry/vdso/Makefile > > @@ -144,6 +144,7 @@ KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector) > > KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls) > > KBUILD_CFLAGS_32 += -fno-omit-frame-pointer > > KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING > > +KBUILD_CFLAGS_32 += -DBUILD_VDSO > > > > ifdef CONFIG_RETPOLINE > > ifneq ($(RETPOLINE_VDSO_CFLAGS),) > > @@ -153,12 +154,16 @@ endif > > > > $(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32) > > > > +$(obj)/vdso32/lshrdi3.o: $(srctree)/lib/lshrdi3.c FORCE > > + $(call if_changed_rule,cc_o_c) > > + Masahiro to help look at this part (I don't understand this part of kbuild). This is a copy from scripts/Makefile.build, which is globally used to compile %.c -> %.o -- Best Regards Masahiro Yamada