From patchwork Fri Oct 6 11:17:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 115045 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1667309qgn; Fri, 6 Oct 2017 04:18:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAk+qiqgF9AVKXD3ZPaJ1FYuQX40Az1E+73bWw3G7IOhfj66guhkM5U38/+Zv5dBsvC4c7G X-Received: by 10.159.249.9 with SMTP id bf9mr1710383plb.311.1507288722519; Fri, 06 Oct 2017 04:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507288722; cv=none; d=google.com; s=arc-20160816; b=nYfGPq6IS9MFks46BtLQcAaV6RCmtKUJ0qXOvV2Q/AHY43DgNC3hoSI6fL4LCR0ada uN4BnSsrnJ0hR334LT5talSmvGlWhX63tpfdw4bD6k4N5iZVsXqV46Y9GZfjYYQ5UYh6 bmBTE/hB0oM0P0Zo83vKy2+wc+U5MDLYcZtbGL+skcc6LpPAd/V66ueneQB+nMj8CYKL X9obgjPid7vMY/HHWI430K3RRW1KqRQrIc2fQMeFtk464e6Hab85sPu4bnruYDkf0e9t hdcdgduxIbUxoL8S8wNGskhEBDDidU5ZppteiGK8jdIvw839++R8HWwwLhhBEYwJ30UE JemQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=8+WOooC0Ea9Hs97GbqvW7XUViQNkgFaKhyrPJo4qejk=; b=oamSAekI3lzmpexCf/cVHazPYANSfb6YThbG3YA4arHA9JdGFkdi/qr70U72ZRwsZu Vsvatugbjl1pFRibKFN/Q7NkXrhcILFmNrcL+nMyMF2WsYrbgzjZWUZNiBWIHJxpsXS7 uN5rxn1DxWSK9mBAyiqN9eTYWklnJy/R4susNVJH9mQHwrdIbIE4pmy+qjtm0XcTftr0 nJTuveOOkNPngGNg0Sl/paeCUVBWHzJSyhDSvfEUrNnC/iojQzDHOE2mMIygulHjCjow UYvbrl8s/A3WkHL38/UATOdx6gA01o1c21nqEOfrOIFP9dHiWMuXT3AP7Ew8JJZ6Djz2 KiRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=Zn/MBCTX; dkim=fail header.i=@verizon.com header.s=corp header.b=G7xNZrsY; dkim=fail header.i=@verizon.com header.s=corp header.b=G7xNZrsY; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si954507pgu.126.2017.10.06.04.18.42; Fri, 06 Oct 2017 04:18:42 -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; dkim=pass header.i=@verizon.com header.s=corp header.b=Zn/MBCTX; dkim=fail header.i=@verizon.com header.s=corp header.b=G7xNZrsY; dkim=fail header.i=@verizon.com header.s=corp header.b=G7xNZrsY; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751774AbdJFLSj (ORCPT + 8 others); Fri, 6 Oct 2017 07:18:39 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:37979 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752025AbdJFLSY (ORCPT ); Fri, 6 Oct 2017 07:18:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288704; x=1538824704; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=8+WOooC0Ea9Hs97GbqvW7XUViQNkgFaKhyrPJo4qejk=; b=Zn/MBCTXp8rSXbSruqQjupukiDHM+ZB1WZYj4S9lZ0xlRbXQx84jc9xg 6b4bS2kX3QN6/W2Dx5uYri/6fDkLjwr8EjTLZGp5VXrNtrX60RnRHuOsJ 8lEvNuR6et/STcESrB1zOefIhyaSPhBEaMbXwnsBjVKHMMpi0DTNUsagd I=; Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by omzsmtpe02.verizonbusiness.com with ESMTP; 06 Oct 2017 11:18:23 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Arnd Bergmann , Ingo Molnar , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi02.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 11:18:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288703; x=1538824703; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=8+WOooC0Ea9Hs97GbqvW7XUViQNkgFaKhyrPJo4qejk=; b=G7xNZrsYCX5RdN0UISG/Cz4RJq2W5z4K+xKYeyQxRAhl6azk58A3neYy mfHUiZz0bST/izTuiVByn3iAz0WGFe0JAyAhe8fC9B88k0RQhFsN8TMeX MplN1DJ+GvNftho0iAJ6hBpOabg8umWfV7LkyaOLHBTHo3F4fbqGHUJKn Y=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 07:18:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288703; x=1538824703; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=8+WOooC0Ea9Hs97GbqvW7XUViQNkgFaKhyrPJo4qejk=; b=G7xNZrsYCX5RdN0UISG/Cz4RJq2W5z4K+xKYeyQxRAhl6azk58A3neYy mfHUiZz0bST/izTuiVByn3iAz0WGFe0JAyAhe8fC9B88k0RQhFsN8TMeX MplN1DJ+GvNftho0iAJ6hBpOabg8umWfV7LkyaOLHBTHo3F4fbqGHUJKn Y=; X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 06 Oct 2017 11:18:23 +0000 Received: from tbwexch27apd.uswin.ad.vzwcorp.com (153.114.162.51) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Oct 2017 07:18:23 -0400 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by tbwexch27apd.uswin.ad.vzwcorp.com (153.114.162.51) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 07:18:22 -0400 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 06:18:21 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 6 Oct 2017 06:18:21 -0500 To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" Subject: [added to the v4.1 stable tree] x86/io: Add "memory" clobber to insb/insw/insl/outsb/outsw/outsl Thread-Topic: [added to the v4.1 stable tree] x86/io: Add "memory" clobber to insb/insw/insl/outsb/outsw/outsl Thread-Index: AQHTPpS0UyEqlAr4V0qM1P8VpqOTHQ== Date: Fri, 6 Oct 2017 11:17:32 +0000 Message-ID: <20171006111704.25872-51-alexander.levin@verizon.com> References: <20171006111704.25872-1-alexander.levin@verizon.com> In-Reply-To: <20171006111704.25872-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-ID: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the v4.1 stable tree. If you have any objections, please let us know. -- 2.11.0 =============== [ Upstream commit 7206f9bf108eb9513d170c73f151367a1bdf3dbf ] 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. Suggested-by: Linus Torvalds Signed-off-by: Arnd Bergmann Acked-by: Linus Torvalds Cc: Borislav Petkov Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tom Lendacky Link: http://lkml.kernel.org/r/20170719125310.2487451-5-arnd@arndb.de Link: https://lkml.org/lkml/2017/7/12/605 Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- arch/x86/include/asm/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 34a5b93704d3..b36deb1d9561 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -301,13 +301,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)