From patchwork Fri May 5 11:57:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98628 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81139qge; Fri, 5 May 2017 04:58:09 -0700 (PDT) X-Received: by 10.99.123.21 with SMTP id w21mr2749699pgc.106.1493985489232; Fri, 05 May 2017 04:58:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.09; Fri, 05 May 2017 04:58:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751645AbdEEL6A (ORCPT + 6 others); Fri, 5 May 2017 07:58:00 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:61604 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753179AbdEEL56 (ORCPT ); Fri, 5 May 2017 07:57:58 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MFtVW-1dJFRU3r66-00ErUR; Fri, 05 May 2017 13:57:31 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Masahiro Yamada , Michal Marek , Arnd Bergmann Subject: [PATCH 1/9] [3.18-stable] kbuild: mergeconfig: fix "jobserver unavailable" warning Date: Fri, 5 May 2017 13:57:17 +0200 Message-Id: <20170505115725.1424772-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:5AypIINQiF4tlUmXtIhfQMFW92IYAwNdoGyED3/jkiDCF2cK6Eu uObGcbjVEX+qLqMFQcWtDWgv/7e98p94e7U5i1Hi7A5CUXrIUqGphv/9r4xjwCfPtVz/o9v J54/GXWxUHi3odi8m7F9h/ZC2s+QBXpudwXJ0vX7X7fBVhLhN5omKmJvXxGNggo5m8eUCuV g1H7pPi54VE00lRUO7mQQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:E+eDZGyhxV4=:4ak6KZ75UmtzLg3ZzSOEJp gdN+yf9ttQRY+/JDrQ4zbAtFtoyjrFLmtFOWZkA69QE5WoO/gRztTCqW3O7tJKr9ouKnemiwq FTb2KA/0687DY3WQmH2/rcBeQHR7tg4vLZEOQXRLbZzAhT3EJ0USLaC5q5lJu8oZYWa57dSbV 1Li38IwRQJFYFC0RKWuLcWySRY36sQEnJYPY5cbmVDAPU/Khq2MxstbPV4WDwNH/pogSMunZO L/7dpSojh81e860XhY8qKIaNAMTnyFYlzwdEC1kbP1DXLqhlCVuZObWrM3Ru4IWYbRcRHC1fW o4+TgErIawa0My527pSHfeDmQbYzuDa1FLZKosYgRGQRtbwajXio0bdwui0FG/sAd+t8Cc30i LnFOPLxoP8FzWOUakqw5pJbtvEUAYyqPY2bpe9lA22S0EybFz7atgNbBtbm2h80AVAKzT3SHa qbVFg1TzTHW3TzWxxYFjXQYWPOEwANWXGgYJbHpFBIXVbviYV3KBY9sHFdy4eYcm8zG8FMfnQ VHdV8VTn+tddiByDqdMehVPFE6Pbo+wdcM3+f1IdTo9KKkvWiEcb+RH273tL/oo6sIJwIIq4e aE26n9Qsr6S52WPXCb9TPJQouLAGjefOD2yMWMho9ZK+fr0rbH0pdxae/PLGBk91sEdyKVmiG Jx0Sx0nVq7LZs/LetfyEQ3A7xKAKq1I+msKvVDCoCwJMybPsTBH91bkLGUWPuZltC0bw= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada Commit f36963c9d3f6f415732710da3acdd8608a9fa0e5 upstream. If "make kvmconfig" is run with "-j" option, a warning message, "jobserver unavailable: using -j1. Add `+' to parent make rule.", is displayed. $ make -s defconfig *** Default configuration is based on 'x86_64_defconfig' # # configuration written to .config # $ make -j8 kvmconfig Using ./.config as base Merging ./arch/x86/configs/kvm_guest.config [ snip ] # # merged configuration written to ./.config (needs make) # make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. scripts/kconfig/conf --oldconfig Kconfig [ snip ] # # configuration written to .config # Signed-off-by: Masahiro Yamada Reviewed-by: Josh Triplett Reviewed-by: Darren Hart Signed-off-by: Michal Marek Signed-off-by: Arnd Bergmann --- scripts/kconfig/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 9645c0739386..fc34f46cb025 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -110,7 +110,7 @@ define mergeconfig $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target)) $(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture)) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1)) -$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig ++$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig endef PHONY += kvmconfig From patchwork Fri May 5 11:57:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98627 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81135qge; Fri, 5 May 2017 04:58:09 -0700 (PDT) X-Received: by 10.98.192.80 with SMTP id x77mr4361461pff.1.1493985488950; Fri, 05 May 2017 04:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1493985488; cv=none; d=google.com; s=arc-20160816; b=Suurte2W8G0eK+nvTBeI3Td3uSWP9DaLfVP0weJr49PSq4bskNic/UGXIIT2+aBaMg Wr+Xy1crUat4ZhdK/Sbv4MZu1eHqlKJg+dzxgriFn1hi8/Ce6C93GL/ooWKx5BktxtLn aK5X9lviQ/z3WN75GWYn2IdKVyDOS1kpah7IgUABVCAvO9DhqJIyniaH9FsyBFkvV4Ha CWMpULjlLahLyJA6Cu/zo3fzhj5r0LxdMsMh6Rr3T2sh1GlPjGqxjSQNwD4La+tHWTHi +Dfv+COwvvcmVkPDu6WBPwBlYLDcLWb2TM6hjO+5VyJ6+7Jpm7Urdlo7o9Q+xa+Bv3em LssA== 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=pJH3pmBEyytw2eKKZNxbZeTMWieQnNvbqP2ex498oEA=; b=z8UpGrDExpTsu6ink9fRjuIcZtz4IABiMai+u7x3brmqEkMxspdO58brdDhplrSlHC PowZ6X9JGObkIaTLAi6tnW4BkeuzEs1xpjpiCqA8ZveHasoIFJn6mtH9IXsgYowlfUDx htbRW5Fd6rVoV7tYbsWYqCupFGbDyqRyW/OTkA4JtX8UYMvfoXY1LsTdEt68rXNUTDT1 qe2XxOppF1NiVPj5wKUVcKkhSV5by9E630cxJzxRLkbu4J7VDoO+B92e/5OHcztfRlg9 HYOlwT1F+BxbaA00Q21GhS+nH54tbOBofh86h1WvNHoSleFfqTYJcX7VzsphsqR1nG2V Rhow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 m25si5435892pli.193.2017.05.05.04.58.08; Fri, 05 May 2017 04:58:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753263AbdEEL55 (ORCPT + 6 others); Fri, 5 May 2017 07:57:57 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:54515 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753179AbdEEL54 (ORCPT ); Fri, 5 May 2017 07:57:56 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MBCPl-1dEYTQ1YuL-00ACvY; Fri, 05 May 2017 13:57:33 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Paul Gortmaker , Rusty Russell , Arnd Bergmann Subject: [PATCH 2/9] [3.18-stable] modpost: expand pattern matching to support substring matches Date: Fri, 5 May 2017 13:57:18 +0200 Message-Id: <20170505115725.1424772-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:Kh8gp4HGOCDFtjqMZqwzAnNC0F4/aRgi4tXQ8gGQ4xQGqcAqkcq BpjVWqJD42aqZIxA1CsuHdg0rgxh6yF/p4SQM1enppVlCthlg4nbfCd58wZbH3WVGsAayuS jtBev4S9uudKO2vnFt5e283+P2U+Dc3tuY4o4tDtVxrGPenR5GWuzmBP9wta/evok8+Yk2a kBCZcWU7FwAdY65jBTZeQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Efnp/cREowo=:f5JnZTO1POqMLDz9zUyQoK wmLCGDBt8Z9yAJcT1ubVOF1bDEQqiA+fej7+gP0g833whmpVcV+0ZW49Y1poYKoILoKNud5Qe dZ+kFHBzzu0JYlKYRGC4u4OGRU7sNlkXeowMvoUUACwTS6YOSfOEzK4p+y59TEGeBgM3tKMLt KwogmpTCZbYpBYnYgEVU8WefJUFnh2KBn4qjhzaTrd/sM9nVAgvf3X/bwxEKOZkqBt9g+8pP/ vLWZ+u2nA8MU2YNqPJv7/WZtvAwGbWmv7qTnTqMu8D+BjPBlNC8UbfFfCcYJ8IeIHRTHAg4zG cwwyOXkZeym04WKFpaNQAC7Qy6dDptWkHLtuHFQ67aH5OQt6iUQ0iqYhYlcWJT3IOIpT7gc/P vbpAMhkhZlEKdpnvV7inS4VMyYGCJxmPzQvY4d02Zj8/QGiwA/6iOq5epQ1BTr/8CCm/XXIYH QJb2xQhSVhd6PTppbcqZbBCK8JhsF14iEp4Ka3ET+K1F5OBLSiGP/9vEGLZYt2y4GY5D6hehP ZGk760PiwRDsRxSnHqbKo9KfPDxkhCl2vLa0NaZPE9brx4tg0JyuSIaZNV4T7UFRbFJGry3zq GWO56gpnn06ND/U9JGxDq4qx45/x+uQefOjLBeeQLStNm1sYclq4iClohQ9DrsYMKNB7sOm0h Qk03QHwqwOIZByapSrHbmGmIE1wxR7F+ddvKU22LdHI/kUP8JSKMCMM+tqmWTsN5Xuss= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paul Gortmaker Commit 09c20c032b0f753969ae778d9783d946f054d7fe upstream. Currently the match() function supports a leading * to match any prefix and a trailing * to match any suffix. However there currently is not a combination of both that can be used to target matches of whole families of functions that share a common substring. Here we expand the *foo and foo* match to also support *foo* with the goal of targeting compiler generated symbol names that contain strings like ".constprop." and ".isra." Signed-off-by: Paul Gortmaker Signed-off-by: Rusty Russell Signed-off-by: Arnd Bergmann --- scripts/mod/modpost.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index d439856f8176..688b93cc06fe 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -776,6 +776,7 @@ static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr) * "foo" will match an exact string equal to "foo" * "*foo" will match a string that ends with "foo" * "foo*" will match a string that begins with "foo" + * "*foo*" will match a string that contains "foo" */ static int match(const char *sym, const char * const pat[]) { @@ -784,8 +785,17 @@ static int match(const char *sym, const char * const pat[]) p = *pat++; const char *endp = p + strlen(p) - 1; + /* "*foo*" */ + if (*p == '*' && *endp == '*') { + char *here, *bare = strndup(p + 1, strlen(p) - 2); + + here = strstr(sym, bare); + free(bare); + if (here != NULL) + return 1; + } /* "*foo" */ - if (*p == '*') { + else if (*p == '*') { if (strrcmp(sym, p + 1) == 0) return 1; } From patchwork Fri May 5 11:57:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98629 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81170qge; Fri, 5 May 2017 04:58:14 -0700 (PDT) X-Received: by 10.84.230.131 with SMTP id e3mr65704152plk.100.1493985494779; Fri, 05 May 2017 04:58:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.14; Fri, 05 May 2017 04:58:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752519AbdEEL6N (ORCPT + 6 others); Fri, 5 May 2017 07:58:13 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:54538 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753385AbdEEL6L (ORCPT ); Fri, 5 May 2017 07:58:11 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LzJrN-1eAvtM2lkX-014UJ2; Fri, 05 May 2017 13:57:33 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Paul Gortmaker , Rusty Russell , Arnd Bergmann Subject: [PATCH 3/9] [3.18-stable] modpost: don't emit section mismatch warnings for compiler optimizations Date: Fri, 5 May 2017 13:57:19 +0200 Message-Id: <20170505115725.1424772-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:8u2r1o5b+LJAyCrmCmMLBMU3SnJ0DAx/lk6GA9TNd4WrqKuQZ+4 8OlQ+EWvtRJnXiJln1geVQjgUzqlJy9c0WtMM/Wd4VzafXc7uiwrHQ1SDbSO5JaxXHQi5Xa sW5jsjvtVe3VHG66dCTGiX04JMkIcpeebLu/UOKB/HfUu5ZqDR3m7iszQCatRc2DvM7K/FZ piPILzfq9YtLr0ec43O5Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:ExjBIkRORvA=:DLgOffAHP1hc+04LDn2uPd GdqVo9Cn9hceyEvdhxke0gebDPmtM2o+jSV1FFgVVaGCZULTf1nVFH7JhsNbVZXNlvsNHFsUW XYBi74v/46bBwZTrVCBlg0JgLHfF4egAitL1w5Fd95lPFmN7BLYtllN31shc9pb27J6LDxNyD RpeZ8MWA3FBwX/300sX9UYWu+Z6C/lUJfqyvNKVRGBukwygZPOYFG60sam75xK80wePXVwtYq pYDQYsFMhcyapZwJOcZUFIm+dU5nlWC2iynmeeCItF0/6oY9ubi/ktgoGjMSzFNIWoh7kLlQ7 LsihBVRWWNSzFLt3tMzwFkHsd+2n4OiJSKxDfzKlAGCbdE+mvwHv5Ub31nrK1yhsxHYVUEKea e/dkSlFsuGZ59pUIQJdowHvkXze6KEdrryNWrQtBvFFTcYicBqVcA9pe6oQdn5HHYBCYmafnp RnacsIbAQMFU17Eu+YlwOMe9HoeWNV8G5A7ePV21DNQ8l9mGLcwOMk3PhR0TGjbmrchDFaKOm Io8xiraGQluRmNJJ+SU3BNAPmvaL0s895g5AVkJ34L9qDyeJhomBO2xRRrAXR83K7THzTwaFe TG3uwJft+gn2DcM6QNJTifaT7C6sozVjYuRVsaqwm2c3kFXKEhcN3V8SQu0eo48cnQLeVFVgf o9DsMpFVRiElF04ohtku/lscfT5QPOaA6CCz7msIDq8Rm28gldrNAiOzu1V2FKk9PkxM= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paul Gortmaker Commit 4a3893d069b788f3570c19c12d9e986e8e15870f upstream. Currently an allyesconfig build [gcc-4.9.1] can generate the following: WARNING: vmlinux.o(.text.unlikely+0x3864): Section mismatch in reference from the function cpumask_empty.constprop.3() to the variable .init.data:nmi_ipi_mask which comes from the cpumask_empty usage in arch/x86/kernel/nmi_selftest.c. Normally we would not see a symbol entry for cpumask_empty since it is: static inline bool cpumask_empty(const struct cpumask *srcp) however in this case, the variant of the symbol gets emitted when GCC does constant propagation optimization. Fix things up so that any locally optimized constprop variants don't warn when accessing variables that live in the __init sections. [arnd: adapted text_sections definition to 3.18] Signed-off-by: Paul Gortmaker Signed-off-by: Rusty Russell Signed-off-by: Arnd Bergmann --- scripts/mod/modpost.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- 2.9.0 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 688b93cc06fe..a8a54640ba5f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -902,6 +902,10 @@ static const char *const init_sections[] = { ALL_INIT_SECTIONS, NULL }; static const char *const init_exit_sections[] = {ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL }; +/* all text sections */ +static const char *const text_sections[] = { ALL_INIT_TEXT_SECTIONS, + ALL_EXIT_TEXT_SECTIONS, TEXT_SECTIONS, NULL }; + /* data section */ static const char *const data_sections[] = { DATA_SECTIONS, NULL }; @@ -920,6 +924,7 @@ static const char *const data_sections[] = { DATA_SECTIONS, NULL }; static const char *const head_sections[] = { ".head.text*", NULL }; static const char *const linker_symbols[] = { "__init_begin", "_sinittext", "_einittext", NULL }; +static const char *const optim_symbols[] = { "*.constprop.*", NULL }; enum mismatch { TEXT_TO_ANY_INIT, @@ -1077,6 +1082,17 @@ static const struct sectioncheck *section_mismatch( * This pattern is identified by * refsymname = __init_begin, _sinittext, _einittext * + * Pattern 5: + * GCC may optimize static inlines when fed constant arg(s) resulting + * in functions like cpumask_empty() -- generating an associated symbol + * cpumask_empty.constprop.3 that appears in the audit. If the const that + * is passed in comes from __init, like say nmi_ipi_mask, we get a + * meaningless section warning. May need to add isra symbols too... + * This pattern is identified by + * tosec = init section + * fromsec = text section + * refsymname = *.constprop.* + * **/ static int secref_whitelist(const struct sectioncheck *mismatch, const char *fromsec, const char *fromsym, @@ -1109,6 +1125,12 @@ static int secref_whitelist(const struct sectioncheck *mismatch, if (match(tosym, linker_symbols)) return 0; + /* Check for pattern 5 */ + if (match(fromsec, text_sections) && + match(tosec, init_sections) && + match(fromsym, optim_symbols)) + return 0; + return 1; } From patchwork Fri May 5 11:57:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98622 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81117qge; Fri, 5 May 2017 04:58:07 -0700 (PDT) X-Received: by 10.98.24.213 with SMTP id 204mr15857838pfy.237.1493985487589; Fri, 05 May 2017 04:58:07 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.07; Fri, 05 May 2017 04:58:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752752AbdEEL5u (ORCPT + 6 others); Fri, 5 May 2017 07:57:50 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:50634 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720AbdEEL5s (ORCPT ); Fri, 5 May 2017 07:57:48 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MI6Qg-1d3rEp3qM2-003uDD; Fri, 05 May 2017 13:57:34 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Rusty Russell , Arnd Bergmann Subject: [PATCH 4/9] [3.18-stable] cpumask_set_cpu_local_first => cpumask_local_spread, lament Date: Fri, 5 May 2017 13:57:20 +0200 Message-Id: <20170505115725.1424772-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:TYwXf2IMmkGLJZR1TOXKek94VOLqeuTgCiqiVH9/dsQRlGFg752 kBErIHR7UmAYJ5zj6cbnp1DiO9+TuPc7kRvDrYyVOU/D5ma5lMEciQh56joSX6D1atwiVYG KMgpu5rEVHLvfjxWKDVE40ZGbWwsCRRz/+NxE3UFmcite/V/nYSEpczjvOrHUbae6iiC4ht PXyIoAUMtALB45941Uleg== X-UI-Out-Filterresults: notjunk:1; V01:K0:I2aXgrag2o4=:RmzrWofwD+u4l66bFDAZ0d 7EF1kOFMVQeSOXtQGeow79+emymKTa1uDyE3ldUP4csdz3cG2m2TlktUXHiNHrnGG7KUGYHNe XhAB/0kTaEW8xeuXVKhQjNnUh42wElg/Bvlkt/6xgQlkmZr7nRn4KcuXLqGQTK5gkqWoSTzxX s+U53TR0446SNzYir8Rye9gb27s8SugoYFM/3P2W2FAcgpZ2EzQqVEP6jixyyepPaxGbIeEDs ZwcpK0I815O5suk73jhOyxeTLnpU7lr6JNcuD4BzlGKcURxqUDg4Iocg7ych59uedNZrGmJ5y KPYgFo4UECXRiJ/r5qSwrtNVI6WhUawOFxEWrwajT9k3Bm4V4R5VNZAg2vIoQGxmHKGnvT2ht KwVxPS4oUPx4+KMBZpsAZb/phJclA2X1jK2zaQ0DIx4mmnLRTXgOHxkoKyRZQQ74QoLmQYIME 9T5E48GUFXeaKT5+9W5dpJxpQj1kQ3ciizaRTcBYU8b1dNa7KCigYcuYAmE6WdN37u+snxoNC zB54WdupdrWVYK1R23BoGumonwY8GhfTasa9C8JuVhXzf0jusxqimDVvFCKoM0CgwykC+dJRB 3MZ5YBd2aSXDzRRdch4tsx3sUDDH+AZGLDe9Nw9+G1tdOr2jNGlaujg8msCb9tuHMcVrRk1W7 Xb/aJT8ESSS3Qx4ObTxuUx1BblgQzCOBPxLrR6g12iVd0F/4PVAVBKmvz/UX+orFYJMU= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rusty Russell Commit f36963c9d3f6f415732710da3acdd8608a9fa0e5 upstream. da91309e0a7e (cpumask: Utility function to set n'th cpu...) created a genuinely weird function. I never saw it before, it went through DaveM. (He only does this to make us other maintainers feel better about our own mistakes.) cpumask_set_cpu_local_first's purpose is say "I need to spread things across N online cpus, choose the ones on this numa node first"; you call it in a loop. It can fail. One of the two callers ignores this, the other aborts and fails the device open. It can fail in two ways: allocating the off-stack cpumask, or through a convoluted codepath which AFAICT can only occur if cpu_online_mask changes. Which shouldn't happen, because if cpu_online_mask can change while you call this, it could return a now-offline cpu anyway. It contains a nonsensical test "!cpumask_of_node(numa_node)". This was drawn to my attention by Geert, who said this causes a warning on Sparc. It sets a single bit in a cpumask instead of returning a cpu number, because that's what the callers want. It could be made more efficient by passing the previous cpu rather than an index, but that would be more invasive to the callers. [backporting for 3.18: only two callers exist, otherwise no change. The same warning shows up for "!cpumask_of_node()", and I thought about just addressing the warning, but using the whole fix seemed better in the end as one of the two callers also lacks the error handling] Fixes: da91309e0a7e8966d916a74cce42ed170fde06bf Signed-off-by: Rusty Russell (then rebased) Tested-by: Amir Vadai Acked-by: Amir Vadai Acked-by: David S. Miller Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 ++-- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 +-- include/linux/cpumask.h | 6 +-- lib/cpumask.c | 74 +++++++++----------------- 4 files changed, 34 insertions(+), 62 deletions(-) -- 2.9.0 diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 68fef1151dde..f31814293d3c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -1500,17 +1500,13 @@ static int mlx4_en_init_affinity_hint(struct mlx4_en_priv *priv, int ring_idx) { struct mlx4_en_rx_ring *ring = priv->rx_ring[ring_idx]; int numa_node = priv->mdev->dev->numa_node; - int ret = 0; if (!zalloc_cpumask_var(&ring->affinity_mask, GFP_KERNEL)) return -ENOMEM; - ret = cpumask_set_cpu_local_first(ring_idx, numa_node, - ring->affinity_mask); - if (ret) - free_cpumask_var(ring->affinity_mask); - - return ret; + cpumask_set_cpu(cpumask_local_spread(ring_idx, numa_node), + ring->affinity_mask); + return 0; } static void mlx4_en_free_affinity_hint(struct mlx4_en_priv *priv, int ring_idx) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index fdc592ac2529..9fc1dd7c5a0a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c @@ -139,9 +139,9 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, ring->queue_index = queue_index; if (queue_index < priv->num_tx_rings_p_up) - cpumask_set_cpu_local_first(queue_index, - priv->mdev->dev->numa_node, - &ring->affinity_mask); + cpumask_set_cpu(cpumask_local_spread(queue_index, + priv->mdev->dev->numa_node), + &ring->affinity_mask); *pring = ring; return 0; diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 0a9a6da21e74..bb1e42ce626e 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -142,10 +142,8 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask, return 1; } -static inline int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp) +static inline unsigned int cpumask_local_spread(unsigned int i, int node) { - set_bit(0, cpumask_bits(dstp)); - return 0; } @@ -199,7 +197,7 @@ static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp) int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *); int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); -int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp); +unsigned int cpumask_local_spread(unsigned int i, int node); /** * for_each_cpu - iterate over every cpu in a mask diff --git a/lib/cpumask.c b/lib/cpumask.c index b6513a9f2892..c0bd0df01e3d 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -166,64 +166,42 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask) #endif /** - * cpumask_set_cpu_local_first - set i'th cpu with local numa cpu's first - * + * cpumask_local_spread - select the i'th cpu with local numa cpu's first * @i: index number - * @numa_node: local numa_node - * @dstp: cpumask with the relevant cpu bit set according to the policy + * @node: local numa_node * - * This function sets the cpumask according to a numa aware policy. - * cpumask could be used as an affinity hint for the IRQ related to a - * queue. When the policy is to spread queues across cores - local cores - * first. + * This function selects an online CPU according to a numa aware policy; + * local cpus are returned first, followed by non-local ones, then it + * wraps around. * - * Returns 0 on success, -ENOMEM for no memory, and -EAGAIN when failed to set - * the cpu bit and need to re-call the function. + * It's not very efficient, but useful for setup. */ -int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp) +unsigned int cpumask_local_spread(unsigned int i, int node) { - cpumask_var_t mask; int cpu; - int ret = 0; - - if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) - return -ENOMEM; + /* Wrap: we always want a cpu. */ i %= num_online_cpus(); - if (numa_node == -1 || !cpumask_of_node(numa_node)) { - /* Use all online cpu's for non numa aware system */ - cpumask_copy(mask, cpu_online_mask); + if (node == -1) { + for_each_cpu(cpu, cpu_online_mask) + if (i-- == 0) + return cpu; } else { - int n; - - cpumask_and(mask, - cpumask_of_node(numa_node), cpu_online_mask); - - n = cpumask_weight(mask); - if (i >= n) { - i -= n; - - /* If index > number of local cpu's, mask out local - * cpu's - */ - cpumask_andnot(mask, cpu_online_mask, mask); + /* NUMA first. */ + for_each_cpu_and(cpu, cpumask_of_node(node), cpu_online_mask) + if (i-- == 0) + return cpu; + + for_each_cpu(cpu, cpu_online_mask) { + /* Skip NUMA nodes, done above. */ + if (cpumask_test_cpu(cpu, cpumask_of_node(node))) + continue; + + if (i-- == 0) + return cpu; } } - - for_each_cpu(cpu, mask) { - if (--i < 0) - goto out; - } - - ret = -EAGAIN; - -out: - free_cpumask_var(mask); - - if (!ret) - cpumask_set_cpu(cpu, dstp); - - return ret; + BUG(); } -EXPORT_SYMBOL(cpumask_set_cpu_local_first); +EXPORT_SYMBOL(cpumask_local_spread); From patchwork Fri May 5 11:57:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98623 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81121qge; Fri, 5 May 2017 04:58:07 -0700 (PDT) X-Received: by 10.98.213.69 with SMTP id d66mr3426184pfg.88.1493985487857; Fri, 05 May 2017 04:58:07 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.07; Fri, 05 May 2017 04:58:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752693AbdEEL5u (ORCPT + 6 others); Fri, 5 May 2017 07:57:50 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:52806 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbdEEL5s (ORCPT ); Fri, 5 May 2017 07:57:48 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MLy2e-1d7irK2P3E-007jxZ; Fri, 05 May 2017 13:57:34 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Jeff Kirsher , Yanjiang Jin , Yanir Lubetkin , Arnd Bergmann Subject: [PATCH 5/9] [3.18-stable] e1000e: fix call to do_div() to use u64 arg Date: Fri, 5 May 2017 13:57:21 +0200 Message-Id: <20170505115725.1424772-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:pBGTqQuHnfXYmkUqRS37HP/n5VTg6Kwd4MslYZVre1AKxib3LfA 2ndKux9Rt+uK9lBvTMVIf2Ob1kGGY96YAZ+003eeFj7rZJhyVCJi6G2S85FCOVi5woNdKtp xAJlEPwTYf2ioXi2FVdmcgtD4HKkvTQ2xyH9zhtaQkop+k7QiUMTEBSzYt7W1F6uGmt+s9V RPerAQw3tDjEe9h4OyWgA== X-UI-Out-Filterresults: notjunk:1; V01:K0:pX5bdAshNmU=:7/+GYdPsnFHsACoSCNW3CK 8y6CEEcV/kwvkU9p2Qmwqwa95gw3MufHxdBMHnoQii0cuGQTHCoug6Rf4kuFWwpK1UjDMGwUg jm8db/esljUF2ULHTlyrGK78TwGGCIPl2hWlmYnVZD5g4oUIxntn8f7lKdhSAS7qHd0bvHwfg CurzzKOi54xHPBdIQD3/oEUUca4e20s3VYq6wtANo42FBTzATvNpOTc+yD2hKAc4HIE48MGHY u+6+pFt1lUiBbkFIVTsiNiCzZGEaTpsxVJ9MIqIPQWgHj2fQ+7Z9bH/3M/6GlwtetaryDboMn 7r7jnlQv0EWLaU14vou6fcDjDOzTMfv6aJQi3CX37KrfD1+jye0Lgxk6Ikii0TqMQXkKYIF7M zCIRZOZxmS/g/5dFUzuaZqmZIsT6TSAZrQMGgdwn2lfT8uDDe1MPe7cdpaLNaZCZo/YiL44k8 DuO0MLoFlzPJ07ug/AeyRiFaaqpHzOZtBJQX0Q5s25K//fkO38qBZP/LaKO1sXEc0i5cGPh2I 98OFBs3hsdguO4Ri+ElKm6gYkaTNOc6cPC03qmvAAfUXrcTnGND0CQJgSdszVRms3+KZ3fOJO DO/9VLvXoqS4p1Lb4bTKSjUNdZQyo1j3L3NxzhXrCYpe/CjCNHLEYoipOPoQMlg/ASHKNhOcB T8bg1QdBb89LAqKgP+fdEX+zFGlv6S7Ss1hqkiT6uR8XqtaHzKW3et10R++HCE+IrgVg= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jeff Kirsher Commit 30544af5483755b11bb5924736e9e0b45ef0644a upstream. We were using s64 for lat_ns (latency nano-second value) since in our calculations a negative value could be a resultant. For negative values, we then assign lat_ns to be zero, so the value passed to do_div() was never negative, but do_div() expects the argument type to be u64, so do a cast to resolve a compile warning seen on PowerPC. CC: Yanjiang Jin CC: Yanir Lubetkin Reported-by: Yanjiang Jin Signed-off-by: Jeff Kirsher Tested-by: Aaron Brown Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 48b74a549155..feb618468d15 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -983,7 +983,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) u16 max_snoop, max_nosnoop; u16 max_ltr_enc; /* max LTR latency encoded */ s64 lat_ns; /* latency (ns) */ - s64 value; + u64 value; u32 rxa; if (!hw->adapter->max_frame_size) { @@ -1010,12 +1010,13 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) */ lat_ns = ((s64)rxa * 1024 - (2 * (s64)hw->adapter->max_frame_size)) * 8 * 1000; - if (lat_ns < 0) - lat_ns = 0; - else - do_div(lat_ns, speed); + if (lat_ns < 0) { + value = 0; + } else { + value = lat_ns; + do_div(value, speed); + } - value = lat_ns; while (value > PCI_LTR_VALUE_MASK) { scale++; value = DIV_ROUND_UP(value, (1 << 5)); From patchwork Fri May 5 11:57:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98625 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81129qge; Fri, 5 May 2017 04:58:08 -0700 (PDT) X-Received: by 10.99.4.3 with SMTP id 3mr2865000pge.86.1493985488403; Fri, 05 May 2017 04:58:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.08; Fri, 05 May 2017 04:58:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753170AbdEEL5z (ORCPT + 6 others); Fri, 5 May 2017 07:57:55 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:49540 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753134AbdEEL5y (ORCPT ); Fri, 5 May 2017 07:57:54 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MEVGT-1dHrKZ3wxV-00Fg2W; Fri, 05 May 2017 13:57:35 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann , Hannes Reinecke Subject: [PATCH 6/9] [3.18-stable] scsi: advansys: remove #warning message Date: Fri, 5 May 2017 13:57:22 +0200 Message-Id: <20170505115725.1424772-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:s93Wws0hl/82GGE3kxKP2uGepKwiSjYwds/IL7KLv+lOKj4NZDO IrclDTpvKV6kCVCSR+LSg7nc3nhfotaXU/9LrmMOcO7cYo9RDAlTtQOWi9y5PygZ0C+/ORh BMHgVdY+6n++Mac87OL/kFfRE2CdDLcls3kyyF4F4hB++wkJFeIN6TKdWIGweA7KoNWx7dp sJfhwd4ABePyu7c7pFSQw== X-UI-Out-Filterresults: notjunk:1; V01:K0:PXId3il6TMk=:rxk82nX8tHGJr6lSHUy8Rf l066HjR2fYXbMMQO9LzVKGqOZI4IMnCa67TMCRBBM7OkmdNZEvn44fvs/FBE7aCQKYD/OiSVZ nb9eiKSlt+ceeREAsxNqJZo1aU4OKlxUcZD7ssSuXA1jypvUIp79G44EWanplAKlnMGjN630g ARbnYPWXZsx5qtFmUoNT/5DA0i7+PszamlsH0e3Ea0yVWOT5TjPSofqfXKzQ/uTKxESliUErE sMmnRQapkJzBrXM8vnARfN6k3JFDzRFx9xnZ85xMzAheNDV8hFrzr57iGa6Ar4Qi8a+VTUiMa Vr/oSx1QcPTVxI3Lw8+U/8gpJ22LFSvaL15qMztEswa1ZosDE8p6zamJ2SIcxCZKo2JW2CktL VGoAdjQTaN01vksd7ly+xFK8pchLx37+EbCZnn+aZm7x3QDxaApz4h+5dM4EhvJIub72bJg37 uW7AdEdzvMTd0HA792uR+Kbfq/b/Z/VEt3buC+ZHrON5WTaPgAR2b9npK9h5kmDebVkI0OwoZ qW31qVM0NI/7YBQxy06UK5zuS4jKFyc0VYKBNPIzCUr67/w6ZDIxVOqgk06Ehh5mBGajgjKY+ ee5Qb2dgOky+Av4SJdwW6g9oJX3k4VaDp56wLVf1nvggiS52U2MDzU9ocmAVhZBvHRPgyV22V +mR5S9d4gddeyXrxoQrnqaJzrg4wwmzEgtj5CE3BoZbV8mBUdRMO2mFLPWVIucoVoe9A= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The advansys driver was converted to the proper DMA API in linux-4.2, but the 3.18-stable kernel still warns about this: drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not properly converted to the DMA API [-Wcpp] The warning clearly is not helpful in 3.18 any more, it just clutters up the build log. This removes the warning instead, and clarifies the comment above it. Cc: Hannes Reinecke Signed-off-by: Arnd Bergmann --- drivers/scsi/advansys.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 43761c1c46f0..620b04b7c13d 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -49,7 +49,7 @@ #include #include -/* FIXME: +/* Fixed in linux-4.2, not backported to 3.18: * * 1. Although all of the necessary command mapping places have the * appropriate dma_map.. APIs, the driver still processes its internal @@ -68,7 +68,6 @@ * 7. advansys_info is not safe against multiple simultaneous callers * 8. Add module_param to override ISA/VLB ioport array */ -#warning this driver is still not properly converted to the DMA API /* Enable driver /proc statistics. */ #define ADVANSYS_STATS From patchwork Fri May 5 11:57:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98621 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81009qge; Fri, 5 May 2017 04:57:49 -0700 (PDT) X-Received: by 10.99.167.3 with SMTP id d3mr2802459pgf.70.1493985469487; Fri, 05 May 2017 04:57:49 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si5159094pfo.181.2017.05.05.04.57.49; Fri, 05 May 2017 04:57:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751435AbdEEL5o (ORCPT + 6 others); Fri, 5 May 2017 07:57:44 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:64881 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbdEEL5n (ORCPT ); Fri, 5 May 2017 07:57:43 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lj2j8-1ddBzN0nuw-00dExn; Fri, 05 May 2017 13:57:35 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Date: Fri, 5 May 2017 13:57:23 +0200 Message-Id: <20170505115725.1424772-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:vD59uWFQxoHlqKyhShyGjTrTydV6J1V0f9Ndsglgmn9SHKlidj8 PcNhABmiZCtsyijMp7EHH1yH/mcjzO+KYYquPK3ZbTVkj3rdHOyIN4wRFu0C+W7a5emD+U2 uMbJZnFetfboR5TTppMYTbI+0CUm0qHjEYbxTnHaaK4Na6jkKhGJ42M34MfoR+SOMuW9G+D yH1cCZPeWvXeqZJmyoWJQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:mZBNXSbkIiA=:+m0bGR4KWPyu6nn73z9OoY RjJ5MPs2ikgiqX5gbyYWzj4ihwl5kRW2w4yOm6Vk0eRvrwXa/uMMJ4Yag8WK3/xtcXmBC1OfT uu0Vyo038LxfcbMqOqE4rhdQyYqyuMpASc8OqVP/pL/4yrKMvFQJ43F4J8jqMiMDiTQPj/vE+ UcaL7UWshtjerxCuSNkJ0Bt2df1L3HMIbPBkMCFV/g7BZwGZ4WLRP/i0KkLdZ9xcOT/xlKByP YoIjfGZ/r6d9it2zfD3upuYW/jmzSx3NTucTorFKrAa6ZNTMl3hTIvpRTdeVd5VubuE1jOBz6 Mfq7TzPlotXiv9jpwO7St6QCQJI5dcoIsNdKwP8QSvBeMGa2c0x8WeKFvC9jg/RhjkiEzKC0L QY2GECA8loDXi8ATVpEXLSy6NrGUuFvOx4xHC5M3ZhiTyx08gV8zZQOwEgkkrcbwRrlmkEkvd /p6E5cpW/UaeghtilQoYFHR1rlBtMCaoDGuXoL6zAQLSfmCkrTHfcQHwLHC94PS6+Pkis3iWa 83OFI/gFkR0uAqqupE1QjqBiUIPsmbWwhLJDBZXsJbhSjcTISu0KvE+iDdd2o4ZuFti5EAWvg AFiLYdfX4cdlfqUHmSz44/GPd6LU99pbNOB2RzSvYyCJMG8A1fxqjPrZLDikb3Uis9kyHHrZ6 KeMaT2voeaL+VeUsAmDwcAs3n3h3XOeKq/pOtP9Kr0J6XDg1EXC++Jhe17pSET4TVQw4= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We get a warning about a broken pointer conversion on 64-bit architectures: drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru': drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (p->virt, (void __user *)sg[i].addr_bus, ^ drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] ((void __user *)sg[j].addr_bus, sg_list[j].virt, ^ This has clearly never worked right, so we can add an #ifdef around the code. The driver was moved to staging in linux-4.0 and finally removed in 4.2, so upstream does not have a fix for it. The driver originally got this mostly right, though probably by accident. Fixes: f4c2c15b930b ("[PATCH] Convert i2o to compat_ioctl") Signed-off-by: Arnd Bergmann --- drivers/message/i2o/i2o_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 04bd3b6de401..67ceb3010a10 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c @@ -772,7 +772,7 @@ static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, #endif -#ifdef CONFIG_I2O_EXT_ADAPTEC +#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT) static int i2o_cfg_passthru(unsigned long arg) { struct i2o_cmd_passthru __user *cmd = @@ -1045,7 +1045,7 @@ static long i2o_cfg_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) ret = i2o_cfg_evt_get(arg, fp); break; -#ifdef CONFIG_I2O_EXT_ADAPTEC +#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT) case I2OPASSTHRU: ret = i2o_cfg_passthru(arg); break; From patchwork Fri May 5 11:57:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98626 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81131qge; Fri, 5 May 2017 04:58:08 -0700 (PDT) X-Received: by 10.98.205.9 with SMTP id o9mr16175458pfg.171.1493985488669; Fri, 05 May 2017 04:58:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.08; Fri, 05 May 2017 04:58:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753188AbdEEL54 (ORCPT + 6 others); Fri, 5 May 2017 07:57:56 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:60258 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720AbdEEL5x (ORCPT ); Fri, 5 May 2017 07:57:53 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MAvQq-1dEHMJ1w16-009voP; Fri, 05 May 2017 13:57:35 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Benjamin Romer , Arnd Bergmann Subject: [PATCH 8/9] [3.18-stable] staging: unisys: correctly handle return value from queue_delayed_work() Date: Fri, 5 May 2017 13:57:24 +0200 Message-Id: <20170505115725.1424772-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:zR6me0IjtkoJg89qaUH8deG33Z7o2FRmkhi5+owLKmmC8bYL+QY dm/pZrT+KqyOc7J3lonSTCH+XhYdWFzYBxQ/CQbV/rLDQ9nvEmzHD2xQdhJSp/6J/rpIQLI nDj1if0JV7e83EqUGD2Z5+8i4BAz+xWwVhxf/MU8t6l13Oow9WtHyvcrfvyzPyhSeDrrywe lDNtWC2LnQjCeHnlWQklg== X-UI-Out-Filterresults: notjunk:1; V01:K0:2PVAuJ4XFHA=:2x4zbA7iPduTJJIv8vV6pp mHB3C7ZDsdQ3tLngdLfLzEQO5UJArh8K1en/FMax3VLIcG0uN4jLSVeYrZnTF9ihlqRCS7v2H bIWKBVEN8BDWcIkFckOnBUCkXi+S+oyxHfOXdvgTxWH2ucv7ZNahd148bEwAR9V4hkP9fTx8L d/Lmn8Y1SYkeuktwEcG/ug0fneGechtCSpFPsQByTzyU9s2o907mqNgZHJk17JyV2V5yEoDO8 kusNIjc/3ZNIz+ZdC66TvTQrAOUZ6GxX+VkDMipyD75gCto71/HSpB7JAtpgFjwK0WBhvQ9gt 9LGTqTIjf8DQBKtXl8GvxFHEoYDH66pC+aQ/pl92UBFIPBmY5rcxJNsDA7tULx4tgAB76hLu9 5qceh1w1Or00EM5pQ0gSLPUM1JjMJRNal9axHRqBGQAdtcZh7Xz9ZJka4PnVougW9OrM3MfaP yf/o3RPG97Dt/e1TDItxQXRjd00kH7sXfYDiEqIh5YekWKRVmZZK6B4SJw8zkqArLfOAMoCu4 GfrfyFuohIxsIr0eG4+TNsd6ru9qJADZGppsUz/Cz/eWl6BQasaqrJj9vnKfAZUwBRR0uQcFZ znAgXV4kYJNjDxECn+rjMutMhDLcI+TMS5V5vhaBgFX8/yDZWNONqKFA+cTANNV8CI8g6CCqJ xBDPqYnXst+NFO9qt2mqsMlqOaSwppBGOtgn//ijdQKWTCUAda5UfKwQ5nryzi1758TM= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Benjamin Romer Commit f84bd6267d623b49f196d54ba9edc41ff1c4d5e3 upstream Properly handle the return value from queue_delayed_work() - it's a bool, not an int, so using a less than comparison isn't appropriate. This mistake was found by David Binderman . [arnd: the fix is from 4.4 but needed some minor fixup to adapt to context changes] Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman Signed-off-by: Arnd Bergmann --- drivers/staging/unisys/visorutil/periodic_work.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/drivers/staging/unisys/visorutil/periodic_work.c b/drivers/staging/unisys/visorutil/periodic_work.c index 3dd1c04d0e14..95802d0e9cc6 100644 --- a/drivers/staging/unisys/visorutil/periodic_work.c +++ b/drivers/staging/unisys/visorutil/periodic_work.c @@ -98,8 +98,8 @@ BOOL visor_periodic_work_nextperiod(struct periodic_work *pw) pw->want_to_stop = FALSE; rc = TRUE; /* yes, TRUE; see visor_periodic_work_stop() */ goto unlock; - } else if (queue_delayed_work(pw->workqueue, &pw->work, - pw->jiffy_interval) < 0) { + } else if (!queue_delayed_work(pw->workqueue, &pw->work, + pw->jiffy_interval)) { ERRDEV(pw->devnam, "queue_delayed_work failed!"); pw->is_scheduled = FALSE; rc = FALSE; @@ -134,8 +134,8 @@ BOOL visor_periodic_work_start(struct periodic_work *pw) goto unlock; } INIT_DELAYED_WORK(&pw->work, &periodic_work_func); - if (queue_delayed_work(pw->workqueue, &pw->work, - pw->jiffy_interval) < 0) { + if (!queue_delayed_work(pw->workqueue, &pw->work, + pw->jiffy_interval)) { ERRDEV(pw->devnam, "%s queue_delayed_work failed!", __func__); rc = FALSE; goto unlock; From patchwork Fri May 5 11:57:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98624 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81124qge; Fri, 5 May 2017 04:58:08 -0700 (PDT) X-Received: by 10.84.143.129 with SMTP id 1mr64362454plz.105.1493985488144; Fri, 05 May 2017 04:58:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si5435892pli.193.2017.05.05.04.58.07; Fri, 05 May 2017 04:58:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753115AbdEEL5w (ORCPT + 6 others); Fri, 5 May 2017 07:57:52 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:65401 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752769AbdEEL5s (ORCPT ); Fri, 5 May 2017 07:57:48 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LkyOr-1df7ne2vRd-00amFk; Fri, 05 May 2017 13:57:35 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 9/9] [3.18-stable] gfs2: remove IS_ERR_VALUE abuse Date: Fri, 5 May 2017 13:57:25 +0200 Message-Id: <20170505115725.1424772-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115725.1424772-1-arnd@arndb.de> X-Provags-ID: V03:K0:4GSUJM6v/cFB0RUcCCb+aLAnhf//x+J1OaE1eC9/Ff6ftv3qye1 cXfjuREv1CVNzoRHpnEO/jpOoqvaPzF3QPp981bYY4fNJUZTQlleQq6I6cLpSC4sLR6EgG0 II+fg9KhKgd37jv8QYjq5kNyh2bsT6Yq5d7nKQfXcQT0k4//K6H7I2hKgdioWkxmZJbjTx0 YP8guM/8tFGhFf2z8OHqA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Wiu0pLPWTh4=:xzMX4Qiu8my7Ims9eboDIm 4dumQXCPrqtaHztu7okiVZKRENbg3NqIzKjzaaPeFFcnnxgc/uzDUD6xz8y43HSuZ3tokr6N8 VuaFioeW6whqk33UhvvYZoc6hHvGQk0Gma5i8mNPcBthbatYw52t5OSsXhH9fBkEyN0R6+Q00 T+325qJQ1L8rKi3QZDD2qdxrGzkZOy5VvU4LdCk4Tfi01jGk6tNynlWnKLJgSQ6BpCv2Hadvz zL2YEnZKccRh/uvsDMo5m5CFzbBpUYUPnZw7MXnMBLBqdowf6Im/fJzEGIOxaHQ85gQTqMqeh x8sVq3gz31I3OqsA5O7v/BG67lXPhSMmBZQ7NU/zi/KZ2dnzQjsbg6kIwcFDcUFjs7Fv9EP+D kZpqWXa5hk6oinzN3Mw2FkK7DzsgCDxaZLzPcR5UEOyriexetbPnbbKKW8vbD8jQxG/KJoWcV 0gzB9Z2VIhNKkLLCPaSt4/9Mi1+vc5gAFTw/OtYBTOKMqIYIaRZmNGjcNooDKgASAXn9+LPGR bmGjlbq6Zgq2VWPEScM7LhU2CvEsbfd5n+1zIP/fS3DYHFhpfYzBYpj2QlhZSTETHuhbpjjVb jbgGM30ozCVCg9xcP4QDOU+wgE0meR3jnzfnOTiGYds/qSVvr31yXckTeNxlZBICzGyQB5x3L v663A/fpGZkvC3yZObFhl3xI3Lm/VBskVP2PiZzlVyKEPhzEHOVBLlnVlKxa2JChzJO8= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots of IS_ERR_VALUE abuses") upstream. The original fix that was backported to 3.18 already addressed the warning in some configurations, but not in others, leaving us with the same output: ../fs/gfs2/dir.c: In function 'get_first_leaf': ../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized] error = get_leaf(dip, leaf_no, bh_out); ^ ../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20': ../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized] This takes the approach that we took in later versions in mainline, but does not backport the entire patch, as that would be too large for stable and IIRC caused regressions in other drivers. Fixes: 9d46d31e9aea ("gfs2: avoid uninitialized variable warning") Signed-off-by: Arnd Bergmann --- fs/gfs2/dir.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 9291cf5e7439..f3508f4583d5 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -749,12 +749,15 @@ static int get_leaf_nr(struct gfs2_inode *dip, u32 index, u64 *leaf_out) { __be64 *hash; + int error; hash = gfs2_dir_get_hash_table(dip); - if (IS_ERR(hash)) - return PTR_ERR(hash); - *leaf_out = be64_to_cpu(*(hash + index)); - return 0; + error = PTR_ERR_OR_ZERO(hash); + + if (!error) + *leaf_out = be64_to_cpu(*(hash + index)); + + return error; } static int get_first_leaf(struct gfs2_inode *dip, u32 index, @@ -764,7 +767,7 @@ static int get_first_leaf(struct gfs2_inode *dip, u32 index, int error; error = get_leaf_nr(dip, index, &leaf_no); - if (!IS_ERR_VALUE(error)) + if (!error) error = get_leaf(dip, leaf_no, bh_out); return error; @@ -980,7 +983,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) index = name->hash >> (32 - dip->i_depth); error = get_leaf_nr(dip, index, &leaf_no); - if (IS_ERR_VALUE(error)) + if (error) return error; /* Get the old leaf block */