Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1536496imm; Wed, 23 May 2018 18:48:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrA2BiTeBf+APsuiHktIrAcUFEbmp8BJdsFgTAFGtaX9fKZmhIx6QR5feOPCehIFj+tM6kd X-Received: by 2002:a63:2783:: with SMTP id n125-v6mr4032551pgn.377.1527126518512; Wed, 23 May 2018 18:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527126518; cv=none; d=google.com; s=arc-20160816; b=Is/TgrCW+uzYTKGCydzydqR6L3TZw+sCsYBueOflR5CU917/Wl7DmF0l/kQ6/8FQ/X 70Ot7VQgFEpzB5xmeLXS79AGuqiKdnPR7R8S7Vhh8EIdkCppXrh+QJwu3+lSi+xTyGbm vnEyrlv9DtvpDdGy7tE3EzetvxxiHo1vLI+Iad6IqV39/eKrUlnCCnyoCLod7vT0EUYm 9ZD0T3aBCEoBPRijKKU4tyXGhferbMlBJ0dPVXjfC2DS0IKRde4WNjrjtObQHXlAX2Yg or3SBRruCFFoZ8Y9Q+C22DJkpFYKK+9D4ZsCw/BIp1Ajgr6Sz6plg6WBobsu0jNBYZfo CGEg== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=zDU0uHnOf9obsLaMZcEjz/+QvHP0pSp/PYvhaUq8JYM=; b=ZG1f35QU3UXrfMsODa5/J/vY/gzsQ/AJgelvty7wfSRI9aUuWrF0j+yFGf+hFO3RLu n1f2arY9bsOu9PAxt8A+jIOneDSaLNUrTvouHsH3aszq0zZ4iLC/bJbabbT8XVmSF8ew d1XGMPpSr0Y334jSdTCzRNMwIHRLOdbw+AgFJbMbu88CcPp0BFEE1B+tS49BymNMQSLh c0p+9/pPWkhUk8FYyG90D/1F/bGjHKzVo0kcQfHMDc6Jsqi7ecosSjG0A8RDMtdHjZZp AX3xZDPbao+NmO73nMSi3tezOHY3FeAhmKD6KBgQ5jXczIZYS/6Tk3BJzcM9NrZVEzo8 /Qhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gpZ+HN0x; 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 s12-v6si16409018pgn.194.2018.05.23.18.48.23; Wed, 23 May 2018 18:48:38 -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=gpZ+HN0x; 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 S935453AbeEXBo4 (ORCPT + 99 others); Wed, 23 May 2018 21:44:56 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:27450 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935287AbeEXBow (ORCPT ); Wed, 23 May 2018 21:44:52 -0400 Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com [209.85.217.181]) (authenticated) by conssluserg-02.nifty.com with ESMTP id w4O1ia4H029195; Thu, 24 May 2018 10:44:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com w4O1ia4H029195 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527126276; bh=zDU0uHnOf9obsLaMZcEjz/+QvHP0pSp/PYvhaUq8JYM=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=gpZ+HN0xoIJ3yB3u2BtZGkxk1HKleL/rbo6JIh2O1lSgsKoVM+85otQQhiCM5bRpV OtEZkRZlhacrW0LcPMbFUpRtuYACo8IwLXVO6B1B8icF/QSMnmbS/EEhfRSN9IB3mJ H0Ao/dmWhErw71W0UwdsWUp1XP5GEAqwPZU0ZyUZ4H2rhjJD67ZuqKBCsJT9rozTAo 1zwkawXCPW1apW/DdpGHPUO81rrteg073cCfTUbF/HxB4o7JuzzmZYg6PFVu/Zwlmq ZPnhghDWEdLtu9vHSX+P5hLzHtXrcIw6gtK5bpitH5nXPM3yCzEImd8ZbCn1x/7ENH FEg/Ur1T2duMw== X-Nifty-SrcIP: [209.85.217.181] Received: by mail-ua0-f181.google.com with SMTP id a2-v6so19476uak.2; Wed, 23 May 2018 18:44:36 -0700 (PDT) X-Gm-Message-State: ALKqPwdAsfa5H7X3AfhsUkRLHZ7GRYCpHK0yC8bgQE37EyoyMeFU8lE4 7aMsUwL+yctKnbtpWOjv2jak/3Z9EFiZgZDPJEM= X-Received: by 2002:ab0:1592:: with SMTP id i18-v6mr3558930uae.199.1527126275497; Wed, 23 May 2018 18:44:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:55d8:0:0:0:0:0 with HTTP; Wed, 23 May 2018 18:43:55 -0700 (PDT) In-Reply-To: References: <20180523001939.9431-1-labbott@redhat.com> <20180523001939.9431-3-labbott@redhat.com> <15dcff14-ea1b-18c8-4cd1-06586cf6f05b@redhat.com> From: Masahiro Yamada Date: Thu, 24 May 2018 10:43:55 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv3 2/2] x86/vdso: Add build salt to the vDSO To: Laura Abbott Cc: Andy Lutomirski , Mark Wielaard , "H. J. Lu" , Linus Torvalds , X86 ML , LKML , Nick Clifton , Cary Coutant , Linux Kbuild mailing list 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 2018-05-24 9:11 GMT+09:00 Masahiro Yamada : > 2018-05-24 7:53 GMT+09:00 Laura Abbott : >> On 05/22/2018 05:33 PM, Andy Lutomirski wrote: >>> >>> On Tue, May 22, 2018 at 5:19 PM Laura Abbott wrote: >>> >>> >>>> The vDSO is linked separately from the kernel and modules. Ensure it >>>> picks >>>> up the comment section, if available. >>> >>> >>> Did you end up preferring this to just sticking the kernel version in a >>> .comment in the vDSO for some reason? >>> >> >> Actually I remember now why this is necessary: there is not a simple way >> to encode a string into a linker file as it has to be spit out byte >> by byte. The autogeneration was the easiest way to make that happen. >> Maybe there's some horrific c preprocessing or other generation that >> could happen but I doubt that's any worse than the generated linker >> script. >> > > > I am personally prefer CONFIG option (as you did in v2) to KERNELVERSION. > > > If you use "hex" type instead of "string" type in Kconfig, > and LONG() instead of BYTE() in the script script, > this can be much simpler, right? > > > > > > config BUILD_ID_SALT > hex "Build ID Salt" > help > ... > > > > > Then, in scripts/Makefile, > > > define filechk_build-salt.lds > { \ > echo "SECTIONS {"; \ > echo ".comment (INFO) : { LONG($(CONFIG_BUILD_ID_SALT)); }"; \ > echo "}"; \ > } > endef > > $(obj)/build-salt.lds: $(src)/Makefile FORCE > $(call filechk,build-salt.lds) > > > > > This is now so simple that we can even remove the shell script. I had not noticed the comments from Linus and Andy before I posted mine. Maybe, we should not add binary data into the .comment section. -- Best Regards Masahiro Yamada