Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp70753ybe; Thu, 12 Sep 2019 15:52:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpVMzMu2hxbwmYVcz24X1DynUDMDQUhoWm5rueCQCjkETJU/3649U2YiQxxNNcgGsPLBiP X-Received: by 2002:a17:906:81d9:: with SMTP id e25mr36600853ejx.37.1568328779243; Thu, 12 Sep 2019 15:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568328779; cv=none; d=google.com; s=arc-20160816; b=0/gxb3pQaD6pUp9Kaydr6gMEjw421kK1HEQKSHESL55+L7bCrXOz6ugDCMWW6dJ5Om rAFVfl0GyvDtIJudBm+GEwrTBTC7R92r9kXl1tk3/vf0Ep8is7LBNZ3nN6Jyb2/pWuIc 2UGPBp+IoHaR3Uqjf5qfYgz2cjYW3I5joetj3A1V12AdLw6TNdtBXRX6QZoXUjvoHEDp sZcgtBVK37iDH58Va9Sl2vKuLm6RO1mrozprDeYvDmI7REC5qhR1DIS2mAAO4fgP1veK GxI1TItgUiD+RaDeJLZfebrcF8G3aZuZEDO6b/IWADpk+lscQN6SE/sXH4Xsz8Kak3UQ MenQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a8kQob7T6P+OUxEnry9vx0BLrZwP8NcH/ZlQgT/hDMk=; b=lsyzPv8LegOWTm20zKnVVQJykGWaiNEM/Pi+k66OYdqgRhGhGv6k9R1kZr5mjiZGYY PPtjfBI0gZlPUC2Lw7omMYe1a+CZDK8QOiKl8QdRNeU3jm+89YqX/2LF2wC0JorGA4Tn n8zcVCRrvw1hfCEloB4g8ilwTn5H+yDOvFx2ItI3jiLLC6DyCEBpdFWJZiXfp5n1OoCM J88xQiiA1naU9fgdEGcw5l5vGIKTC8o8Fm0fJfbpW1QZDNwCav6g62qVrikbfjuM9vPZ OZbBpGVXB93YgOMdd9FbT4MhqA/ibKbt1qlaNo0POLl/0Dfe1ROkfDEtQlbHBaMa4/42 eRdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=I4M6Pxiq; 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 g22si16299448eda.27.2019.09.12.15.52.34; Thu, 12 Sep 2019 15:52:59 -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=@rasmusvillemoes.dk header.s=google header.b=I4M6Pxiq; 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 S1726841AbfILWTo (ORCPT + 99 others); Thu, 12 Sep 2019 18:19:44 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38235 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726164AbfILWTo (ORCPT ); Thu, 12 Sep 2019 18:19:44 -0400 Received: by mail-ed1-f68.google.com with SMTP id a23so23106408edv.5 for ; Thu, 12 Sep 2019 15:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a8kQob7T6P+OUxEnry9vx0BLrZwP8NcH/ZlQgT/hDMk=; b=I4M6PxiqSj1HzelMnxYmutuvJ5kNnOMJMwN4JtxlADE6wp03E89oojH9G5qCsvXET5 /DPknHEwnhhNNlbDBQejkpewwYZtHzEl5052vEPfSM/ZSxr1NHRzr66WBMqosUQ2i/EU EJpYwrVsCAydkPa/Tip2Z/36sNKB5Bsbe9gq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a8kQob7T6P+OUxEnry9vx0BLrZwP8NcH/ZlQgT/hDMk=; b=qP3wJTsTkwruMyUo6BT3P1L9q3BVWx9rmiIwyIXZ3NobrBWdgwu0lv3zjQyE8gsGW2 H9ZOlAPl70qVz+fX/5TekFXiTJAxGE0mLg9HV+FLF2hdYhd+4GqOCS1SNB4LBsC/S4kL X5ZsJD6XJ/WPZDyNX2bPL0s9R0pYBPucN8cofBCr6vGd7cKCxgxAGzP+Mj6A9P2b1HbG RB1AF7QbnQdYRS30GK7VXkJU7gzVpswB5t9LMasl8iIHJNqli/xelYO0yzAD0GPFn93C Qhcdr27xeJgJGkVwaSry5Y1XpqK6BdTnP3MQRUlu15T9A742rNc72q36SsbP6a7B5+qf lq1Q== X-Gm-Message-State: APjAAAUHurOyd1tKft8F2DzIU84Z8yVAaZCk0JelVE69s2Kr8d7zoo67 3Mx5pJoM8ob+JL9NuXxyxqqF9A== X-Received: by 2002:a50:c209:: with SMTP id n9mr44878590edf.215.1568326782473; Thu, 12 Sep 2019 15:19:42 -0700 (PDT) Received: from prevas-ravi.prevas.se (ip-5-186-115-35.cgn.fibianet.dk. [5.186.115.35]) by smtp.gmail.com with ESMTPSA id 36sm4305228edz.92.2019.09.12.15.19.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 15:19:41 -0700 (PDT) From: Rasmus Villemoes To: Miguel Ojeda , ndesaulniers@google.com, Masahiro Yamada Cc: Greg Kroah-Hartman , Ingo Molnar , Linus Torvalds , Nadav Amit , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Rasmus Villemoes Subject: [PATCH v3 0/6] make use of gcc 9's "asm inline()" Date: Fri, 13 Sep 2019 00:19:21 +0200 Message-Id: <20190912221927.18641-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830231527.22304-1-linux@rasmusvillemoes.dk> References: <20190830231527.22304-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc 9+ (and gcc 8.3, 7.5) provides a way to override the otherwise crude heuristic that gcc uses to estimate the size of the code represented by an asm() statement. From the gcc docs If you use 'asm inline' instead of just 'asm', then for inlining purposes the size of the asm is taken as the minimum size, ignoring how many instructions GCC thinks it is. For compatibility with older compilers, we obviously want a #if [understands asm inline] #define asm_inline asm inline #else #define asm_inline asm #endif But since we #define the identifier inline to attach some attributes, we have to use an alternate spelling of that keyword. gcc provides both __inline__ and __inline, and we currently #define both to inline, so they all have the same semantics. We have to free up one of __inline__ and __inline, and the latter is by far the easiest. The two x86 changes cause smaller code gen differences than I'd expect, but I think we do want the asm_inline thing available sooner or later, so this is just to get the ball rolling. Changes since v1: __inline instead of __inline__, making the diffstat 400 lines smaller. Changes since v2: Check support of "asm inline" in Kconfig rather than based on gcc version, since the feature was backported to gcc 7.x and gcc 8.x. That also automatically enables it if and when Clang grows support, though that compiler apparently does not have the same problems with overestimating sizes of asm()s that gcc has. Patch 1 has already been picked up by Greg in staging-next, it's included here for completeness. I don't know how to route the rest, or if they should simply wait for 5.5 given how close we are to the merge window for 5.4. Rasmus Villemoes (6): staging: rtl8723bs: replace __inline by inline lib/zstd/mem.h: replace __inline by inline compiler_types.h: don't #define __inline compiler-types.h: add asm_inline definition x86: alternative.h: use asm_inline for all alternative variants x86: bug.h: use asm_inline in _BUG_FLAGS definitions arch/x86/include/asm/alternative.h | 14 +++++++------- arch/x86/include/asm/bug.h | 4 ++-- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++-- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723bs/include/drv_types.h | 6 +++--- .../staging/rtl8723bs/include/osdep_service.h | 10 +++++----- .../rtl8723bs/include/osdep_service_linux.h | 14 +++++++------- drivers/staging/rtl8723bs/include/rtw_mlme.h | 14 +++++++------- drivers/staging/rtl8723bs/include/rtw_recv.h | 16 ++++++++-------- drivers/staging/rtl8723bs/include/sta_info.h | 2 +- drivers/staging/rtl8723bs/include/wifi.h | 14 +++++++------- drivers/staging/rtl8723bs/include/wlan_bssdef.h | 2 +- include/linux/compiler_types.h | 17 ++++++++++++++++- init/Kconfig | 3 +++ lib/zstd/mem.h | 2 +- 15 files changed, 71 insertions(+), 53 deletions(-) -- 2.20.1