From patchwork Mon Apr 9 00:27:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132970 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp686185ljb; Sun, 8 Apr 2018 18:38:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+W79tTicYhOgOcixnJzBA8EZ4tMeHGTHrigSTP336rgaHCIU7kGH/MLvmx2mu4yM0siLaz X-Received: by 2002:a17:902:44c:: with SMTP id 70-v6mr37068324ple.354.1523237916980; Sun, 08 Apr 2018 18:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523237916; cv=none; d=google.com; s=arc-20160816; b=FND8nqOhPhXghiWbJZa3mTZQrUJ61UVIFI81v+6xat4hekWuNiLOlmBa37L/2UDSO+ KkvdNDS3zGaSc2D20qaLtcyltvA1BG7lylxchpZBxfhElasRw2qZ5CFtVDjmQHkW9P2d /9Zg6zz70aFRq24ht3/hpLqxEqDC5J8tca2ixaaPd2guXJk0OepS4KY5jn8Y1jwO+fXv 7tDkG0JG6Jm8GwWtJXAK94/AKBumAv2EeoUoLFiZm9alMx80PrLH0JcoDVFSDGjSGXUQ 8sOunJu3/7pHHTWmAwuUPOV9h/94Ub9R9/55YgvtXqr+vjVtTEufkSNh6ZPTWKWXNS/M 7Tlw== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=99z+fxgPMBKZL6u4TzbomHMirrlh7wWYsm/yT2EFtmY=; b=bUWR5h8//vX1dxud0gfvrXpLM0NYzBo9bd4/cfylzveUJWCq933QmDpFCGMi4WnwGM zsj3k/QjPt6VfAg3docxXAnXP92dkL6z6mqi6vPoZL5IxipsgHsdY98npdSVkC9Iaqkg eZxyXA5zmYnA+NUre2IZ9nr9KhYoFjCcKSKzxnWFgWbNMdlMgTmG1W4laKbpt/P82wqm ydoklyKdYnHZ6jr1jpjN5BbkjD90g7/JKhjWYbRFZLOl58REoLq1ko4mVogxnnUsBCWn TwribXRwhn9c+3E6PEr3FYVe+XiiKIRMFXNry0EKCtEnKTBizPsSUGjAq+UgffCbnKBk NguA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=F7Hkhexq; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si14232737pla.345.2018.04.08.18.38.36; Sun, 08 Apr 2018 18:38: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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=F7Hkhexq; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757436AbeDIBic (ORCPT + 29 others); Sun, 8 Apr 2018 21:38:32 -0400 Received: from mail-sn1nam02on0123.outbound.protection.outlook.com ([104.47.36.123]:10752 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932552AbeDIAfB (ORCPT ); Sun, 8 Apr 2018 20:35:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=99z+fxgPMBKZL6u4TzbomHMirrlh7wWYsm/yT2EFtmY=; b=F7HkhexqGsvaYbdybECTzzo7Cqzdkz0RHwnB2SPEIaK4CzDNSy1WJqlR+bS+f7Kq9MLJ8jW30Ved/xocCf4omouxCfwMbMfD1Bn4QgbJ2AA1XgAzzucbcFsLZ4glTF4BWDWT6yqhKbuW3LLfskWjB4QXxa6Z4ITrWkdFFKXXch0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:34:56 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:34:56 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Arnd Bergmann , Ian Abbott , Stefano Stabellini , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 010/162] xen: avoid type warning in xchg_xen_ulong Thread-Topic: [PATCH AUTOSEL for 4.4 010/162] xen: avoid type warning in xchg_xen_ulong Thread-Index: AQHTz5mXDb2bsrUJPUi8KsTaKYeItA== Date: Mon, 9 Apr 2018 00:27:50 +0000 Message-ID: <20180409002738.163941-10-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1013; 7:2H7+mYJBPMYpxzj5yvZ1CZnlwDqBEnAml/hgq00uw3GzbVVUEzemi9ByQu4C8URfWQPiqLqvg+KhH8rCEEkj89/tXT1eGEGBc9NKSwTySyXMQqGGz0pqQ9weSkoc+SaYv1HxLU8oBZGU/484qiNHpERgcll2TscKlYQgKLKhUtf2+PST4lZ6jpfI6MiN2hFVxTb02VpZuheysha1yUhNK/J8vOqi8CUevabdfjOUkGOVCp24l4EkAv6CR/zNvtuh; 20:w7YLome5i3IEwqjaYljn+qBQ8HqY/wgD4kL/KY3E9l/HDL6aUoLUK6A/J5fzt/wP2xqkNGbWJnztDMa0gsKzdRsljMUs6YzwG2zYB76OyZ9deRFDUHnBUxU6l5NJNTou+o9A7CU/EG4n4ERNLOUuoydD+E9omwzURYuW7ZaKrWc= X-MS-Office365-Filtering-Correlation-Id: 86111688-2715-4f9e-2f02-08d59db1b7ea x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020); SRVR:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1013; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1013; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(39860400002)(396003)(346002)(366004)(376002)(189003)(199004)(478600001)(10290500003)(6436002)(5250100002)(2501003)(14454004)(305945005)(4326008)(66066001)(99286004)(10090500001)(6506007)(36756003)(102836004)(54906003)(486006)(107886003)(76176011)(59450400001)(2900100001)(22452003)(316002)(110136005)(86362001)(3660700001)(2906002)(81166006)(186003)(86612001)(81156014)(2616005)(8936002)(3280700002)(11346002)(53936002)(7736002)(476003)(446003)(72206003)(68736007)(6116002)(5660300001)(106356001)(6666003)(6486002)(8676002)(1076002)(105586002)(26005)(6512007)(3846002)(97736004)(25786009)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1013; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: fIre9/sQUixyncW4im2BddJ8jZ7MZIXtio+av/Nhq1QaHDyQ+lYnL0EJXA0G9e2Hvm5/i75npkU7t7nT7324Dz7xdNPKTa+LZcTB0av5xT8taZZLBueemxidEuuusONRYKrpsL/aarzTLmjo1OC40ogGU2LzBu4vbMp8RahKz85jSUSQKcH3kq9BevbcRRx1QsWM20CV2BNCa6NiQBUbJX79558mvfMQFpU2/RxO8jCa8cJRupBc1+qSjroXbk7ei2ZOxMoFQ1wqgQx+3mesOe62d+3l0h08boSLBOIpeV4ieOcBuSds/vEze+8PFwhfW4cctPBK4V+/lZxGEgwMiRgTBkjZGfuXRVGsbqJOacTIyvRuDT+LBh+SI2ECS9txB5uMx1EnBiBxGMTIvsogq3wZ6g0F3wqEBjIoxoB+k5o= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86111688-2715-4f9e-2f02-08d59db1b7ea X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:27:50.3641 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 9cc91f212111cdcbefa02dcdb7dd443f224bf52c ] The improved type-checking version of container_of() triggers a warning for xchg_xen_ulong, pointing out that 'xen_ulong_t' is unsigned, but atomic64_t contains a signed value: drivers/xen/events/events_2l.c: In function 'evtchn_2l_handle_events': drivers/xen/events/events_2l.c:187:1020: error: call to '__compiletime_assert_187' declared with attribute error: pointer type mismatch in container_of() This adds a cast to work around the warning. Cc: Ian Abbott Fixes: 85323a991d40 ("xen: arm: mandate EABI and use generic atomic operations.") Fixes: daa2ac80834d ("kernel.h: handle pointers to arrays better in container_of()") Signed-off-by: Arnd Bergmann Signed-off-by: Stefano Stabellini Reviewed-by: Stefano Stabellini Acked-by: Ian Abbott Signed-off-by: Sasha Levin --- arch/arm/include/asm/xen/events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 diff --git a/arch/arm/include/asm/xen/events.h b/arch/arm/include/asm/xen/events.h index 71e473d05fcc..620dc75362e5 100644 --- a/arch/arm/include/asm/xen/events.h +++ b/arch/arm/include/asm/xen/events.h @@ -16,7 +16,7 @@ static inline int xen_irqs_disabled(struct pt_regs *regs) return raw_irqs_disabled_flags(regs->ARM_cpsr); } -#define xchg_xen_ulong(ptr, val) atomic64_xchg(container_of((ptr), \ +#define xchg_xen_ulong(ptr, val) atomic64_xchg(container_of((long long*)(ptr),\ atomic64_t, \ counter), (val)) From patchwork Mon Apr 9 00:28:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132968 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp675345ljb; Sun, 8 Apr 2018 18:20:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx48MryZdE7Ndsx78QYp/tQwKuv4qd/OaJhxMEGstXPfchHzkLaGsRcN5US1TbJ/bHhaoMnq1 X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr36074903pli.50.1523236858117; Sun, 08 Apr 2018 18:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523236858; cv=none; d=google.com; s=arc-20160816; b=Z0RMSHC8f/L3OI/cM3kFpvcErJty4uXiU/HffzQZNrrzpxbyGqEUEIzqSb9jd81IRH +Ys+v2stJpySDT9jpGFG3A0929xK3oUPKL8YUP4NXYSnRPR9WvgFUi+Tf4dvX64O2u6Q jYhZoENeuMKyuiciNeaFGW4gEyslAxReFn+8+WHLD2lavad7oMG9tcQG8tBDizRpE8pw OIp7F9XnfTs8rRWxj4sKQy6KlqbmQ8Nnv5FhAz3bkNvwTMG8Fczh0odtvtzFEww01jUR kI3EyL+mKH00giVIn0kh3BCx16fK3YqauWmENpozSpuB29ZkUSFmajb8GximsZwHxvjK G9fQ== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SybOediApRqhVsy3Ea12peFVsuuUTT+TFwWiR8aAt2k=; b=WCnQbjq737juhgqPAcqxN2xpZU4hITUvajhtqYNURddCsCQGnk9reTDy5lmnuJnnaT o30+qSdLL/wNio5kz3aQEVs4SSAgSUv1BnYKsqMIr+0e36rUHy94/a7SP7Fr45m0S3MR i3UIdjps6rTOMl8OYtqlLlqYheYP39nG0o1mXCd1GtkH7/TXKzPFNed+v8y53cUT6jSc 5NnIvmx2vZ7yyGD3K0Fn1RIoY7pAHZf+vtD587ku/+PYNYnVo6uYHQSHL8/75Wlvaivn k8JkZM8XoOQZcY/XpG4kqySFgEhB+xjpBKsu5jhsTEJRwO0TFLrSiXG9dcjLgzGMukHl HSFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TCBthZvV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si13281803plw.143.2018.04.08.18.20.57; Sun, 08 Apr 2018 18:20:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TCBthZvV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757305AbeDIBUz (ORCPT + 29 others); Sun, 8 Apr 2018 21:20:55 -0400 Received: from mail-sn1nam02on0111.outbound.protection.outlook.com ([104.47.36.111]:14488 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932762AbeDIAhL (ORCPT ); Sun, 8 Apr 2018 20:37:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SybOediApRqhVsy3Ea12peFVsuuUTT+TFwWiR8aAt2k=; b=TCBthZvV5Nmu5M5DDKy0GVwP2+O9PDcn/mBlTSGZr67Uo9E4pdwueVEB24HTrWjbZUT8OEeBRlu0PdyRKMd2TZlAQduxV6lJpVbUfhJl6ANJ0BnQrlf1ygp7dqORi4yD6Oe1pZPIlu3JyOy0YAFy2xP9oSs918XtsiP+M4W/MLE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1031.namprd21.prod.outlook.com (52.132.128.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:37:08 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:37:08 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Dave Martin , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 090/162] arm64: ptrace: Avoid setting compat FP[SC]R to garbage if get_user fails Thread-Topic: [PATCH AUTOSEL for 4.4 090/162] arm64: ptrace: Avoid setting compat FP[SC]R to garbage if get_user fails Thread-Index: AQHTz5m7YGhm/cxA1Ua1PIjVNbV6BQ== Date: Mon, 9 Apr 2018 00:28:50 +0000 Message-ID: <20180409002738.163941-90-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1031; 7:Z9w5uhNSCyF0G1WvazE3Q/uSB6P5i+G9FYljg6Sy+0nCRkne9XYXXwWgrr3PX+rgY76zkeK2Y/f1AADccwYNHW4cQNIXs1wqZnnmmuwJzfr3Ob+tNa3/yC7rNl37v44AT8BVlgGyWm5s492pr30ANSd0tgm4Gh8BgmYdT/th9fD7b7xBQniNXos3resrm5dnaRMJiv32GJx8kcy0KTsxvWIm5CiRYtTxunks+v26N4px6cgK6vPtePqU1ssl9lJj; 20:dcP621dpjuXmsDQ+j3e38wq1m8b4GnpMjENtCBXHJRrev22J2JA090wN0BfSweH3Fs3haxjfCYwoTgltphnR7dZoUVZSB96a3UEk23I8uBE+PPw9s20zZu2Ba4/+WRjpcE9mI44qnq8vjQcUPs1pWHsF5Wr0NNdsrKy/AEIWDPw= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 76b106c9-9015-4f7d-e37e-08d59db2067f x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1031; x-ms-traffictypediagnostic: DM5PR2101MB1031: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:DM5PR2101MB1031; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1031; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(376002)(366004)(39380400002)(346002)(39860400002)(189003)(199004)(2900100001)(10290500003)(99286004)(76176011)(14454004)(7736002)(11346002)(26005)(6666003)(86612001)(72206003)(478600001)(36756003)(106356001)(66066001)(2616005)(186003)(22452003)(86362001)(68736007)(305945005)(54906003)(102836004)(486006)(110136005)(316002)(6506007)(446003)(107886003)(53936002)(4326008)(105586002)(6436002)(6486002)(476003)(6512007)(5660300001)(5250100002)(25786009)(3846002)(6116002)(1076002)(97736004)(3280700002)(2501003)(2906002)(81156014)(8676002)(10090500001)(81166006)(8936002)(3660700001)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1031; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Vc7ZmIuD8OzNJ5YN6giiilFkV4opDx6yHzaR4WJ3+pN1Yz4UkUnhuMVFbqOr+OmLH1BHxj33dkTNuOqGZ3mISO8DFZoLS7GqkA2PU4e8vdoOoktgI4ExVCFTtiFeYArxCemanm6Q6hQ2OXooTuGm7pDhOH50+JBp8hxN5Khsg+mwm7dyoQzrUrJkxsWqrx+P6vakudQjK+mvyta/JD4s/syaSonhBILtoJm9RFTIOxYafjFYCoqVN98gwtMPz9VbBV3tf/1ilSU2hE5loH/YOHhpu+OINTe0HbPIT7lH8YA6CCDJit12c6LDdw8cTZ/A31scslQRokPwfD7Eh8cXolPepVh65opJVpZjlzohU9muW04Lbua0g4JsbS8mCWKhZGzVhHeIt4wuX3ishe7KcxCVZW6PEyWLU4L7KrOAGEM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76b106c9-9015-4f7d-e37e-08d59db2067f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:28:50.2084 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Martin [ Upstream commit 53b1a742ed251780267a57415bc955bd50f40c3d ] If get_user() fails when reading the new FPSCR value from userspace in compat_vfp_get(), then garbage* will be written to the task's FPSR and FPCR registers. This patch prevents this by checking the return from get_user() first. [*] Actually, zero, due to the behaviour of get_user() on error, but that's still not what userspace expects. Fixes: 478fcb2cdb23 ("arm64: Debugging support") Signed-off-by: Dave Martin Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/ptrace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.15.1 diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 183f39384e4c..b81fa63bc834 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -834,8 +834,10 @@ static int compat_vfp_set(struct task_struct *target, if (count && !ret) { ret = get_user(fpscr, (compat_ulong_t *)ubuf); - uregs->fpsr = fpscr & VFP_FPSCR_STAT_MASK; - uregs->fpcr = fpscr & VFP_FPSCR_CTRL_MASK; + if (!ret) { + uregs->fpsr = fpscr & VFP_FPSCR_STAT_MASK; + uregs->fpcr = fpscr & VFP_FPSCR_CTRL_MASK; + } } fpsimd_flush_task_state(target); From patchwork Mon Apr 9 00:29:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132967 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp669796ljb; Sun, 8 Apr 2018 18:12:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49SrtT5iZda9ue2PQhUsacKpCTBo+3GRv/mAzfUM+mAR9KJTpfwuSRypxlxPQbVU0EWdQSg X-Received: by 10.99.173.7 with SMTP id g7mr23406291pgf.170.1523236342993; Sun, 08 Apr 2018 18:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523236342; cv=none; d=google.com; s=arc-20160816; b=ICfkvqcOA4DU09sz92fCM9jiWl3WoNWXGVZ8kYCJL3Dq2/hGwNISqj+c0Ddti/ynUu SLzM4BDEhJjHoqWmXcQSO7T0Nu3oD4N9w6OCxQRKk+E1PDfRlSOWJITnWPYIeACoUL66 cM1v403On9WZYvZfrYX+UFb+o7QgBU9wgDZ+noGqPUqAdPyMbzNxT5DzFIH4gcMIkKXm OqbOWmCRdqvJwrB1zwSGJVGuTPgw2r0aSVU3iBAw6w4/v8KjGGhfCzsw4UiXpeGEUZus 8T8KIG2nPIcsdytlp+D0hBs210KEZWhxsRZbD9ol9Vn2Rhy8w7+NTHJEg8bME1l/i05f ZhUg== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Ho7g9+OqnT/q3kvQRcOOxz9RNGESi9fXP7IDt6pKcwk=; b=GXUdPt8/s2LSx8jVYEdcB/dM47tZvV39Mgysp4iwhMZrU0T+9kkJZiwW4J4FwIhAaW be/rfE+WhoJrqHNYNEIpH71oZlJuMNW3ZxxxPvgT8UU6mklImsC7qVt9ds3Il4WOEG95 F+N6we7I695PzdGexHoiC+weKFFnTorsxewe5Gfw/bxW/+KRYcgK/F+6N/YHS0DAfJvi zf93W4h9+OIUCpPEDc7wX0yXauIlONwroMIDZpOh1/XFj4kZ5pFOO5dHXHS3feSe1aSP p+RiKl+sYW3yJicGoAyJJTwyWuOnLDovmxMZhe/Z0lOGzkfwcE6CCz9rzWWTPvinEEgI niww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e2jMOMQ1; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si11187287plh.375.2018.04.08.18.12.22; Sun, 08 Apr 2018 18:12: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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e2jMOMQ1; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932178AbeDIBME (ORCPT + 29 others); Sun, 8 Apr 2018 21:12:04 -0400 Received: from mail-co1nam03on0129.outbound.protection.outlook.com ([104.47.40.129]:43760 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932989AbeDIAil (ORCPT ); Sun, 8 Apr 2018 20:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ho7g9+OqnT/q3kvQRcOOxz9RNGESi9fXP7IDt6pKcwk=; b=e2jMOMQ1hgRsg/uEnuIqCFCLtg33BlsbF3TaHOWHO0a1Di5uvSIPOC4Bo/JbTUCT4C61IetHANfuI5kVMZohr3cX47DhSLzQ58MEniNIsgvAdV79WFjIg/uMmT0RutNIgv7p3VDR0bOLVTYvzyQg62FwJhU7IRS2LpipcwcTuWI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1095.namprd21.prod.outlook.com (52.132.130.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:38:35 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:38:35 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Arnd Bergmann , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 129/162] scsi: fas216: fix sense buffer initialization Thread-Topic: [PATCH AUTOSEL for 4.4 129/162] scsi: fas216: fix sense buffer initialization Thread-Index: AQHTz5nQsIISFIovaEKhcaM0LAaenA== Date: Mon, 9 Apr 2018 00:29:25 +0000 Message-ID: <20180409002738.163941-129-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1095; 7:j5QP7AcTl3YE8OBe4Y+j1fDOukOq4KIumks3ruLWx9+LF3jw8a5HwAYG/Sxd9551b9QhkMYHh3U/2M4xFKPAQupasqmbJsK32mS7ezRykuicEPJZ4ymiz7U28jnAv7D3tjUD3J8oIQPDw/H0FwcR8/IFLc9L3YyN3IqucbUxMwwUOvwCQXqME1JVPH3Xg2OEQRQsEdw84X2371+mJWN78h7BibcP7QdVWSMXqCsQY8f8kkwUN8PFyW1XOc7kSAkj; 20:bMBUAgzNGjd6TwFqruEAues5YyuKBO++9i+UkExT3mtwKtPZFtNlqZYyOvqfLWoqZythBMaN/XPkM98JHNhRYsqP8bLaF8KOaQnqB5iIreNLLRB8IY/aog+AP2o46IoujrjgMsh8bcX1X4zUsC20+F8J9RLbd6QZ20IY35TutF8= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 1663cbcf-2687-4af7-c121-08d59db23a8a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1095; x-ms-traffictypediagnostic: DM5PR2101MB1095: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:DM5PR2101MB1095; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1095; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(189003)(199004)(26005)(10090500001)(476003)(105586002)(86362001)(107886003)(11346002)(446003)(2616005)(102836004)(76176011)(6512007)(97736004)(36756003)(6666003)(6506007)(8676002)(59450400001)(99286004)(4326008)(10290500003)(81156014)(86612001)(81166006)(186003)(486006)(2900100001)(106356001)(1076002)(72206003)(478600001)(305945005)(8936002)(25786009)(3660700001)(7736002)(68736007)(66066001)(110136005)(316002)(54906003)(3280700002)(2906002)(3846002)(6116002)(6436002)(53936002)(6486002)(22452003)(2501003)(5250100002)(14454004)(5660300001)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1095; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: iLYuqqKqNdUfgItSw+KmkeU4mTOoSxlZIWUDuVnTJxB5sfzZWp6QL5DG6o1K0Pr7vxHn0gdY9z85Ur1rK2PCMVPMq1JgRs5PJ/Yr7BhzD1TQGcUiNJaoGbPpn8uygYKuK1negcXhm6ZtDurDt7SwVp1I+jwNZ4cLxoIXJOSqp8o9Xz7rftUDlDNK5eWpUzIQxOJ2eh4y5lTFKIylhfy0F+5IExsYiEwUH7kzXT2xGwaj4dKd9wZMGKPnRkFPj4WUIvyaIAd37W73Q1BKyUL4nO/MwCNFTqq0xfqnLSyEuOWDNBvoWb8NLso4Q/0dTOgoGK02uUXpPHVoQcwmETFKd2uEyAFP1qyHIn7249Tkhhpe8IyZ6lpDt8UdYus4AiZ32r2NM9iyvh/20LZddmpgsziMVgCm7GCHnTbBJS1lIPI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1663cbcf-2687-4af7-c121-08d59db23a8a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:25.9900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1095 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 96d5eaa9bb74d299508d811d865c2c41b38b0301 ] While testing with the ARM specific memset() macro removed, I ran into a compiler warning that shows an old bug: drivers/scsi/arm/fas216.c: In function 'fas216_rq_sns_done': drivers/scsi/arm/fas216.c:2014:40: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] It turns out that the definition of the scsi_cmd structure changed back in linux-2.6.25, so now we clear only four bytes (sizeof(pointer)) instead of 96 (SCSI_SENSE_BUFFERSIZE). I did not check whether we actually need to initialize the buffer here, but it's clear that if we do it, we should use the correct size. Fixes: de25deb18016 ("[SCSI] use dynamically allocated sense buffer") Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/arm/fas216.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index decdc71b6b86..f6d7c4712e66 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2009,7 +2009,7 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, * have valid data in the sense buffer that could * confuse the higher levels. */ - memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer)); + memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); //printk("scsi%d.%c: sense buffer: ", info->host->host_no, '0' + SCpnt->device->id); //{ int i; for (i = 0; i < 32; i++) printk("%02x ", SCpnt->sense_buffer[i]); printk("\n"); } /* From patchwork Mon Apr 9 00:29:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132966 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp667261ljb; Sun, 8 Apr 2018 18:08:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+PaDHCqRKJRttDwmP56EiHK1IJXLIJnpgcytfoX1lLTZSvG0bk2Dz8hEbfEWisqEG+wG3m X-Received: by 10.99.55.1 with SMTP id e1mr23661206pga.237.1523236116147; Sun, 08 Apr 2018 18:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523236116; cv=none; d=google.com; s=arc-20160816; b=1IFJgLau46X6ERYfv3l0OS5NyisAJcs/oY+97BBVuqnU5MyJsTWKbM3ORnt7EnKPhf i5+2G/VYaDtbFaPv5v7rG7Yd0jPWmsR1GsCcdF/HipRg8COnEq4CfeFxM3om2f0hZ+YJ KoDJuJ/ibHKW131QBZd+qMPA3Ud/CGj3h57NwHmIa1Uc1F4F1Umlm4ke0NRfHycBSO7J T10R7URTfCee9CnE0PhrSLq/lRuoeVYLBlhQb60lw+FkUg+59vYY7Y2KX0dIamwhzFxc RyiflK8gKh6KUawVhq5ZnPfT0F61kGGq2ct8BKfy4f/rmY9A003oKmGvCMUITWcHfUX7 f/iQ== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=FAcshN7gB79ZZOdrq/kzj5HwLR2n6NMd/nodWJDZQ8Q=; b=msmbFcaP4UmstbnB2Ipmj96CGUb1YzetfCv/WS9Ue5PKtTRMLBhrTn51XHTZzXvmIE Cikl+KKWoDQsyQSIdiu0U4PmalLi5Y4mPFtbd574FOUdjoQ5fmsT2moctkvrwXADEzgX ri7T5NIi5Cbd28aqg9Q23USWQiWlstG0b5RXf/D5IszOW/Vv6k05FYHGzhaLI0xax0o+ dwQThxtRjMegq+IyrOfOq7UveCeilcHjdkXUeuYU0n5Gfy3AJ+ZGdQzY4mjsSAIMk7Fb MYCWm+jKBXSGT5bEVsAJ2zw3mfv+iRdOon5mFPwuMu5NsuLiTgAMvhfJCZEpJuHgpkfU IoQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=EVKFfkSF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h132si11824482pfe.52.2018.04.08.18.08.35; Sun, 08 Apr 2018 18:08: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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=EVKFfkSF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932632AbeDIBIb (ORCPT + 29 others); Sun, 8 Apr 2018 21:08:31 -0400 Received: from mail-co1nam03on0103.outbound.protection.outlook.com ([104.47.40.103]:64416 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932996AbeDIAiu (ORCPT ); Sun, 8 Apr 2018 20:38:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=FAcshN7gB79ZZOdrq/kzj5HwLR2n6NMd/nodWJDZQ8Q=; b=EVKFfkSFLevmwKmWOKJ4szQ7Rf3mXGwA4l+PKfQ96ZJgYZ/idjQY/LTUcXeZMoy0ZjlOEmtOy2u3ErJMhubCHxD6/Rqr3sc/UJQ5WjbFezVzMVd1GS23FfF+r6NbvUX+Ti86821RqtnXIKhrIAQmE919rhf6ti4WHPt0JhpBLlw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1125.namprd21.prod.outlook.com (52.132.130.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:38:44 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:38:44 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Arnd Bergmann , Thomas Gleixner , Len Brown , Andi Kleen , Nicolas Pitre , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Pavel Machek , Bart Van Assche , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 144/162] x86/power: Fix swsusp_arch_resume prototype Thread-Topic: [PATCH AUTOSEL for 4.4 144/162] x86/power: Fix swsusp_arch_resume prototype Thread-Index: AQHTz5nZi6wwjhwO/EaancXIq4cVOA== Date: Mon, 9 Apr 2018 00:29:41 +0000 Message-ID: <20180409002738.163941-144-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1125; 7:hpeQMxtWudmzC+rvbeVdutwJljiXm9sE1yQc8xh7PzTzGk/Di68yI/OnP8sEeZqo7dmYzf6MRaoHaceD3QoCNsDsobFzZJXlPnjkhpIyJHZXfvMAdISR9u9Zh/U9foD+Jf9IdxKu/Gi8xtX5GKN2C62240n25oJA1IfVg8UO3YLfRDH/UEToQfZk7TXF7k2cwopGa6BI401wbfeEGU/gexEKiBYHjlrOarrUON7XbdiVyHg+EA7Ms7XOricSMuep; 20:iruIWNGnp6uu4hIN8m3PWnfKMu1OU8eFNjLHqSxhaeRvuqCgYzy1+UC7gV80fj0x5VyKiS3KkCVF9mjf1x0SLE6UGnsZadyCyjMBGKsWz2PJhl+NqJp2u0FjZdBnD9zUilmvCbzj4+ItOCcvRw4/G5P+DAGPfV0+sHH0Wlj/YeI= X-MS-Office365-Filtering-Correlation-Id: 3ef2cf39-8b1a-4cc2-bd05-08d59db23ff8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020); SRVR:DM5PR2101MB1125; x-ms-traffictypediagnostic: DM5PR2101MB1125: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(9452136761055)(42068640409301)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1125; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1125; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(39380400002)(366004)(376002)(396003)(189003)(199004)(2906002)(25786009)(6512007)(10090500001)(3280700002)(10290500003)(6666003)(6306002)(3660700001)(316002)(110136005)(54906003)(11346002)(107886003)(2616005)(476003)(446003)(36756003)(7416002)(99286004)(86612001)(53936002)(4326008)(486006)(6436002)(3846002)(81156014)(305945005)(966005)(5250100002)(1076002)(102836004)(14454004)(66066001)(7736002)(105586002)(81166006)(59450400001)(106356001)(8676002)(97736004)(6116002)(6506007)(6486002)(5660300001)(186003)(76176011)(22452003)(72206003)(478600001)(2501003)(2900100001)(26005)(86362001)(575784001)(8936002)(68736007)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1125; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: T48sArjaZfMda5HSOpZVPiYMCeTJpvN2gbwhoyHIHNk7DnCnT2wthK2UlCtisPOeqPLMk4/0LVWm446/CDFt+77uOhn83qZrp9BbRGfExxXfRPGT02GIS97Ui4PfviEQg/dcr1lvDCYNZcDV1FnKYiEcqkhPFa/1h3MAw9AfzZaGiyAhzE9qbiwMTKIW7opIEzZPbcjv6MxWOPMUjhV5GR1v9RFPFs53w5ryK+houOFRBsW3XYDQLpVvDoVyABHQfPJX13lJDCKyu232jRJj+iPX4FTmTQsLRIJPYj79duFsxW69FiidZHwDNVoqWHCbpIjJyaV2ZkikIYqKFM15XMnQjeRbJKTdrg13X5nZFZYZK4EOhnwveyOE4FaMscBVDV7mm6srFMhrbAK9mxF+E5xI1XiETa0JjCrNSgQnn1I= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ef2cf39-8b1a-4cc2-bd05-08d59db23ff8 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:41.6308 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 328008a72d38b5bde6491e463405c34a81a65d3e ] The declaration for swsusp_arch_resume marks it as 'asmlinkage', but the definition in x86-32 does not, and it fails to include the header with the declaration. This leads to a warning when building with link-time-optimizations: kernel/power/power.h:108:23: error: type of 'swsusp_arch_resume' does not match original declaration [-Werror=lto-type-mismatch] extern asmlinkage int swsusp_arch_resume(void); ^ arch/x86/power/hibernate_32.c:148:0: note: 'swsusp_arch_resume' was previously declared here int swsusp_arch_resume(void) This moves the declaration into a globally visible header file and fixes up both x86 definitions to match it. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Cc: Len Brown Cc: Andi Kleen Cc: Nicolas Pitre Cc: linux-pm@vger.kernel.org Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Bart Van Assche Link: https://lkml.kernel.org/r/20180202145634.200291-2-arnd@arndb.de Signed-off-by: Sasha Levin --- arch/x86/power/hibernate_32.c | 2 +- arch/x86/power/hibernate_64.c | 2 +- include/linux/suspend.h | 2 ++ kernel/power/power.h | 3 --- 4 files changed, 4 insertions(+), 5 deletions(-) -- 2.15.1 diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c index 291226b952a9..77ac4e4deb16 100644 --- a/arch/x86/power/hibernate_32.c +++ b/arch/x86/power/hibernate_32.c @@ -142,7 +142,7 @@ static inline void resume_init_first_level_page_table(pgd_t *pg_dir) #endif } -int swsusp_arch_resume(void) +asmlinkage int swsusp_arch_resume(void) { int error; diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c index 009947d419a6..0e0c773edffc 100644 --- a/arch/x86/power/hibernate_64.c +++ b/arch/x86/power/hibernate_64.c @@ -78,7 +78,7 @@ static int set_up_temporary_mappings(void) return 0; } -int swsusp_arch_resume(void) +asmlinkage int swsusp_arch_resume(void) { int error; diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 8b6ec7ef0854..4a69bca7c6ab 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -377,6 +377,8 @@ extern int swsusp_page_is_forbidden(struct page *); extern void swsusp_set_page_free(struct page *); extern void swsusp_unset_page_free(struct page *); extern unsigned long get_safe_page(gfp_t gfp_mask); +extern asmlinkage int swsusp_arch_suspend(void); +extern asmlinkage int swsusp_arch_resume(void); extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); extern int hibernate(void); diff --git a/kernel/power/power.h b/kernel/power/power.h index caadb566e82b..25367fc0b152 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -85,9 +85,6 @@ extern int in_suspend; extern dev_t swsusp_resume_device; extern sector_t swsusp_resume_block; -extern asmlinkage int swsusp_arch_suspend(void); -extern asmlinkage int swsusp_arch_resume(void); - extern int create_basic_memory_bitmaps(void); extern void free_basic_memory_bitmaps(void); extern int hibernate_preallocate_memory(void); From patchwork Mon Apr 9 00:29:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132964 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp666046ljb; Sun, 8 Apr 2018 18:06:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+H81sAvHxfUaKXAHlR0rjr2Keukf411EUgjbpg1zPujBbHeq3Bg7DH0CqKoHjitNtqWg7j X-Received: by 10.98.138.205 with SMTP id o74mr27592554pfk.114.1523236004923; Sun, 08 Apr 2018 18:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523236004; cv=none; d=google.com; s=arc-20160816; b=TBA8s24ohpLcmbvJX0rxSI1xUBeHp/8zCqEyIPm6rzOljYmmDMrH9bOPXFGCHjD/Fn gH8cdGEGyZ8v/0qr0fyDEhiWqYnawBXB/W0Cme8Glr5DEzazf7uCjFvFQI+PAi31CBMn mYhZj9jgK8Jvwq3vD64M7FFAgW3pIUjtTZIBg2dAj9t8Ce7Cl7JNPsQtyqYh6C6/UTdU /Q18XXBzrTpLceHwKZ1PJ0hImX0LaCMT0U/T9OCWTNIaCxW4Fm90bcOMDSwLT7A2YQXv oN6yKrP2k6SNL0KMy5awP0uxLt37CHq7scna+4M0BGT2k9W44HTT5JMt+rFxrvYVFVq/ niXA== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=3CsGGYx3UZA0JDYv59+IeM6eL5AWmAw5uJHtyZGlZQ0=; b=jFTznOCpYj2JQC03mq3Zp3yLSFfEXEh8g/tJNM70uzoTpqSdzvQz4tSGUX8gSfOkKA 4QeRnaDL+botJyb3OxqVQ26Ge30K6TE8AJwIZjVH8IoantS6FbuEPrWcf7/JDjXHGlLc dlNwNn0GdYZy0s3by1FkLDjZfqqS/LOltiQfJ7jViN+XnZ5jiEcHsWb6hLc3gJRp8Y2l RxspDmt67DV98KsYnC5m5QfZWApAx6acLTZ3+dO25dDFYAxbstZTqTazqL1d1fO7snO8 +z7Gt6RDrVJ9Lna0WIw5+aeTKUgcFDl68iukXJkpQba/wHjqfMbeugNsKILsN7BG+vYx D8Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WKLHT+sW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si9620139pgc.207.2018.04.08.18.06.44; Sun, 08 Apr 2018 18:06:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WKLHT+sW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933093AbeDIAjW (ORCPT + 29 others); Sun, 8 Apr 2018 20:39:22 -0400 Received: from mail-co1nam03on0104.outbound.protection.outlook.com ([104.47.40.104]:37663 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932150AbeDIAjT (ORCPT ); Sun, 8 Apr 2018 20:39:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3CsGGYx3UZA0JDYv59+IeM6eL5AWmAw5uJHtyZGlZQ0=; b=WKLHT+sWF6HGkI3xMApusCxmX8LujEW3E5yypJRsU5h+gUKaYPEzDXmEISfjm6a/gP673JGr3wCI39/jn6n+8iUjzy0T+1kvNorFViu+aPY6nWEwVRkjIQT2MJVvfW/+FvitLjU+kHYlClRx4WauyhSW4K+knScubP8L3Y6O/Lk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1125.namprd21.prod.outlook.com (52.132.130.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:39:18 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:39:18 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Will Deacon , Catalin Marinas , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 152/162] arm64: spinlock: Fix theoretical trylock() A-B-A with LSE atomics Thread-Topic: [PATCH AUTOSEL for 4.4 152/162] arm64: spinlock: Fix theoretical trylock() A-B-A with LSE atomics Thread-Index: AQHTz5ndWKyNBLBiO0KmDVG9mTfa6w== Date: Mon, 9 Apr 2018 00:29:48 +0000 Message-ID: <20180409002738.163941-152-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1125; 7:phFJrejoBIx9YOkIsOY/oZwNTQWYNQ5K+6+VERVXLn9e20vRbHzR42SeSvKehpQAV0VgN7AJMkpY7qVkm/xGH2u7qqIpplD0NjVdw1Txt4OaKSZ7DHMYl2h3v8daefJkFrCajvXdFJaKCSycuM/7OZxXWEbF5k+pbKwUeN50j8g6WGr/mpH0/+ZBNjNm8o74f0MDvMg+c+diZ7H3c88LTC2tG5APDhi6nEPPgZPRsV76/ixOV8t5w6US70S3Roni; 20:DPrGhEGipKbECNben+rSePzk4cGjm7H6ai6kcQC8hbseviSGZ5ItZe1mr7iQPIoyU8T5878vftveFR1DrLdraONc9cmuv0nwKATivNYBTs6PEzwtqf4flSBrL/Z/Cpf+xdTUBiQfcvFEMs2fS5ru3WpaeY8zNkcXjwM9ArKpjQg= X-MS-Office365-Filtering-Correlation-Id: e720bffb-60f3-4df4-6f7d-08d59db2542e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020); SRVR:DM5PR2101MB1125; x-ms-traffictypediagnostic: DM5PR2101MB1125: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1125; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1125; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(39380400002)(366004)(376002)(396003)(189003)(199004)(2906002)(25786009)(6512007)(10090500001)(3280700002)(10290500003)(6666003)(3660700001)(316002)(110136005)(54906003)(11346002)(107886003)(2616005)(476003)(446003)(36756003)(99286004)(86612001)(53936002)(4326008)(486006)(6436002)(3846002)(81156014)(305945005)(5250100002)(1076002)(102836004)(14454004)(66066001)(7736002)(105586002)(81166006)(59450400001)(106356001)(8676002)(97736004)(6116002)(6506007)(6486002)(5660300001)(186003)(76176011)(22452003)(72206003)(478600001)(2501003)(2900100001)(26005)(86362001)(575784001)(8936002)(68736007)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1125; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: AtGrAFekcxKhLAPdEX2lPn/NyDDCYpAVc8suW4uLMW6Ernh3bb/gwQ3/FlpURu9My5/M26EWLRrf6KYlwawK1w0xwKtkKZXbofhBvF6eeoJEvV/7kp1g5wU2e7ewzeIbR83o2MhDrvcqb6/Jj8bAkbKfPhwhcyv0vEf+dwEQv/P8nBpNT/pwCmptzsdb4GrLj3iXOEYkaOvDFY69LiyIiFfq2SbMMSlAuo4kAyrms1AQ5xKPzkK96dOdQJeWksIg9n8EJqFBRezjrt95PgymGzyTe2Jx1sH0I+rvIRZ3rD1gu0DBdZePd7u2goXoZeeM+MxJweK16Q7VbfKvaEXIb1hRn+8Y7DkntVaOjH2D7m+9akYD9tPYJ8vyTZm2tvVYcj8dEKPMWI5YJlIH6BZ8L+JzNUanis6gjQbQxjRSH9w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e720bffb-60f3-4df4-6f7d-08d59db2542e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:48.6933 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon [ Upstream commit 202fb4ef81e3ec765c23bd1e6746a5c25b797d0e ] If the spinlock "next" ticket wraps around between the initial LDR and the cmpxchg in the LSE version of spin_trylock, then we can erroneously think that we have successfuly acquired the lock because we only check whether the next ticket return by the cmpxchg is equal to the owner ticket in our updated lock word. This patch fixes the issue by performing a full 32-bit check of the lock word when trying to determine whether or not the CASA instruction updated memory. Reported-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/include/asm/spinlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.15.1 diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h index 499e8de33a00..fbbd7fb83fd6 100644 --- a/arch/arm64/include/asm/spinlock.h +++ b/arch/arm64/include/asm/spinlock.h @@ -94,8 +94,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) " cbnz %w1, 1f\n" " add %w1, %w0, %3\n" " casa %w0, %w1, %2\n" - " and %w1, %w1, #0xffff\n" - " eor %w1, %w1, %w0, lsr #16\n" + " sub %w1, %w1, %3\n" + " eor %w1, %w1, %w0\n" "1:") : "=&r" (lockval), "=&r" (tmp), "+Q" (*lock) : "I" (1 << TICKET_SHIFT) From patchwork Mon Apr 9 00:29:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132963 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp665317ljb; Sun, 8 Apr 2018 18:05:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+afLDq0jMitHCP7k8cC9caFOCryUnGTjULtsu7BHmt3vXpJyYBuZBx1jKzHsnLdggrIley X-Received: by 10.99.120.3 with SMTP id t3mr23273130pgc.56.1523235936783; Sun, 08 Apr 2018 18:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523235936; cv=none; d=google.com; s=arc-20160816; b=yRZfxDQthwAbc1XwhvjBhSk2GNGP9HVQhI5Hji0W3Hzahp8+J7f55U9YYJJ1wxvD2h 45wSMpnocgZOS0N4cCLkPz3khuN3rFRiiTZH6SxesJyg3yX6mXJTMLSdX4sYPCjNwTl2 PcPDFNshYfBHph1bAY8bZHjTcicCtwp5YBkni77LD5d/osi/ywTmogwTY+JJV6G8wgtU y+36yfj9gFPJz8lad24S2XzYdLaRGyf6lEGdgRyohZ3dE5A7H/4XHzSNWAUUNVqfERfn IjQNCYp8TWMg52c82SzAcmCaNFZoMDwM9FreMyqrJ1Lkl2a2ugIBfQdQeCCjav6X61FL 68pg== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SuHhaq51TqBEz+88A0d9BbfeOaOdTgWJBQhQOoFia9I=; b=Yb6Llr3Slr6D7AiPrRa0WGRIZ2IeOUgVelM4UsNtJxZLvsvomKMCcSRoiJvS78WlgI gYLloKjFG3NSWLqei22t2SuWhoglihoE+Y6FQ9SHJBPTJPeaC1anYys1ODKYoxX0gE1t eZo5D23E+8kqlru8dPu5nbQpOFYghB2Bv+Bu4lW4OIeb6btuCkeIr3eIXBio4lukB4jb ISwbO7KCW0jftphG2aC0CEfShwKEdWtlxUAMT3eQfdyF/Yv9CLgix86b+yRcN/SMg40M 4JjgHGUnT8cw7HdhIOFqVJvyBylzsNoNUHJQGo2xEhWU8FeEU9dCWh6KWKUpy1f7Xjhg kxnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZYfJ0XSh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si10533138pgc.236.2018.04.08.18.05.36; Sun, 08 Apr 2018 18:05: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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZYfJ0XSh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933132AbeDIAjb (ORCPT + 29 others); Sun, 8 Apr 2018 20:39:31 -0400 Received: from mail-co1nam03on0103.outbound.protection.outlook.com ([104.47.40.103]:45124 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933110AbeDIAj0 (ORCPT ); Sun, 8 Apr 2018 20:39:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SuHhaq51TqBEz+88A0d9BbfeOaOdTgWJBQhQOoFia9I=; b=ZYfJ0XShR9gGdnWACp36PG4FZta6ciB+E+K0L+9UhnHNaABQdRTwSaT+dTrTHc3slNJCwAwdVXXXLADJ1RxG9jFoQb8GiB7hw1KAeaHWYmpdjeEKvBjKDzh3Xuzjo9yakdwo5ik1ZeOIaY8qMnAO5lEuP+A3rAJy062X1oyBhmQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1047.namprd21.prod.outlook.com (52.132.128.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:39:23 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:39:23 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Will Deacon , Linus Torvalds , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 161/162] locking/qspinlock: Ensure node->count is updated before initialising node Thread-Topic: [PATCH AUTOSEL for 4.4 161/162] locking/qspinlock: Ensure node->count is updated before initialising node Thread-Index: AQHTz5nicqXB/srxrk62KE5Agd7zKg== Date: Mon, 9 Apr 2018 00:29:56 +0000 Message-ID: <20180409002738.163941-161-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1047; 7:uhup+F5q6U6FjtrCNZydskw9NxalxYvX+tSwRhptxkD/A8M43ba8vGZbNiO3UFP767OcDrRcCkdOoZ2OaK0gBLbhDBYj+ujkcvfqNN2E08ByUOO9AC8iAHbq5NLvcgayAOpKWWpc9IpYZHHjhM5/7sYzOK5G2+iIRC2wpJTrYUjTYyFSddnS7BN3IvwuKJPeWymTbpQqqzvO57n5hZvPeUgHIzVyfYT8tgja4SBxxjmr7S5k0CLXJEOyjj4ZRVXn; 20:6b/A41pcf/nfDeKsdWjHwH0huJ/csKbkvz08xYc4qIhnMgi93zNDw014chWFfFzTAz7uRfETS3teDrq65S9wpRu5anA5zOa13JcUYyVSCFJ0bVF4xnPrnnXxMJ9Ep1dCa6tIPz2yuPa8J4vmuyhc5TKgvExfEwo4H28/jOQPDC8= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 17e2c5dd-39de-4871-fe22-08d59db25726 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1047; x-ms-traffictypediagnostic: DM5PR2101MB1047: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171)(42068640409301); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR2101MB1047; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1047; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(39860400002)(346002)(39380400002)(189003)(199004)(51234002)(97736004)(3660700001)(2900100001)(2906002)(8936002)(11346002)(3280700002)(106356001)(446003)(68736007)(72206003)(1076002)(966005)(86612001)(25786009)(3846002)(36756003)(107886003)(6116002)(81166006)(4326008)(486006)(81156014)(6306002)(6512007)(6436002)(53936002)(14454004)(8676002)(26005)(5250100002)(86362001)(105586002)(6666003)(305945005)(186003)(10290500003)(7736002)(10090500001)(102836004)(6486002)(2616005)(5660300001)(316002)(2501003)(66066001)(22452003)(54906003)(99286004)(110136005)(478600001)(59450400001)(476003)(76176011)(6506007)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1047; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: iutPlE8DdaORd37gPk/wjAgcFPT5vYXpd2DttRGp0T+gcZT4jKveIOAalWIirrmo69Cw4i4ypqmoDPfe4j3hXBdTu0T+ttX8H3sk8FWxBC2AdH+ngZ+rjccr+J/C7bDNJy62gqO+J2koHZ2GJVBRGzWqcVztFmtZqheOTXJxwcQA1djlytkK2QZFWwC7Ek7Ex2Q+NYUuJO+nlXo3tItdlyuc9KozbRaoQQ9mZfhY8nR/6Zn6aMDteQl84bzE1oIGmiA3zmRI9vD5kM8rk5OktdWOJoyVYUGWiBsM5mL7D0Zce1/5huse+DfeLN/G1Di/zKSfe6SZgLDGu8wWNuaPi+AuydCdpPsteO04exHkEPSq7HageO9GdNP7C3xN3+dAEhRGiNjpHPVacmGCJF5av8+x/bOOzuXm+RkApg9V2Pg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17e2c5dd-39de-4871-fe22-08d59db25726 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:56.5684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1047 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon [ Upstream commit 11dc13224c975efcec96647a4768a6f1bb7a19a8 ] When queuing on the qspinlock, the count field for the current CPU's head node is incremented. This needn't be atomic because locking in e.g. IRQ context is balanced and so an IRQ will return with node->count as it found it. However, the compiler could in theory reorder the initialisation of node[idx] before the increment of the head node->count, causing an IRQ to overwrite the initialised node and potentially corrupt the lock state. Avoid the potential for this harmful compiler reordering by placing a barrier() between the increment of the head node->count and the subsequent node initialisation. Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1518528177-19169-3-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- kernel/locking/qspinlock.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.15.1 diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c index 8173bc7fec92..3b40c8809e52 100644 --- a/kernel/locking/qspinlock.c +++ b/kernel/locking/qspinlock.c @@ -423,6 +423,14 @@ queue: tail = encode_tail(smp_processor_id(), idx); node += idx; + + /* + * Ensure that we increment the head node->count before initialising + * the actual node. If the compiler is kind enough to reorder these + * stores, then an IRQ could overwrite our assignments. + */ + barrier(); + node->locked = 0; node->next = NULL; pv_init_node(node); From patchwork Mon Apr 9 00:29:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132961 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp664369ljb; Sun, 8 Apr 2018 18:04:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Hu0dCAJHjvFvpl5Ctmy5RRIFE3FSafj2ThSX8TMx/VbSPQn6SzOExLkk0mVpssD2WNz5c X-Received: by 10.99.4.202 with SMTP id 193mr23533336pge.409.1523235852262; Sun, 08 Apr 2018 18:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523235852; cv=none; d=google.com; s=arc-20160816; b=tf90vMBIJ4oAf9pVZLeYjSFWtZqDR0p6Bs9K15bkcPgkojdkgMAYCMKxGSg0FlgFZz M7cSFfFc/Ooa2PY04m9uIsy7t78/D00ukZJ17mmbp5rYuBjTUa5oGYurVg+MhrhjWlgM 18E6fyAruIU+RH+bnrCoUVH0sdGsUALKOUqMOyNbGQNrI4F606Lu+j6Iju3mi0/rujSI znqqR64d+m1suRtPAWcEImBu7kTKZn9sJoaTj66L669VbNS6OU73rZ/FLY4hId1XWaod hxd/wFcsfz1nLYs0DSQ9ny2+fRbJX2WKe+M379Mx1yXCosCV2I4BIQA8KLS+b0byvbMz ELww== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zTcojvna5BcA/8Pq1A5slMrcw+FrV6v3dpHWfx8jr3w=; b=G5Xri0lLWKWmBIU0YcDnUnaDDQ9g3U+L5NG3O9lpMd+utuZFPGXBPhIaJxIf6bRZIR azxb8M92X1get9EZ3CRVnj4oRnL3atZG7qye+UYfHP/erl/Yze5YZQN+6QBOyGHR1bkW Y57CEBy6eW20pg5QAgFbl72lk6lkWdAXrTB0rM56c02iMlkhFc8GN7Yj8L9ZrYUBa8Od 6KadxKcmkM0f/t9DN1b66nHG3E6YLneZZFteaSJ6wEdmOk8sOHLt9ycjpW5BETkXZ5Qn 9QunH+ucIwKTXWte7HlP81kA98UktmiDNSA4DC2s/hU7SJJ++53Re5l68bWMh9015nJ3 kAgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Buf+RTkD; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11-v6si12670457pls.337.2018.04.08.18.04.11; Sun, 08 Apr 2018 18:04:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Buf+RTkD; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933156AbeDIBDl (ORCPT + 29 others); Sun, 8 Apr 2018 21:03:41 -0400 Received: from mail-co1nam03on0132.outbound.protection.outlook.com ([104.47.40.132]:50200 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933056AbeDIAje (ORCPT ); Sun, 8 Apr 2018 20:39:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zTcojvna5BcA/8Pq1A5slMrcw+FrV6v3dpHWfx8jr3w=; b=Buf+RTkDpgS033SBPWoku475JLSpUSGv7rIBgmu2TOQXrqtcuQkoGZFfWTBKCXUBMuItQckkZTDfXO9OG9eQuHMgxblpHng9tmtB56NCjDu7BMBtxTQMts1wYEWuvsyzCSoobsFL9s+a3vF26e+zoMPDgZrs99mwwpJ2XXnxvCo= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1047.namprd21.prod.outlook.com (52.132.128.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:39:24 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:39:24 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mark Salter , Marc Zyngier , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 162/162] irqchip/gic-v3: Change pr_debug message to pr_devel Thread-Topic: [PATCH AUTOSEL for 4.4 162/162] irqchip/gic-v3: Change pr_debug message to pr_devel Thread-Index: AQHTz5njjEL0XCokWEuoHa9G5sSZQA== Date: Mon, 9 Apr 2018 00:29:57 +0000 Message-ID: <20180409002738.163941-162-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1047; 7:3KqszXrucrisiMEoY93ZFOZSIN6Mi+k4b8LyunMnmWxW90Y2cITR/Ku++1JZ/A/yyIwSFe+/lOVCyflXftWNU7L+wGBUBD6Dg7FbiuC8gQ8QFUVlveLdpPuvm3UWTN0ohSG7BcIuIjoIrGHWYBofEwH7l0DTsdfpA7VoOfdwMyJspSFzpWKyB3PvBDBEaxSUioZO2u37lIuvYN9WYMnMYYTfuCtZer1Es9V8kVDiGr4L8+hGpnss80sLkwn2GjpH; 20:fKt6rXsoTG4qO+ldw536XhdXs/3yogpqHPtgFk6LTlJ8DfxA4klZr+hunqQs+YzfIbLhpUqSTVn6nAb8CfvmafEVuV6bIa7G9eYbCqW4/cOJX6Z1qNjVI8EoyPvHuMscctJ9J+9NXi1h+pH7/orMA3VDwHQG3+HMbG3SGy4p+nQ= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 132e0c81-a4fd-48b9-808e-08d59db257cb x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1047; x-ms-traffictypediagnostic: DM5PR2101MB1047: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR2101MB1047; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1047; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(39860400002)(346002)(39380400002)(189003)(199004)(97736004)(3660700001)(2900100001)(2906002)(8936002)(11346002)(3280700002)(106356001)(446003)(68736007)(72206003)(1076002)(86612001)(25786009)(3846002)(36756003)(107886003)(6116002)(81166006)(4326008)(486006)(81156014)(6512007)(6436002)(53936002)(14454004)(8676002)(26005)(575784001)(5250100002)(86362001)(105586002)(6666003)(15650500001)(305945005)(186003)(10290500003)(7736002)(10090500001)(102836004)(6486002)(2616005)(5660300001)(316002)(2501003)(66066001)(22452003)(54906003)(99286004)(110136005)(478600001)(59450400001)(476003)(76176011)(6506007)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1047; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xLhDSVWt6W0SJygl6m7ieZQ55s9dkNEe2hf7ekEdMXLa9XvtvVr8OmFVelSdO/yeQCPCKC6g+kjzVnp/TG2VwslISHoqPz6a2gH2iTqF/vkH0cRAU6vjbekiKXJMKWr/5yhDTF6IC4WJmb4Jjt/NLzY2KF3K0gRq8NyZdtJmqC1M5DHfUnQhp8oZa8fTrZonHQ95RPHmgME4FzhI5U+72pCupKAxUqeDlFGL43mG0O4zxxs5xclhmJvlEXiXSqDFf1CsX+RYoZxGvmHm6pJzPnDOODE1HcAESEgp3+yKAB2zsXFOzE0FMlA680aePr8zhcVlyKHo2eOFstomwkJvSywHaEDeKQTdZdtgCKz8i92XfG5VseflcAHatTnUi0RDu66EC6sTbMxEWhZdN9C3xubdVOX786cTltyyD+aHz48= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 132e0c81-a4fd-48b9-808e-08d59db257cb X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:57.3340 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1047 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Salter [ Upstream commit b6dd4d83dc2f78cebc9a7e6e7e4bc2be4d29b94d ] The pr_debug() in gic-v3 gic_send_sgi() can trigger a circular locking warning: GICv3: CPU10: ICC_SGI1R_EL1 5000400 ====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #1 Tainted: G W ------------------------------------------------------ dynamic_debug01/1873 is trying to acquire lock: ((console_sem).lock){-...}, at: [<0000000099c891ec>] down_trylock+0x20/0x4c but task is already holding lock: (&rq->lock){-.-.}, at: [<00000000842e1587>] __task_rq_lock+0x54/0xdc which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&rq->lock){-.-.}: __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock+0x4c/0x60 task_fork_fair+0x3c/0x148 sched_fork+0x10c/0x214 copy_process.isra.32.part.33+0x4e8/0x14f0 _do_fork+0xe8/0x78c kernel_thread+0x48/0x54 rest_init+0x34/0x2a4 start_kernel+0x45c/0x488 -> #1 (&p->pi_lock){-.-.}: __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock_irqsave+0x58/0x70 try_to_wake_up+0x48/0x600 wake_up_process+0x28/0x34 __up.isra.0+0x60/0x6c up+0x60/0x68 __up_console_sem+0x4c/0x7c console_unlock+0x328/0x634 vprintk_emit+0x25c/0x390 dev_vprintk_emit+0xc4/0x1fc dev_printk_emit+0x88/0xa8 __dev_printk+0x58/0x9c _dev_info+0x84/0xa8 usb_new_device+0x100/0x474 hub_port_connect+0x280/0x92c hub_event+0x740/0xa84 process_one_work+0x240/0x70c worker_thread+0x60/0x400 kthread+0x110/0x13c ret_from_fork+0x10/0x18 -> #0 ((console_sem).lock){-...}: validate_chain.isra.34+0x6e4/0xa20 __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock_irqsave+0x58/0x70 down_trylock+0x20/0x4c __down_trylock_console_sem+0x3c/0x9c console_trylock+0x20/0xb0 vprintk_emit+0x254/0x390 vprintk_default+0x58/0x90 vprintk_func+0xbc/0x164 printk+0x80/0xa0 __dynamic_pr_debug+0x84/0xac gic_raise_softirq+0x184/0x18c smp_cross_call+0xac/0x218 smp_send_reschedule+0x3c/0x48 resched_curr+0x60/0x9c check_preempt_curr+0x70/0xdc wake_up_new_task+0x310/0x470 _do_fork+0x188/0x78c SyS_clone+0x44/0x50 __sys_trace_return+0x0/0x4 other info that might help us debug this: Chain exists of: (console_sem).lock --> &p->pi_lock --> &rq->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rq->lock); lock(&p->pi_lock); lock(&rq->lock); lock((console_sem).lock); *** DEADLOCK *** 2 locks held by dynamic_debug01/1873: #0: (&p->pi_lock){-.-.}, at: [<000000001366df53>] wake_up_new_task+0x40/0x470 #1: (&rq->lock){-.-.}, at: [<00000000842e1587>] __task_rq_lock+0x54/0xdc stack backtrace: CPU: 10 PID: 1873 Comm: dynamic_debug01 Tainted: G W 4.15.0+ #1 Hardware name: GIGABYTE R120-T34-00/MT30-GS2-00, BIOS T48 10/02/2017 Call trace: dump_backtrace+0x0/0x188 show_stack+0x24/0x2c dump_stack+0xa4/0xe0 print_circular_bug.isra.31+0x29c/0x2b8 check_prev_add.constprop.39+0x6c8/0x6dc validate_chain.isra.34+0x6e4/0xa20 __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock_irqsave+0x58/0x70 down_trylock+0x20/0x4c __down_trylock_console_sem+0x3c/0x9c console_trylock+0x20/0xb0 vprintk_emit+0x254/0x390 vprintk_default+0x58/0x90 vprintk_func+0xbc/0x164 printk+0x80/0xa0 __dynamic_pr_debug+0x84/0xac gic_raise_softirq+0x184/0x18c smp_cross_call+0xac/0x218 smp_send_reschedule+0x3c/0x48 resched_curr+0x60/0x9c check_preempt_curr+0x70/0xdc wake_up_new_task+0x310/0x470 _do_fork+0x188/0x78c SyS_clone+0x44/0x50 __sys_trace_return+0x0/0x4 GICv3: CPU0: ICC_SGI1R_EL1 12000 This could be fixed with printk_deferred() but that might lessen its usefulness for debugging. So change it to pr_devel to keep it out of production kernels. Developers working on gic-v3 can enable it as needed in their kernels. Signed-off-by: Mark Salter Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index eed31f9bee05..cb0d0caadc3f 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -589,7 +589,7 @@ static void gic_send_sgi(u64 cluster_id, u16 tlist, unsigned int irq) MPIDR_TO_SGI_AFFINITY(cluster_id, 1) | tlist << ICC_SGI1R_TARGET_LIST_SHIFT); - pr_debug("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val); + pr_devel("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val); gic_write_sgi1r(val); }