From patchwork Wed Jul 19 12:52:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108283 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780176qge; Wed, 19 Jul 2017 05:55:34 -0700 (PDT) X-Received: by 10.98.160.131 with SMTP id p3mr2821658pfl.236.1500468934681; Wed, 19 Jul 2017 05:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468934; cv=none; d=google.com; s=arc-20160816; b=R1mn2uQwNx2jSfjz9/1OCRYvsfq5SRmgW+q9XqnqXRb1o9NP5tWQCFPKKYenJndCss 8QCvg8pEmphwtx0IrW5Cy1z6BbB1KVwP+97AqlxSbNswIVfDaFRRVBXqSLzUoJWtaCJH JBZN1l2KynzpiSyGMM/a5ARHNfFCCqHYO6nhrkDWoNu/mOWkV9AqxpLa+Y/kOyycTlNY ciUtse0KvEsLve7W+nQMMPSY5FuZTMMw+E7A6JGUUPA0Q4sgmvEdGJItUuJkHAUZJcip z7MoBvFTqTa7mM/CHSw22cSFI3TtvxVspGCF8gm5cjDtQ6mHzR/i/0Z+n7ybcC/lwy1S NV4g== 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 :arc-authentication-results; bh=IXsy0a+7fhRTiM0tWpmMWokFzU2Wzh4gRPU+/S54y9Q=; b=wT8Z54FKq/p4CQ1sNuI9/oyvoQ419A7IWoZVBgRAFxY4z/ihdNj7iXIl/KPFr0sl8A yo52MMhpncebwjqUyButQ0NmimWwvgG37BIcBeaKJ6BZOANGct+UHPXCf7N1hW7lcpuJ 6doDaTsbK3nQrI2CWjcCEseyckLmhz8hUOArVqZa9PD77xmya4fDpE3ST4jgC85gB8e+ gYErrogZkK5MaEBkqOLuxiwOz8kJQNAnCJa+U0Aof8HUq2SwUjLHuDCe34g7FpU8BOxC NjrH5aEPali3cCJbfuE/0kPc0Oy3DXqTrOZRoaaj4ea/wwQeojzSoCBpi1ZaX/96hWt2 Ju/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 t136si205268pgc.742.2017.07.19.05.55.34; Wed, 19 Jul 2017 05:55:34 -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; 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 S1753804AbdGSMzb (ORCPT + 25 others); Wed, 19 Jul 2017 08:55:31 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:49821 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753740AbdGSMz1 (ORCPT ); Wed, 19 Jul 2017 08:55:27 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPGtM-1dcCCM0tsW-004PwK; Wed, 19 Jul 2017 14:53:50 +0200 From: Arnd Bergmann To: x86@kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Thomas Gleixner , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Alexander Shishkin , Andy Lutomirski , Josh Poimboeuf Subject: [PATCH 1/8] perf/x86: shut up false-positive -Wmaybe-uninitialized warning Date: Wed, 19 Jul 2017 14:52:59 +0200 Message-Id: <20170719125310.2487451-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:tBqGbSNp/372vv3mDfo1YevP9LtlvuALFs+8E+BPdaAACB4+4Q6 CC9KogGKYQfmqdhn04KHax7o4P8IgaODwR+BqIlk4J4BuIM66H23tWaWBhrvSy7oSdZ9WD5 FIzkYNP5INkubjTz6xgWj2ZSxHnQMvvcdb8YJjM8OU/XY3jj4g41D4C+GGAvscoEu7A7LBi bDQeD0htygVNq/2nrtiyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:FVR0qPjccaQ=:0fzd48w59xbqXlhviAhL8+ eI+D4DJREO/knbylIhrC1cP87nqPT1RJm4Xl7E5SKAnBk84siLUeSrO7msFPfycI629rg07M5 v3a+c/s752x7kjVZ3UEqnLLrOfwG1H/QWiC7n+yfQJrPvrH1uL1j3vfOTHPzOvRzBuw0/QrxC egi8dsW8aB2mbqiSH/r3lx5rvjqJ/4reim+sTBCQmj7t+3GcC1Im3zYk1n7darEcZDBQOdzB+ Yp1Gn4So4LwjmBOQU9/SUlX0o98uxCV257AdEzZVvuzONQVe7SAxSozQ5nbarUA5azcScTCH2 ElyvUCls5s4xlOy558jhLrqqf6fh0rrBcImzoTomJY/q8vd1Ftm+ftTSzZIEdFAaDhJYdcUQk N/O+o8ownOp0L8DbeX6oSaDBk86nRTb4Gw0y7M8fa2fiAOqWkGpEE8wy8OrYu7quUaah8JzhU ce/aLR3cvMTpLreLpqhbdXGLq4YRFju1qucchIci0kSONcGDEapKXAtqlIszd12Elmu3TTDJV DNUgQ+yJfdWwKGUsB8lJ+e2ct1n9cqFLlyE2vK6QI9LlPjMt6+48q8Xb6jqKet0sJf9vO5D1k qTayzHdGRd7Dayqh7my2MypiaYrpCQqoQORHj3YpBCb8sZJ08LTDNmWusTQOV/00SE9eOS+Og TxL7/gFtiR5ofp2gOxopbR1z6cNn7VrLDdWaPuVJD6VAnOn4Pn2xciQSOWZNZfLZiCwLO8uPj D+hOFpUjxecCUARig+X9Whny7hMcmHpCsInOEmOori+XnPSJ2kdXmgC1Dd8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The intialization function checks for various failure scenarios, but unfortunately the compiler gets a little confused about the possible combinations, leading to a false-positive build warning when -Wmaybe-uninitialized is set: arch/x86/events/core.c: In function ‘init_hw_perf_events’: arch/x86/events/core.c:264:3: warning: ‘reg_fail’ may be used uninitialized in this function [-Wmaybe-uninitialized] arch/x86/events/core.c:264:3: warning: ‘val_fail’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr_err(FW_BUG "the BIOS has corrupted hw-PMU resources (MSR %x is %Lx)\n", We can't actually run into this case, so this shuts up the warning by initializing the variables to a known-invalid state. Link: https://patchwork.kernel.org/patch/9392595/ Suggested-by: Peter Zijlstra Signed-off-by: Arnd Bergmann --- v2: replaced original patch that reordered the code instead of adding a fake initialization. --- arch/x86/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index ff1ea2fb9705..8e3db8f642a7 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -191,8 +191,8 @@ static void release_pmc_hardware(void) {} static bool check_hw_exists(void) { - u64 val, val_fail, val_new= ~0; - int i, reg, reg_fail, ret = 0; + u64 val, val_fail = -1, val_new= ~0; + int i, reg, reg_fail = -1, ret = 0; int bios_fail = 0; int reg_safe = -1; From patchwork Wed Jul 19 12:53:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108280 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp779984qge; Wed, 19 Jul 2017 05:55:21 -0700 (PDT) X-Received: by 10.99.113.77 with SMTP id b13mr2829234pgn.11.1500468921265; Wed, 19 Jul 2017 05:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468921; cv=none; d=google.com; s=arc-20160816; b=KGxYWMg6w00YZVJjzZImNIZqDgshNZ74ZVZhaORY0M4Sezu6h9gk9FI9OKY00dJr0z a5zcbIcQT2gltGR58jU868qKOr7yOgaMmp29hltfHNSpfrCiZppMqQkbobwVY/iky72n U9u+Qf5txHLESRHOjTGROyepUs7UBUpvHuPMb9yqfzpCDzFkC5H+SOzJ0HDwvCKJht/T 8jr8tWBEegiuRL47NTKdEvDNCm/xn0fDncTbV4ojd9/TH1enuDLZrWK1blY6GBqQJPJI M+5KnyTUrz2N8nzTVMWIrx9d+Dd/NviO+wDdlLUeEkU43eYDYsTCqUj3R97Qi3ctM8wr wg/g== 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 :arc-authentication-results; bh=InRXL1weIfampBktlI5tZ9eymOvN8Ycxkp/ZoTQ13U0=; b=XPq4+wOo81HISTL1sROr4kQgkNjU+VzWll8u74WCi49YskwXFbYB0qRE6MXKpcY3aF +047c1guVmGH7M+N58Vt+J7J0GI70qAW5U7ikaRAPBfHYyxslGvKk+ix31UkI1SZXMs+ Jq3ykXe7pbKYiqxVQ2br6AsgdIv0+wHdFo76YLkWP2ZMJdAMWbwdgK/R6P70ed39Ty3M XI7mjM8gWUQCG5i6EL55f/KvK7/QwAa0vUNIDH/qPkhqAHoVrnCyPqa5X8bcLCOFBQei 39K70uXs6gKOqFQHSq/H6U9+KB30GgfykvczAikZ/ShbHizr0/BEolioGgXamERi7OQM Splg== ARC-Authentication-Results: i=1; mx.google.com; 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 b6si198385pfg.676.2017.07.19.05.55.20; Wed, 19 Jul 2017 05:55:21 -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; 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 S1753513AbdGSMzR (ORCPT + 25 others); Wed, 19 Jul 2017 08:55:17 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:54552 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794AbdGSMzP (ORCPT ); Wed, 19 Jul 2017 08:55:15 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LsQ6y-1deWbI21Si-0122u4; Wed, 19 Jul 2017 14:54:08 +0200 From: Arnd Bergmann To: x86@kernel.org, Bill Metzenthen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 2/8] x86: math-emu: possible uninitialized variable use Date: Wed, 19 Jul 2017 14:53:00 +0200 Message-Id: <20170719125310.2487451-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:q1xu2hiXnYVBVfomHT7izp2P/3nwK6ccKAX/yqTE88eCvyTnaEt FEe4Ikp9HQd2T7eE25m0a/vUkZqOpsmySsIVhLYzMydH56C3vA3iWXXXCWZ1sogX4D4BNXP MHePfZR3R9CwqYYs8ycygvMzzrAo6UWjcYfkrrYcc13No0DGphwZ5W4Q502U+CVZh6HoLjL yFjJFVtf2fT2VaUrG84cw== X-UI-Out-Filterresults: notjunk:1; V01:K0:7BmvEqTNuuA=:qgJ3f9ZnztC4BAN4WO7iMZ pLteNWz7p6H6VNGohMqGu7EvEwOmAh7XegZ0GmJblqONznfwFr3CxgQSjZC+NJDBg+k9a1whg 4doUoWNjoYaXCgsVjapATyZiGSPr4DtrYieWIKzkd3YN4KQ4tArT3wGAsH2DcPYj9b+fQr2GD bxLxNMhh6VuKTBAQZCcZLOIggHWQ6OM1KSmxEp7xmfF5nbL/mdHIfnJDmDEDZoc5ARMyT2CDw KvVYfu4CN1tJZre6YoaJ0nigk8s27sxBJMRumuF+JNk9nhhhjEsdVehgrC8sJfxJoCRzqmFEr 4EU3ImctfXFYSoHq4XHflv3A+nx0ta5v9ZrNOiM0/QZO5hoan9Yjv4HJR7poduwnLAixLSgx0 yC4RJqhK+IzAnAc0adxZk7TAAxR5mKYbdxpRdI+Jcp5M8P6bN003sZbAiT1JtM++IcLzbOTLE 4oIV0mZA42rNZoZunoP8xbgTn0ZCVsyT/NyJ+IVsopo9wW6tvnTU4r+mpSOEVyOvjbG7QnQpI 9oqIJpdfz3c0yGcWqDFRwNGAPRFUf+4KSndTtdiDaI4voyU9VUxgWkK/PFmylfCh8CKaBeWJn K79tmME515AptEVm5c7+RuTpypSnnlTitNw8lK976txmY3WkLyW0nEmI5PL9TVoAjs0RyI1ht FyvcQxkNCZCYQpu/ZA6C5avF8ruetyQoMzdHEOjxZKHaHUJ8KeCiwP3a94/nc2m1u7tZTHGYj 8r/zr1vF+cjCK6pWGK2nIK/HPMQbrFtaEmTmgf2lNPoLgyOwHUowItySL18= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building the kernel with "make EXTRA_CFLAGS=...", this overrides the "PARANOID" preprocessor macro defined in arch/x86/math-emu/Makefile, and we run into a build warning: arch/x86/math-emu/reg_compare.c: In function ‘compare_i_st_st’: arch/x86/math-emu/reg_compare.c:254:6: error: ‘f’ may be used uninitialized in this function [-Werror=maybe-uninitialized] This fixes the implementation to work correctly even without the PARANOID flag, and also fixes the Makefile to not use the EXTRA_CFLAGS variable but instead use the ccflags-y variable in the Makefile that is meant for this purpose. Signed-off-by: Arnd Bergmann --- Originally sent on Oct. 17 2016, resending unmodified --- arch/x86/math-emu/Makefile | 4 ++-- arch/x86/math-emu/reg_compare.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) -- 2.9.0 diff --git a/arch/x86/math-emu/Makefile b/arch/x86/math-emu/Makefile index 9b0c63b60302..1b2dac174321 100644 --- a/arch/x86/math-emu/Makefile +++ b/arch/x86/math-emu/Makefile @@ -5,8 +5,8 @@ #DEBUG = -DDEBUGGING DEBUG = PARANOID = -DPARANOID -EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) -EXTRA_AFLAGS := $(PARANOID) +ccflags-y += $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) +asflags-y += $(PARANOID) # From 'C' language sources: C_OBJS =fpu_entry.o errors.o \ diff --git a/arch/x86/math-emu/reg_compare.c b/arch/x86/math-emu/reg_compare.c index b77360fdbf4a..19b33b50adfa 100644 --- a/arch/x86/math-emu/reg_compare.c +++ b/arch/x86/math-emu/reg_compare.c @@ -168,7 +168,7 @@ static int compare(FPU_REG const *b, int tagb) /* This function requires that st(0) is not empty */ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) { - int f = 0, c; + int f, c; c = compare(loaded_data, loaded_tag); @@ -189,12 +189,12 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) case COMP_No_Comp: f = SW_C3 | SW_C2 | SW_C0; break; -#ifdef PARANOID default: +#ifdef PARANOID EXCEPTION(EX_INTERNAL | 0x121); +#endif /* PARANOID */ f = SW_C3 | SW_C2 | SW_C0; break; -#endif /* PARANOID */ } setcc(f); if (c & COMP_Denormal) { @@ -205,7 +205,7 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) static int compare_st_st(int nr) { - int f = 0, c; + int f, c; FPU_REG *st_ptr; if (!NOT_EMPTY(0) || !NOT_EMPTY(nr)) { @@ -235,12 +235,12 @@ static int compare_st_st(int nr) case COMP_No_Comp: f = SW_C3 | SW_C2 | SW_C0; break; -#ifdef PARANOID default: +#ifdef PARANOID EXCEPTION(EX_INTERNAL | 0x122); +#endif /* PARANOID */ f = SW_C3 | SW_C2 | SW_C0; break; -#endif /* PARANOID */ } setcc(f); if (c & COMP_Denormal) { @@ -283,12 +283,12 @@ static int compare_i_st_st(int nr) case COMP_No_Comp: f = X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF; break; -#ifdef PARANOID default: +#ifdef PARANOID EXCEPTION(EX_INTERNAL | 0x122); +#endif /* PARANOID */ f = 0; break; -#endif /* PARANOID */ } FPU_EFLAGS = (FPU_EFLAGS & ~(X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF)) | f; if (c & COMP_Denormal) { From patchwork Wed Jul 19 12:53:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108282 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780091qge; Wed, 19 Jul 2017 05:55:27 -0700 (PDT) X-Received: by 10.98.202.214 with SMTP id y83mr3560pfk.2.1500468927344; Wed, 19 Jul 2017 05:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468927; cv=none; d=google.com; s=arc-20160816; b=Vh7iCf4Aw6Za08BPWmUvpvMIPaKsHpJ58jdHc4Hbx+rwncMzE3e6/XfUKFqNGYJ1ij CR38qxwP9AEUjehHcqNNnHtUvQzRIsOP40vUTE+WbYINPNwRJUaGqLJXijcduIOn5SOE PrhVnpuyrgONznre61BBK1UVsJ4ev69yrZEc/K5PgWhVG0JreA0+CKzEECdLOGGn1SIV 6gooH4Yc/tTr38RaNbqyQyI7SGWc9SQPZ4z3fgVR+Pdy2IlDwnZydioihDGyadwyjSyt c0rYwIJ5q2gZvmsxgF3NO+lHQG4MdKLqQ+r86GvuRuv4EO+nMgaX+KCKRgd9ckHBBo6N aoVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=xBTLw3C5/BX6gv3yEL0qGNzTphhZcowFF3f5RJ5Chho=; b=Nb9m1rf5PCrSvxzKUPWc861IUFc7FGjwaIQHcMo86+3jmmudITSlHCloYKTzZW0TEL Hq1xhQdTf/zvjUJslGkE6YMzs+FCuMdvVtoY4gsi0ydjVLvY+BDM3pdKxlChfn1lE53g fnDC8um4h0fnwNeKxc9hQBq4VcJQ15eLYqiamT31JMBZ1Bzwh/0bwXwi45pXdyDNIVB6 IS1zixiFH5S+nCuCDDj011ACcmHYVgojAYp2enMIlCdvn68426L2gXQRgeu4hjZuDilg 98STYmZbOW62k1kC0c45tCCzEqoCt5zQ8jTA+UQFVjAceIGgMnfDMA9BrW1gojmLiOCt 7pjA== ARC-Authentication-Results: i=1; mx.google.com; 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 e8si4270964pgf.411.2017.07.19.05.55.27; Wed, 19 Jul 2017 05:55:27 -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; 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 S1753712AbdGSMzY (ORCPT + 25 others); Wed, 19 Jul 2017 08:55:24 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:54098 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbdGSMzU (ORCPT ); Wed, 19 Jul 2017 08:55:20 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MMWH0-1dYLeb3If0-008HYg; Wed, 19 Jul 2017 14:54:15 +0200 From: Arnd Bergmann To: x86@kernel.org, Bill Metzenthen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 3/8] x86: math-emu: avoid bogus -Wint-in-bool-context warning Date: Wed, 19 Jul 2017 14:53:01 +0200 Message-Id: <20170719125310.2487451-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> X-Provags-ID: V03:K0:IZpaFaGRSoXV4oAsBe6k68n9Q3IvjbkYIGzqdY2Lj2MgR6R2R/R /RyssTDz3yIbWcmG4zg+1MWaZap+ttZahpskhwV4O5gb6PzxCtDFtknVezj+S/6HZDQ6+qv 1EyPNWwYno8l9F5c9gmyCOTFV6KtD0Ym6FlQcfYBRJb2MnEyXrfe+mHLpA/SyhKxl72LLs4 dRz6yr5hiPL2hRw0FD9Mg== X-UI-Out-Filterresults: notjunk:1; V01:K0:eYMDD0vCATQ=:p+3QhEDng10pvMCFZiasAj tnUQk0XIWA1qZ6ikcZ9UxLl+G4jLGR74Mr5nZJsLK0euaTF/4UWNgtyRpse19QDlL1o7D07LX QSjAW55envFp7vw+OZFH9r36qSoSy4IO3hc2w9eAqmKC25X59Bqmu535MLD9lBdGyJqFutJqZ bPcR6oSt88dnjCshe2aQyIMwbTn/AGRdJ1mgamPlgP8w9c1rHsIFttBPxZsWPsN+K9hJYRRlP HKdAm0eMonafsoQayFh/QSvK7xl10lVRoZjhLJS33O4L3U13Mh+/1hNu4KcK+YzJ4GyBtGnXI eggBkMd+dGc8FFgutgKEQN3axCGBkeWYLq11Cj6yr8O1lO61wuqctIG241zlFzrrDE+TZzQjC 9CU5HSNwms4NDbgMaGdNXgrii41GSJhh1EDpG9gtrxW24SW6fD3modWp1yFpUJDfnuNRFjMqV 99aeIWoSyPqtdx8dzM4JC+S2MRNcmmupgvmbsp7yujxAbG5WvxrN1QGhcvTKf38x+EJI7MLby ThOJY8UP9SQJZzLVeIc1z/OyUi2VNpef0XJObg/nALwED0CSN/mA36u4+ZBYVm5elLhihrdfX 4GTk8e6aLFUB+FD/eYH+YGTjeOBfhv5CR54v+NG5ff8EuyOhqFE15/7zn9sHN6gw7B+1ET2gY N5CNfkRTFmnQPIoM4e0WL5JeWlCSGDoKgh7DDh11GUC4g46/KoqxHr+Z4HkSfGWhL9UavMnwL W6kOLwwMr43ccK8N6MSuJ41PteVgOE2qELczvQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-7.1.1 produces this warning: arch/x86/math-emu/reg_add_sub.c: In function 'FPU_add': arch/x86/math-emu/reg_add_sub.c:80:48: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context] This appears to be a bug in gcc-7.1.1, and I have reported it as PR81484. The compiler suggests that code written as if (a & b ? c : d) is usually incorrect and should have been if (a & (b ? c : d)) However, in this case, we correctly write if ((a & b) ? c : d) and should not get a warning for it. This adds a dirty workaround for the problem, adding a comparison with zero inside of the macro. The warning is currently disabled in the kernel, so we may decide not to apply the patch, and instead wait for future gcc releases to fix the problem. On the other hand, it seems to be the only instance of this particular problem. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81484 Signed-off-by: Arnd Bergmann --- Originally sent on July 14, this is the same patch again with an rewritten changelog. --- arch/x86/math-emu/fpu_emu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/x86/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h index afbc4d805d66..c9c320dccca1 100644 --- a/arch/x86/math-emu/fpu_emu.h +++ b/arch/x86/math-emu/fpu_emu.h @@ -157,7 +157,7 @@ extern u_char const data_sizes_16[32]; #define signbyte(a) (((u_char *)(a))[9]) #define getsign(a) (signbyte(a) & 0x80) -#define setsign(a,b) { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } +#define setsign(a,b) { if ((b) != 0) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } #define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \ else signbyte(b) &= 0x7f; } #define changesign(a) { signbyte(a) ^= 0x80; } From patchwork Wed Jul 19 12:53:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108284 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780597qge; Wed, 19 Jul 2017 05:56:00 -0700 (PDT) X-Received: by 10.84.210.196 with SMTP id a62mr2945820pli.165.1500468959968; Wed, 19 Jul 2017 05:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468959; cv=none; d=google.com; s=arc-20160816; b=f3eyVHKnlRQnLb4AmdKmatC4m+M3Fbic7NqYqTZ312G7RSCEngJZn4lEwPXtP33GvM 0G8sy4xEdP7HSm0IP3xrRBzQx89a7z1lcXmOQpvbrggzxMmbqx579FKHV2FP6y27hokH K3nD64R3U3fSKSRVTo0Ax6faZEpBN9D/IM8t1NCASNGYcqDgkL3zFUTpJ4lOV+c504ga IV24Y6xdyjvu7derlPlZ9DqEu0vecXQe1O7zbm6bjry8xKWCxFh87TkG1ZnLrM2ggA/i fYj3VBTtRCy1farQxh/IJFqtFuw56KzxvF4zkBg2YHjNNORxuIHcE65Gf7YJ2eOd8rJA yelQ== 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 :arc-authentication-results; bh=uIgtXuUh0gr8NTcT1xO0ZJ/efuVqmJqclGE1RtRSUAY=; b=l95h1FMb+EQCPdnCLmxlUgaJNuAlMpl88cjdjtWbdBT7zEne9N6bKby6SfqVwQxML/ bASKDkR6SCkm2+XcQDiZE6N+pzm6ErRH2x+chOdFvTJu7UALrP+GSOFhq0IwCle1O1LF rLVjPvdA+M26DhrNxdnjaiI2pOQupGDmoyv43XXP+ghrAu3mEOsRCSCc/EclKCm2UAYM F8TLOKLkxecPfQf8zh1PP+Rz+3fD5PGlRxNcyQ9s1VYQHxoSwun3jDa+dFN2K4kPwr2a A+IyVGopYcl1MZQljl6dhUEUNTEn3YgGDjyMSYQPMKRw3xn3p0sQcETMYDYjyQSPB9LH Cxxg== ARC-Authentication-Results: i=1; mx.google.com; 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 z73si195343pfl.657.2017.07.19.05.55.59; Wed, 19 Jul 2017 05:55: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; 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 S1753959AbdGSMz4 (ORCPT + 25 others); Wed, 19 Jul 2017 08:55:56 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:50749 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753906AbdGSMzw (ORCPT ); Wed, 19 Jul 2017 08:55:52 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0ML81x-1dXXWA3uwj-000H4v; Wed, 19 Jul 2017 14:54:48 +0200 From: Arnd Bergmann To: x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Borislav Petkov , Tom Lendacky Subject: [PATCH 4/8] x86: io: add "memory" clobber to insb/insw/insl/outsb/outsw/outsl Date: Wed, 19 Jul 2017 14:53:02 +0200 Message-Id: <20170719125310.2487451-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:yEz02GrQ1NDRLU/SmQL+qhi2PiriwIo3dbrOrX7v6VfvQIlcs63 y63eoVWQkC0JmC4OgfasgfZGYJnjs5vLxlSVmdTRP+tU+LuT0i7Ej5IUk2LtGEhfIYFKzII Z9Xxrf6NQq198NDK5zg6GjJT4mBUtMx8jYXoNc3hgSTnC29G60xXz9mPCJ6W55c09jGHRNR OkiRgGQJ1fCvJ9p4aVjvQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:DCgrFFUjmT0=:1Tfc+4P+o1iEn5+aMdPJyj q9Zu5RqDIlUqieh6xRJmjNmvDKImh3ZzM46/sXoImJTmPwbdv6SopQEWt4lcOp4iO0vRbM8/B AGz10xXjYbYkPFtC4gk4xC3GbHveZjQXtWPtnQ0h2g3Zx8CoEeUvL6bmYMpZURNCXpTo8khWN JyqmRfG8+sZ9bgloOtT/4isi/druYcENFjnEMJipVrqRJKGyyXS8Ya13gQZebaYRtDP2ysGbK lhbq1NZ9d0uBFTwbt6/pqv0bcFMINoCl9iPyefggAcW6d7pO1zLiX9iSKyjTAsfsrd0m4uK4z IjPQXTmO5iG4l/VkcmDS5bNWcjTBYrO+5Yil6N5KwEtPuVeaROpKfDvBdPiqHRmOjBknsHsih F7AH79ypjTe2xUW6Y6QNJk8k+/XIai6PaNyhB7d5bQ3+MgWrLdzBYMETjsqhXQ1qn75iUM/LD +ujwN444LYoZagOVt0Sg7WoPomoFGHdpy8tx8k5YcxorcAd2Usw/oYX/apNEGFtuZksgM73Te 4PVir+YMuYuQAcIW4Rh+DaW8DZ43cm7CKI4OSzBteUtMb/7/LXstenr8FWtp7Aw7AoZ+9Kb4J zccvSAAekPP3CXFDJSmYsQRI0KkTDsgriqOyG5B80CqYLJLN9ujKHSEacYuDo/7z9vedFrsXu Npzg5GlHCDzFdlLYBBGLUB/6SgBzMugzpw8ObU9lm3XIPJ0U2Sm1h+uaQCJ/y1A867kEt4ZcD tfUBZMsAlu5tj4XSPc18pu5aO6dRKLfa58rw/nYQJZiY4ETJK+7S6nh/Q0k= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The x86 version of insb/insw/insl uses an inline assembly that does not have the target buffer listed as an output. This can confuse the compiler, leading it to think that a subsequent access of the buffer is uninitialized: drivers/net/wireless/wl3501_cs.c: In function ‘wl3501_mgmt_scan_confirm’: drivers/net/wireless/wl3501_cs.c:665:9: error: ‘sig.status’ is used uninitialized in this function [-Werror=uninitialized] drivers/net/wireless/wl3501_cs.c:668:12: error: ‘sig.cap_info’ may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/net/sb1000.c: In function 'sb1000_rx': drivers/net/sb1000.c:775:9: error: 'st[0]' is used uninitialized in this function [-Werror=uninitialized] drivers/net/sb1000.c:776:10: error: 'st[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/net/sb1000.c:784:11: error: 'st[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] I tried to mark the exact input buffer as an output here, but couldn't figure it out. As suggested by Linus, marking all memory as clobbered however is good enough too. For the outs operations, I also add the memory clobber, to force the input to be written to local variables. This is probably already guaranteed by the "asm volatile", but it can't hurt to do this for symmetry. Link: https://lkml.org/lkml/2017/7/12/605 Suggested-by: Linus Torvalds Signed-off-by: Arnd Bergmann --- v2: replace broken original RFC patch with one that probably works. The crazy stack usage I reported in teh wl3501_cs driver with my original patch is gone too now. --- arch/x86/include/asm/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index e080a39b2108..4bc6f459a8b6 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -328,13 +328,13 @@ static inline unsigned type in##bwl##_p(int port) \ static inline void outs##bwl(int port, const void *addr, unsigned long count) \ { \ asm volatile("rep; outs" #bwl \ - : "+S"(addr), "+c"(count) : "d"(port)); \ + : "+S"(addr), "+c"(count) : "d"(port) : "memory"); \ } \ \ static inline void ins##bwl(int port, void *addr, unsigned long count) \ { \ asm volatile("rep; ins" #bwl \ - : "+D"(addr), "+c"(count) : "d"(port)); \ + : "+D"(addr), "+c"(count) : "d"(port) : "memory"); \ } BUILDIO(b, b, char) From patchwork Wed Jul 19 12:53:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108285 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780726qge; Wed, 19 Jul 2017 05:56:07 -0700 (PDT) X-Received: by 10.99.119.76 with SMTP id s73mr540023pgc.374.1500468967256; Wed, 19 Jul 2017 05:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468967; cv=none; d=google.com; s=arc-20160816; b=Y7rThZbReiif28S8yVbyhraxmuQaBI95U5XXS5VG4P709vhoaI/iBj/EauGf43qpFe zAXYbXPZnnUGyr10WXGdYmyFy9NtxEIkwVwRMXAokXVxeJ8S3omnl9S3tksuUtfjwxnh aOIakFL/I47yaqtbIXYNsz1DTF5qG2chBcYShN4yWxYxmtPfaMdtttSyr1JeqrAADbq8 W+V/gYl6C/NJpOshixM9bxtNGt4Xx/Hx6aLccQdzQ6FCD09swfM4VbdydyEnetWiCJEY sxKOnxfINlrgktoqKU/XGGas0N0McZQmz9uzIFZzUueYe5jBMsbPOj8JDH1x7RGbbHtI 7mrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ZAhncNO2qa+rRTOn+zreXR1mRSMm51HC7GSJ/nX0WCE=; b=ngxdq7p9TcpMqzi21OOhIRCpfBy7pCAeTOUs0z4Uf55xTqWAI5xJ00GVUsDiGKVNBJ k48q10bwzSBCsrDz5Wt/5hNnwT/AqksAVS6m8VK/Yme2PAqvWEfIKslI3MlcrQJA+U3s 09voN2FPdv3XuKRdUV8B3IE+zmFbM9cdz2vPTkJgrhm6BoqNYAFiPYfjvyhow6fkzZ/S Jovcn8IaMYypmddMZVJQD1WaKUHzhrhUQDtYjVt19HnO/GkTdItBR45WWAIVKFJlrR8U uP5I6tWHzWb47GlTgHbh4kxtRo1MVpR2zbZ1RCdykQnBXlZvRl7P4XPEAO6sh9N4NZ07 L7oQ== ARC-Authentication-Results: i=1; mx.google.com; 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 z73si195343pfl.657.2017.07.19.05.56.06; Wed, 19 Jul 2017 05:56:07 -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; 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 S1753994AbdGSM4F (ORCPT + 25 others); Wed, 19 Jul 2017 08:56:05 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:65212 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753906AbdGSM4C (ORCPT ); Wed, 19 Jul 2017 08:56:02 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LoYV0-1e8mtC2L1O-00gVuo; Wed, 19 Jul 2017 14:55:00 +0200 From: Arnd Bergmann To: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Matt Fleming Subject: [PATCH 5/8] x86: silence build with "make -s" Date: Wed, 19 Jul 2017 14:53:03 +0200 Message-Id: <20170719125310.2487451-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> X-Provags-ID: V03:K0:uzb+PWGO8p2kmht8vaIb3RfCrrOYyJgQJJ1ODzXoUDA4Ifn0mwE PIOUGWGMlYfFyLqv6EKmvryoQxXOKgGF1RTFj0+InYIxO0ONuu6Vlf2M03cys4R4HtKJWlL DXvR1knX9ljtG480NH3hKqQS/0FToC1M+kQmTc9DlQCee5Ci1KJzWjcdD7kVI+LWPyohmJj BNTtPDGepyEf5D69Py4UA== X-UI-Out-Filterresults: notjunk:1; V01:K0:zDksyxqqaoc=:WDwqKTETk6bbVBFO0CbcK2 ZA+EAzi56k9QxA9O7h5ZU09zuBw7eFarveD/mqP75ToNaKtKZp4coa+KpaJEJB67c/rszPY7D gAmcXGjcgcLR1pLqSSUrhHIbAm+ybwxFCLrM9UPDefzUVESgOZbr+YOrRJeYlT/fA68JLaV8T pRID11XrNRagedzT3HEc87Et65epBkGndLamoV4Wq4hPrX0dNS1S0uLF/oXGmZd1clvbG4gaG iTypOgDjtd/z6DXfrsxzmNwcV6a+BLndWofaOgjNomXkOQ8cZuE+rJWMGT5fb3uo2pJ8CxTAP x3ru2gJ6W5+GH0m+kI331HcfxagdZdNFXsb3dZZL5cyggxJEUJpWTm7VQjBEm261vWbwFcV7X B4bQD8zqxJ96W9qxD33lrI2K9nUFcNni6bz9DM90wMYeAAxl2BpvzG5MEUSiqIt1fWF10KTXj lbOPaAL/dJSjQH7ZP95cHf5a9OW2ubHFq6cZZrnHzYJfzOkSHld8UH7KJoZU8dxCtdeO0piFV bKE7EKOM9pv3SWmvOt33tMFVB6btUq+87JJh4NHLVqGb7rf5IVbnJ4oFzT1Usz0gZitacdPux nZEakJLSxpNmFg73mgwMxtdIL1t7ZSi0CC07gKLEhrN6Rm827iznGRL8U13Sw7pzmM7m4ZaFW aVhVGX0kdxpcqbZ5cmq6ldBsU8EL/6bcX/QAdpLLm/MFg3bYHS0FzoEO7WweoeIQ7KtX3lFtj BaAfpvpbKWi/4ia5BoscxjCa5xRgKOEECoN52A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Every kernel build on x86 will result in some output: Setup is 13084 bytes (padded to 13312 bytes). System is 4833 kB CRC 6d35fa35 Kernel: arch/x86/boot/bzImage is ready (#2) This shuts it up, so that 'make -s' is truely silent as long as everything works. Building without '-s' should produce unchanged output. Signed-off-by: Arnd Bergmann --- arch/x86/boot/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 0d810fb15eac..d88a2fddba8c 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -73,12 +73,13 @@ UBSAN_SANITIZE := n $(obj)/bzImage: asflags-y := $(SVGA_MODE) quiet_cmd_image = BUILD $@ +silent_redirect_image = >/dev/null cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ - $(obj)/zoffset.h $@ + $(obj)/zoffset.h $@ $($(quiet)redirect_image) $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(call if_changed,image) - @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' + @$(kecho) 'Kernel: $@ is ready' ' (#'`cat .version`')' OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE From patchwork Wed Jul 19 12:53:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108286 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780983qge; Wed, 19 Jul 2017 05:56:22 -0700 (PDT) X-Received: by 10.99.151.17 with SMTP id n17mr2793378pge.157.1500468982299; Wed, 19 Jul 2017 05:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468982; cv=none; d=google.com; s=arc-20160816; b=PD+nBSorduVUYBVTE7O1KbAtSr5Ker8mehCJ2roecWg920X0dO5kyyUvRwdituAV8+ AjiDsY9rJHk2R3s1qax91ZRGnsQT7r3dr1HtiqRKerWQ5f3y5QVjYt8WPHPjJmxA7PF/ BGuDYwoKFJy/jSpa8Ur/U3NlojMUaki7sdHhhfu2hNU0BaA7fcQ/NPsPm5Yv4veHiopU l0Jil5qIWcnxahROXKls2v4r4LBtn+yqCnl3HCV3wI3KMllMek+jZiaq56/jKcDnSaHy OqFnfBZT7eQzN8+6ggwcqgcrE4BSE6PmIIpwBzEbsjnnTc9q96ZTINBZbsFQLuEuYeMh kdAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=euCLV3NUm6Y5h6FMM53Ind6/yHpqw+nKF0adSQ8U+Hc=; b=Y720+vrhO/rYIbNRlxpuSHHqOW9Qf1eeuzZGDtMnzCmCtkWHd5GRmF9zUJz09xk2Gw rIfS02UZUCCHR/QmLcsoKwdDUHx62jp7+2KbYjdm93UQaDSSn16NnEGuwuw04SonS4K/ vNGOo0xOB54VaYoxQ54EbTeq4Q12af/ALijp7fNUvWbKrkpXuC8DJ2T2sz1UrNFaJ28X vYkazeXbAANE2Kq9oFd4raaT+lVljyHSQOKMFanFih+3Ci72M5+WTNK6hddwLfsjgH5X 3TtBTt52fNOk09pCLPrDUFCwuSkwmDQRRJpwzaFGYPOn1QtsB8R5rcI68BzKQ81Nvbl6 UI+g== ARC-Authentication-Results: i=1; mx.google.com; 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 h4si184620pgc.783.2017.07.19.05.56.22; Wed, 19 Jul 2017 05:56:22 -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; 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 S1754022AbdGSM4T (ORCPT + 25 others); Wed, 19 Jul 2017 08:56:19 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:54728 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753382AbdGSM4Q (ORCPT ); Wed, 19 Jul 2017 08:56:16 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0M5Ovf-1dpk461oCt-00zYjb; Wed, 19 Jul 2017 14:55:13 +0200 From: Arnd Bergmann To: x86@kernel.org, Paolo Bonzini , =?utf-8?q?Radim_K?= =?utf-8?b?csSNbcOhxZk=?= , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Alex Williamson , kvm@vger.kernel.org Subject: [PATCH 6/8] x86: add MULTIUSER dependency for KVM Date: Wed, 19 Jul 2017 14:53:04 +0200 Message-Id: <20170719125310.2487451-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> X-Provags-ID: V03:K0:Vw1v9xIKLIkI60espjKF5Ilo6wLPA3phqE709RG57k+VOeBjg7Y 185GwaCbX5i6xH5LNuC2p79MDk+jJYtY4jskdRmSaMRS7xrqEfv/cws2oeQZ92z5ZvsWy7l 74/zZ5DJqT+KWlWGUSgBaDsasWH2MmLBvCiIWKgBwF4cpEdWfXRZxPl+4btFK8xDWDX4X5O GpvFdslGpWXoiRFr9t2Lw== X-UI-Out-Filterresults: notjunk:1; V01:K0:+V3vN8r1sy4=:KUqP2svh8KXagKf6vWqhFs rtXYvJ21xNwsSNCNjxv3VPxeGXLhaA+1c1UYQxFgr74RDfWZIqTbF16LaJ3VH5kPPS70RQvoO ZOjwpd1aWBNT5BkUp6/Ov3aDU8BNfsgF4pnGk+e4OqQErqNhVS6TRcN7NW2hn6H0FkGUCd+Fk ZBbr9s+Rl7R1g3br08gu85Z6odTUn8+1uAv/2ueSPdLG1+iXU05yWIUaNK1oTIQdKMroMKXxR ZoJDd/JpZrs0R1paS0cmCFGIYvGMe53t10UlqGWoXOYdpt0H6mxLgDU5UhSauHxlsBG0+Ikzg RsvVFL5LplUs9XEkU95d0GqWrXz7e+CbGmE9vggX0TCSPsuOSfgyjc3Xwj1O+FA7UsuhvXWtZ DmIqdqGzZXYOptV2EwlmZ+rXdk95Sn0jASBrvnIclFRkusiYG4bVTDXEIlYvrYDtvsBccuQKk 1sSbWsp6N+lDovTrCQBkSyTVjqCw/k08WxEUAnjnp1O7M18JYERAPH4ZYKkykkuiERGx7mWpB WR8sv6PKMtLE8UxYyw140A0jDVYMwtkqez+JEixjPp6/Sm7HbxfauoUL9tFxd/HDK8iyyQff5 A2Nh2F75qDIa5ox0tq8a5yGLN3hjDev6/bIOBCiEbXNKiFe1RPEWvnswzZAHIPkeBRUGkGICl iL+znlpZ0g0T3ePzxH0MTjDOgU8SjHBgaPshKu30554sV8TAh7usIA27x6ub56KE19qYjNr5a BxWSU8y5PWK/aJv31IHFT+Ta7p8LTZRhFTVtVw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KVM tries to select 'TASKSTATS', which had additional dependencies: warning: (KVM) selects TASKSTATS which has unmet direct dependencies (NET && MULTIUSER) Signed-off-by: Arnd Bergmann --- arch/x86/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 760433b2574a..2688c7dc5323 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -22,7 +22,7 @@ config KVM depends on HAVE_KVM depends on HIGH_RES_TIMERS # for TASKSTATS/TASK_DELAY_ACCT: - depends on NET + depends on NET && MULTIUSER select PREEMPT_NOTIFIERS select MMU_NOTIFIER select ANON_INODES From patchwork Wed Jul 19 12:53:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108287 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp781234qge; Wed, 19 Jul 2017 05:56:36 -0700 (PDT) X-Received: by 10.99.65.196 with SMTP id o187mr2832648pga.193.1500468996386; Wed, 19 Jul 2017 05:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468996; cv=none; d=google.com; s=arc-20160816; b=nkBN6mBp74KtN2qqUM5vqG+wWSvaX+R5YHrOD1+wU7vB0xowgTOOTJHsifzhRxzA9C 90JkuPS6T6B+JPaIDqbVALF5ApuMX9+AmPUMBPJPhANm4dghXVfqiIVytN5X4RjZLWtE 4IUZSCzoNU21KdQdfxxg7ciU4FAHvm4m1DyfmCCx1ViQMUoDhHtmtzmKlV7EhN3RKv2m 6NNSkG8vgUdbqcWtyCjZyjY96iOhyBhepit/r1VkwqFItQnl2vJyRjnwvDiDAixs2Hci ECwsLhmatCksSpcQ+6Wtfw/GcegZpKpxBQ/98FyMq/y4SWKIt7KYwb6qsfzqlVV6Sfyg QrLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=8rYmGgci5ueOQCtYx0uRw0z2qPXS+DDWkV6T/92pFqo=; b=AzqyYjjJvNBuhpqmjib51fRsrK4O+LX5HKpWfOC/A4eB1QX/KQAXMNi8lb1eV3aOx1 LJufBSRDneXVcbFNmTDs3OrU8cY7U1YH68A2cSCT5lWPe1xEc0MxUujuxtYTCZCT0E5N YebOY2vTQKJcY2z27cHN0bhCmS5bPOzXSKlqhXr8lvLqH2dUzMO+vrf6sn32tNL3Cr+C j5jdU8EbUvQhYsXsm1ZQHcymXtZfdEk6tsY2jY98sHCjh4UJ6IlcgNAYlY0sGt3yYZut KCza++G2AZYrW4eEFmCPHmcay3PqXyc2z71aCQepdD1C/kpYkH/beI6aX4UmeILjOte2 8mYg== ARC-Authentication-Results: i=1; mx.google.com; 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 h4si184620pgc.783.2017.07.19.05.56.36; Wed, 19 Jul 2017 05:56:36 -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; 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 S1754056AbdGSM4d (ORCPT + 25 others); Wed, 19 Jul 2017 08:56:33 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:63219 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753496AbdGSM43 (ORCPT ); Wed, 19 Jul 2017 08:56:29 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LnjYN-1e7PRA3ibH-00htMJ; Wed, 19 Jul 2017 14:55:28 +0200 From: Arnd Bergmann To: x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Kees Cook , Andy Lutomirski , Josh Poimboeuf Subject: [PATCH 7/8] x86: add PCI dependency for PUNIT_ATOM_DEBUG Date: Wed, 19 Jul 2017 14:53:05 +0200 Message-Id: <20170719125310.2487451-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> X-Provags-ID: V03:K0:7cNTeOwxIWv3gmRNWxu6Sj9+pbJUgIX+nZqMp3ak7i5JeCoO2BY y+MXNsQkfe8qGMS7xIsnwKZ7C/Sh2wVxusXgBAXTVpLZEzAkDelmtDyXWbdJPi6RInKupv8 Lzvu9mHgKNaepvfVSlUOhbYXC/8mnj0ZX9RCeXhI8afTvyhwI//WrYpWYgRTcfNIQNUgND4 nyqu3pxSvhDKl/27DNlhA== X-UI-Out-Filterresults: notjunk:1; V01:K0:lNzRRqStPmI=:Z5NGdWem4ar5GMY07Kf3oI dB/KdyvtSt7kyB4DqmOqokB2PiwbAP+7PS64IA/d8h7K3hfELGU6hjoivuesJpZpNMpoIS4XB sP+TW/QglrGZQ6RRILbl3fweviV7HYsVVKvVu5LVQwA8C0rTJYg1nTdr5vdiOA5Ez6hVHDG0a ndICKnx0FONAGSEPS5xp/mYjR88GGJ2Cv7kiIDYYysyLmDi2jKKYZPJRTj5ThS+uxmBjOJeLK JYDT5Up3Q2pfiBE1VS7kQ25Gd913oteyy5rd8b49Pyk0lXd/SYuMyNPpHMPeeDU7pcC88VTQA 2r4JAG4gU2Zb+AtwP9bT/Fa+ZaAkufila9eNrCrJds5UrVW5dfy7/f13VyVf/7Wv3msuFy5pu yqUipSKT9cPbkezlmifcm5sJTNfVeEg9c3eu/IxpjlBtOOmKCR1Iew1VpqLxPwLVoI7YQza1D BrK2oPzSQXQufekT22ucEc3Dn+gvAy5SRI5nyPQ3EEmpCSXIDRWllsnQS1GYThZ6gX59WN6EN i01mcwgnuf0TIAT/SMNQwEYyhJDPZTpdtMahnQVxh1KzW9zeZq0ziDZHfOMTTBXsjgjoVunht SkCRwB9ADswiYnLb3DotwAjqQnL1R4ygVC55QV1VLnW85iDJot2hXGIj8ZIs69X+KGTNytK39 CpDZincm7MeW5FFqmoGCWToBvSRS6HtXQmWS1c5/ngI0P2fwsrtknTiBjXl3KXPQFbuBTx9hs tJkhTC2CBsBXa/jpuY01nGu5wnhqs/4/hyqtqQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The IOSF_MBI option requires PCI support, without it we get a harmless Kconfig warning when it gets selected by PUNIT_ATOM_DEBUG: warning: (X86_INTEL_LPSS && SND_SST_IPC_ACPI && MMC_SDHCI_ACPI && PUNIT_ATOM_DEBUG) selects IOSF_MBI which has unmet direct dependencies (PCI) This adds another dependency to avoid the warning. Signed-off-by: Arnd Bergmann --- arch/x86/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 353ed09f5fba..1fc519f3c49e 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -346,6 +346,7 @@ config X86_DEBUG_FPU config PUNIT_ATOM_DEBUG tristate "ATOM Punit debug driver" + depends on PCI select DEBUG_FS select IOSF_MBI ---help--- From patchwork Wed Jul 19 12:53:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108288 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp781475qge; Wed, 19 Jul 2017 05:56:49 -0700 (PDT) X-Received: by 10.98.198.208 with SMTP id x77mr2824013pfk.229.1500469009221; Wed, 19 Jul 2017 05:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500469009; cv=none; d=google.com; s=arc-20160816; b=Ho22Wt1ZHl/uXvzkfAjF3Dq0e03ZOuZUE6VdjFUYpZAejtgX8/g8NXXKRaIzJ7qoFQ NQhRlpr+YGtJqrbOrup2u3dFkYzaayhw/6CNJsUlSg4oaDBYzSRFGQiXVt9L8TjChBRv Y4PqA4IqvfAOYwuvMv8RCZaEzg2dqu4Y6pWeIvo6aySPcEooJOObdKONO9dwG8ZpMxfN H+R9/bvoh8hrYX78U2Bwby9pnW/vZ3rVfk/18OMjKMqEKKx7LDbsGNciqlnkTCl2s5BL YRog6HnkV6bluAMBAhtzGB3z2YEWBpdnaNirwhJrsMTF8qUEz8gfvbRtnWwJskLXDWUh Xl+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XGBgN9psNBdeo95mxrPWZ0FBDqYQZzr81GQNXskuxqE=; b=rwQnlrYQcgmtNW6J6RnqAcDOPJr06rEOrkImqNU5H0LEq1uba8uGF9DS4I7fUUq8hf lSFH6baNBJcACVFEGcdppOYFSBfKkziAaL46SBlTPVR2HwFc1C/G5K2c/T8AKKEi6V6x ex7ZHy5BCy/xuQe6enFZ7nQ8no2kSPmXwg8W2Wj+RfOLas5exJy5BRKXFrmtu26nit8O F3B55k0hvspnlKORQ+D36TSENBeK4XSrbPTTEEXKYbzBBdGszTl3peHesGSBFSEkiYHo mpnQ2/mYIXlT6kTpnNaoFbY2YYEMgnCJVSaIIk5aneVLhOqDFBjvezyuUD/hef6JvA+J eYTA== ARC-Authentication-Results: i=1; mx.google.com; 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 v29si4191166pfl.262.2017.07.19.05.56.48; Wed, 19 Jul 2017 05:56:49 -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; 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 S1754154AbdGSM4r (ORCPT + 25 others); Wed, 19 Jul 2017 08:56:47 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:56950 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754068AbdGSM4h (ORCPT ); Wed, 19 Jul 2017 08:56:37 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MY6a0-1dBlOu3cKO-00Uv0G; Wed, 19 Jul 2017 14:55:40 +0200 From: Arnd Bergmann To: x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 8/8] x86: intel-mid: fix a format string overflow warning Date: Wed, 19 Jul 2017 14:53:06 +0200 Message-Id: <20170719125310.2487451-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> X-Provags-ID: V03:K0:tTrM3O40I/e2eKw10vBef2suLNIkZ9H4BjJyaYPLVLLD6VHrhL7 kWy+nIGbbv6omJkE/FSn7F3GjQ0HKuEuonyzVkU564gDZcHehhjhf3kv1ybP1ddQpBvzDvK Gb40UxF0hH0aTfZymdQJH8xOWI9UlUw9CuiBlcOwQSyPgKON5qyM2wBOYJdv5QsxHlNDlRt HafZ4yk91cXgUTDVPJCMg== X-UI-Out-Filterresults: notjunk:1; V01:K0:U56bpg4Wphw=:RAkBnlLkmeO8xj0T6dH2U8 cVNRNXXwq3bMmPUwSKxZDlX+wYcmdxXRh7hgPjf26g5H3gpHXu8o6blJs01szGzNb0up9cEes dH2RB7fqZgSCKsf5+Gv4NSpBjx8NPlgPC4VFCs35HdZC3e4VVmcKeoTgm9ModrGSHyW59a7n4 HJ9O6uOEeiSmAAPqct0jKDKbEnQIyutOsSrkodYwqJ67yr62ghOXZEuxRTEN6zKmxXleEC5TY ZbuTmySh+0HGsD/VWjAl5gJF7NQGV7UZ4qSqlQ0SmsdYEpSDWIqM45pvKvXB0kj4Lv8tq+0CJ FgSP5byHI+mlGmrNR2R6FXbMlggxfoUtcQxQlGHz3QDg5XgRUxC85YMHEvu5F1bT8t2pUL/jZ zyan3Ay3g3VdpMUzwm7Rb2o8d77lswNlKfOdru/Fi+77Yg3Ydf+xf8U1NpGYKZN6ynZ1bbTtF 1vrGHU3T6bZbkVTLqjJ2rmDmexGu0Keqi2AgwJ679V3/xo90fsxJDj3QmO9rMHDqNdE5tO85a o4mkC2Wd5Guk+/HzG9t/MVDXuvA+s2Syewt7ifZuNCRrKb6O5kz2LO9yjfMTAb2Kp2OWZGsjM DR06d8vI34gJjNOZqOyq2h47KB8Sa7yP8dXu4ozhJ+5RsjaK5UK3gBWN66ZURX/wHIImQ7Z24 +AHH2UlTqXdFlEb/XGvArxjvB6rPGZrUCvOkD/Ck3WiXE/bbioIqOsFW8+GmwVFlv/XgdtB1P jLBbH8cqA3erWvGBHMgKVfmu1ilUuIkIw+6myQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have space for exactly three characters for the index in "max7315_%d_base", but as gcc points out having more would cause an string overflow: arch/x86/platform/intel-mid/device_libs/platform_max7315.c: In function 'max7315_platform_data': arch/x86/platform/intel-mid/device_libs/platform_max7315.c:41:26: error: '%d' directive writing between 1 and 11 bytes into a region of size 9 [-Werror=format-overflow=] sprintf(base_pin_name, "max7315_%d_base", nr); ^~~~~~~~~~~~~~~~~ arch/x86/platform/intel-mid/device_libs/platform_max7315.c:41:26: note: directive argument in the range [-2147483647, 2147483647] arch/x86/platform/intel-mid/device_libs/platform_max7315.c:41:3: note: 'sprintf' output between 15 and 25 bytes into a destination of size 17 sprintf(base_pin_name, "max7315_%d_base", nr); This makes it use an snprintf() to truncate the string if that happened rather than overflowing the stack. In practice, this is safe, because there won't be a large number of max7315 devices in the systems, and both the format and the length are defined by the firmware interface. Signed-off-by: Arnd Bergmann --- Originally submitted on July 14, this is the same patch with slightly improved changelog. --- arch/x86/platform/intel-mid/device_libs/platform_max7315.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/x86/platform/intel-mid/device_libs/platform_max7315.c b/arch/x86/platform/intel-mid/device_libs/platform_max7315.c index 6e075afa7877..58337b2bc682 100644 --- a/arch/x86/platform/intel-mid/device_libs/platform_max7315.c +++ b/arch/x86/platform/intel-mid/device_libs/platform_max7315.c @@ -38,8 +38,10 @@ static void __init *max7315_platform_data(void *info) */ strcpy(i2c_info->type, "max7315"); if (nr++) { - sprintf(base_pin_name, "max7315_%d_base", nr); - sprintf(intr_pin_name, "max7315_%d_int", nr); + snprintf(base_pin_name, sizeof(base_pin_name), + "max7315_%d_base", nr); + snprintf(intr_pin_name, sizeof(intr_pin_name), + "max7315_%d_int", nr); } else { strcpy(base_pin_name, "max7315_base"); strcpy(intr_pin_name, "max7315_int");