Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3445649pxf; Mon, 15 Mar 2021 09:40:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRedZsMYQr4M5MLoR2gzmAOI1F+TPDyc5pWYL15LA1V4k03HqijZU54G1E+TQAQSwPqRaK X-Received: by 2002:a17:906:874f:: with SMTP id hj15mr24292068ejb.404.1615826449432; Mon, 15 Mar 2021 09:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615826449; cv=none; d=google.com; s=arc-20160816; b=aaZASIRhuadVuI4AoDocQ/uaBGEJWoZlgwGbmBDTDnrGQbNXt82ozjd8NEKWdqKI8Z 9dPi9ZvXEc1SLlKnsnsy8XWkEzDaqgzsYC0YlnWbsVoAZY8ANF2xcLwLKu851zVLnxIn 5Jb6H23NBTdiXFhPkEJJVbF9fpuoqU7I5nDzhNESKzlLIcuvl5i4B9twNRVMdTnfYoXv f4NSymOwshR3oAD+y5TNMZLdATId8bfnnjuCvwqVoQGF9fx5vsNbD6T1azV3ePlJvSJH YE7o2vt7xGOALofn1KDcYTev4kM5/LZ3LIFrAI3yGKaTTD5OQh9D78MKH7Terct1NrAv +hmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=YGDygMQsY4vtBjPl+8xwtlTrcYu+x2ffSDkzogOU5nY=; b=xDg7KUUS2RdKe2XAbMdmBjeg5U3JmY1LZ1CIPtxjtnRX4547nZwjXEJKOf6viILUtP 6DpQMuK6rDiW0Kl2s9nfQvudmbyDB6YCeF34y/M0GOZRrKsxi7Iam1qY225GtYSC/aPt qXb2eNe5Vg3kyi7he3Ek+G0oma7GCZkMCmlSUa6kS+kH75KOutCiMRRGnFABAKJAwnMT d2eIF0hASIHOY8X7py/tj17lt3JxEYCIDztIZ9198QgzCfwg69K80Uz3ayemLpRf2mzh DqDyHhMm+A636p62ZRg8JDogWkJwXHmzliaJAHBv/hiQNfzoIIiawFUf8Oln2Tfoh9Jr 0wBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si11425869ejx.30.2021.03.15.09.40.26; Mon, 15 Mar 2021 09:40:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234398AbhCOQjB convert rfc822-to-8bit (ORCPT + 99 others); Mon, 15 Mar 2021 12:39:01 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:57867 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233294AbhCOQi4 (ORCPT ); Mon, 15 Mar 2021 12:38:56 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-275-domXswKeOEeQ-pCojPyt9g-1; Mon, 15 Mar 2021 16:38:53 +0000 X-MC-Unique: domXswKeOEeQ-pCojPyt9g-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 Mar 2021 16:38:52 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.012; Mon, 15 Mar 2021 16:38:52 +0000 From: David Laight To: 'Rasmus Villemoes' , Segher Boessenkool , Christophe Leroy CC: "linuxppc-dev@lists.ozlabs.org" , "Paul Mackerras" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] powerpc/vdso32: Add missing _restgpr_31_x to fix build failure Thread-Topic: [PATCH] powerpc/vdso32: Add missing _restgpr_31_x to fix build failure Thread-Index: AQHXGbeqwOTgfnOElE2I7+OcNDHUgqqFPWMA Date: Mon, 15 Mar 2021 16:38:52 +0000 Message-ID: <14e2cfb8c3f141aaba8fe0fb2d8f1885@AcuMS.aculab.com> References: <20210312022940.GO29191@gate.crashing.org> <023afd0c-dc61-5891-5145-5bcdce8227be@prevas.dk> In-Reply-To: <023afd0c-dc61-5891-5145-5bcdce8227be@prevas.dk> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rasmus Villemoes > Sent: 15 March 2021 16:24 > > On 12/03/2021 03.29, Segher Boessenkool wrote: > > Hi! > > > > On Tue, Mar 09, 2021 at 06:19:30AM +0000, Christophe Leroy wrote: > >> With some defconfig including CONFIG_CC_OPTIMIZE_FOR_SIZE, > >> (for instance mvme5100_defconfig and ps3_defconfig), gcc 5 > >> generates a call to _restgpr_31_x. > > > >> I don't know if there is a way to tell GCC not to emit that call, because at the end we get more > instructions than needed. > > > > The function is required by the ABI, you need to have it. > > > > You get *fewer* insns statically, and that is what -Os is about: reduce > > the size of the binaries. > > Is there any reason to not just always build the vdso with -O2? It's one > page/one VMA either way, and the vdso is about making certain system > calls cheaper, so if unconditional -O2 could save a few cycles compared > to -Os, why not? (And if, as it seems, there's only one user within the > DSO of _restgpr_31_x, yes, the overall size of the .text segment > probably increases slightly). Sometimes -Os generates such horrid code you really never want to use it. A classic is on x86 where it replaces 'load register with byte constant' with 'push byte' 'pop register'. The code is actually smaller but the execution time is horrid. There are also cases where -O2 actually generates smaller code. Although you may need to disable loop unrolling (often dubious at best) and either force or disable some function inlining. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)