From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109524 invoked by alias); 3 Oct 2018 15:29:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 109507 invoked by uid 89); 3 Oct 2018 15:29:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,TRACKER_ID,UNPARSEABLE_RELAY autolearn=no version=3.3.2 spammy= X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Oct 2018 15:29:47 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w93FT7h7166849; Wed, 3 Oct 2018 15:29:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=bXQGM5MOvfp7s70vzAGGozvdkBWMJwlRDctSTiJCDz0=; b=AQ7g+os3Yo0i+Opu6/T1svkSJ/tdOKsjkifClhIG3KqeZXoTOCnrcSC2aisG4DA3vEY6 fuNrlld6hfaSbN2A8eYWtaJ8kox4YsfWzQYlfMviz0+xVqtJyDmUcS6XUdlTYmQenImz ui6sYl0nlVqPtLPC6Uyuut9AyVdULCC4swG4r3xqLy1kmtlyi6hwD5BLjPFj7Po/o0ti nFMU/REolEiigsz8ep8znKFIzCO8LdCbGSjHRn4++RGm4I6d8lE16ZU68bk8hgauOJKy Zq20deRxEU6r1miZIC/vv4kCuHNzaVqxF2mFfsrhZVfZaP2seyDVI4k26Q/mChzYc+ON OA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2mt1bq4src-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 03 Oct 2018 15:29:45 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w93FTiHV020733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Oct 2018 15:29:44 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w93FThPM000799; Wed, 3 Oct 2018 15:29:43 GMT Received: from dhcp-10-159-150-65.vpn.oracle.com (/10.159.150.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Oct 2018 15:29:43 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: GCC options for kernel live-patching (Was: Add a new option to control inlining only on static functions) From: Qing Zhao In-Reply-To: <20181003090457.GJ57692@kam.mff.cuni.cz> Date: Wed, 03 Oct 2018 16:00:00 -0000 Cc: =?utf-8?Q?Martin_Li=C5=A1ka?= , Martin Jambor , live-patching@vger.kernel.org, gcc Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180927085829.GJ61973@kam.mff.cuni.cz> <817E4C4A-F81B-4E09-9645-04E38A1B9E74@oracle.com> <5CB6BDBE-3F49-4BFE-AF10-5E8181C49181@oracle.com> <1a023bdc-28a6-eb41-b449-4d096f12064f@suse.cz> <048D9997-B7AF-444A-BF7E-79944DE8F174@oracle.com> <3E37D3A8-2D19-41C2-BA8A-8F0EFA1B4D5C@oracle.com> <10a54034-279b-a406-8466-55558effbf24@suse.cz> <20181003090457.GJ57692@kam.mff.cuni.cz> To: Jan Hubicka X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00181.txt.bz2 > On Oct 3, 2018, at 4:04 AM, Jan Hubicka wrote: >=20 >>=20 >> That was promised to be done by Honza Hubi=C4=8Dka. He's very skilled in= IPA optimizations and he's aware >> of optimizations that cause troubles for live-patching. >=20 > :) I am not sure how skilful I am, but here is what I arrived to. >=20 > We have transformations that are modeled as clonning, which are > - inlining (can't be disabled completely because of always inline, but = -fno-inline > does most of stuff) > - cloning (disabled via -fno-ipa-cp) > - ipa-sra (-fno-ipa-sra) > - splitting (-fno-partial-inlining) > These should play well with Martin's tracking code In addition to the above IPA transformations that cloned a routine, the fol= lowing RTL transformation will clone a routine, too: reorder-blocks-and-partition this optimization will create .cold routines based on profiling feedback. looks like that we also need to include this transformation into this categ= ory? >=20 > We propagate info about side effects of function: > - function attribute discovery (pure, const, nothrow, malloc) > Some of this can be disabled by -fno-ipa-pure-const, but not all > of it. Nothrow does not have flag but it is obviously not a concern > for C++ > - ipa-pta (disabled by default, -fno-ipa-pta) > - ipa-reference (list of accessed/modified global vars), disable by -fno= -ipa-refernece > - stack alignment requirements (no flag to disable) > - inter-procedural register allocation (-fno-ipa-ra) >=20 > We perform discovery of functions/variables with no address taken and > optimizations that are not valid otherwise such as duplicating them > or doing skipping them for alias analysis (no flag to disable) >=20 > Identical code folding merges function bodies that are semanticaly equiva= lent > and thus one can't patch one without patching another, -fno-ipa-icf >=20 > Unreachable code/variable removal may be concern too (no flag to disable) >=20 > Write only global variable discovery (no flag to dosable) >=20 > Visibility changes with -flto and/or -fwhole-program >=20 > We also have profile propagation (discovery of cuntions used only in cold= regions, > but that I guess is only performance issue not correctness) > No flag to disable are all the above analyzes guarded by AVAIL_INTERPOSABLE right now? If NOT, should they be guarded by AVAIL_INTERPOSABLE? Qing >=20 > Honza >=20 >>=20 >> Martin >>=20 >>>=20 >>> thanks. >>>=20 >>> Qing >>>=20 >>=20