From patchwork Wed Jun 19 15:44:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13704239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9E26C27C53 for ; Wed, 19 Jun 2024 16:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1AD6E8D0085; Wed, 19 Jun 2024 12:33:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 072AC8D0066; Wed, 19 Jun 2024 12:33:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E07B18D0085; Wed, 19 Jun 2024 12:33:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C33378D0066 for ; Wed, 19 Jun 2024 12:33:56 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7123B41419 for ; Wed, 19 Jun 2024 16:33:56 +0000 (UTC) X-FDA: 82248184872.02.45A6D55 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf01.hostedemail.com (Postfix) with ESMTP id 1963F4001C for ; Wed, 19 Jun 2024 16:33:53 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=M4Gv2CfU; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf01.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718814827; a=rsa-sha256; cv=none; b=GMxTXj2c5wpl5WShO8Dz1AL4iNAQ8JCy3gywRZyEwl1dAUCliyVqlPuyUrn7vxpA1vfFXm pGuv+fzTSJvXC9mPU+JCEVV9Ni6yV/BOsXPOqstswRZ+NypjA+F7ZVlmdvETJ3WxYLoCNh +BjMICGN260B/X+sUtse0A6gparHfMg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=M4Gv2CfU; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf01.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718814827; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tPY2/xfj0WoITwfgq4isE+nahUee+x7RgpdrRutXdLc=; b=pmNBWYbGoATP5EXuThygFh19Dcay4/bUL79sFpmOLK5gDUv/ILZbX/g5JRnxySBdjClspY ZBJxfHxkLu1dVCpWQk9jisBPgCmp3hoddH7r/+8Fmg71F5VGeb441E0pcT8vUiE7mo3yc3 QIsnkli/dpkk1qYw24TxJwL+FnFjaJY= Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45JFQiFX016498; Wed, 19 Jun 2024 15:45:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=tPY2/xfj0WoIT wfgq4isE+nahUee+x7RgpdrRutXdLc=; b=M4Gv2CfU4LF+PMUZ/P6IcdsE1cRuv UKAlZo7rZpz1F5htp0sksxOUHGfiHFJO90HZYOmVRb4xDzC4azCeLMfXtu5sEc64 4IIOe0vwASxtO1NT905qI19ETQr+cINZeHK5yRbnjSY35Gya6lIaTexMVPYn4B8c i/vXIgZQVoEBwvIto1OLOG97iZTgUq0999/ig5Rs+5c8sD/fsDBkgDz7sfFySdU8 YiT/Z3H55U7MNX7Zh4wHCPVzwX7aZ4PgdIkjrUd+tY4rPgXsDqvogU7/UA3boE+f gsd+N6HkJljsocQbjVIL4GRezSb2buMtj+nheLLnboAniGleA6sMLvNww== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yv0p9gauj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 15:45:50 +0000 (GMT) Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45JFjnlR015818; Wed, 19 Jun 2024 15:45:49 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yv0p9gauc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 15:45:49 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45JEaA8K009941; Wed, 19 Jun 2024 15:45:48 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ysqgmwmnh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 15:45:48 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45JFjg5R52101510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jun 2024 15:45:45 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0E882004D; Wed, 19 Jun 2024 15:45:42 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9298D2006A; Wed, 19 Jun 2024 15:45:42 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 19 Jun 2024 15:45:42 +0000 (GMT) From: Ilya Leoshkevich To: Alexander Gordeev , Alexander Potapenko , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik , Vlastimil Babka Cc: Christian Borntraeger , Dmitry Vyukov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Roman Gushchin , Sven Schnelle , Ilya Leoshkevich Subject: [PATCH v5 26/37] s390/cpumf: Unpoison STCCTM output buffer Date: Wed, 19 Jun 2024 17:44:01 +0200 Message-ID: <20240619154530.163232-27-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240619154530.163232-1-iii@linux.ibm.com> References: <20240619154530.163232-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MQJ_dURzM-5GEVXffgkba3S507BXDR3N X-Proofpoint-GUID: dwqmb114eEQPjYtUC_yhsHa4FOTTZQn8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-19_02,2024-06-19_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=948 clxscore=1015 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406190115 X-Rspamd-Queue-Id: 1963F4001C X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: podk7oymf84yw83dziypz89rug9roynr X-HE-Tag: 1718814833-184699 X-HE-Meta: U2FsdGVkX1+NEQRiv9BOcNopNd09cNCa2DLk5qtYhJZqRCZW53f/LrvI4KloAZ4NQWS3uD6TuT0tiEAWlfaFoQ30Xf7Y8gpSsX6eUnPhBCk8h+3UE47zadVMNr1ChdkQ6ac+dpqX8XCou7o9nGBCMYqT8hua1BkfZWdywXPsRpLYhbXdfYnHwc38jXmRy/dpW+Ai7Fao379uowJQET9UKI6j0e5dMzlwD5SDgE6VTY3tO+eIJxNTHxbtuNp+3rytrialSVIKjW5A6y0EPWT1hmFYzGxD6cSWu3oLVctCIKsyYQdBcrAUA4swJrD1TXvNRCUXtlSS4m+/vF4g9t5ZeYZINZB7qzBqY9kz868rJWX2NneSba0A461FqqvMZG+F4ofPEmP2ahXyMga8wjBBe0c8aH9IZN9bkt64lIHggVyFhC90h8a0bPvJSN1Vlw2owfxDY1HO6bHVpBsE8Zuz2ErBGSZ2rckd5JS2nvzcwK7tuaMdcBLp8fK5eEC4ztoX1U2seSjOwOELCxVDmsKH0H/BGmj5hGNMwJv8shUdO9U2h3nA725XyENjV2nFdyNpxU/Utqu5uGyW4Yc1bXFWXoAx+virtpI/dkG4J8lOpVZpDkDaQfBVr3mgsBzA0eZnfggEjFJel4cFAlD/1qqlZPRMakmJGbRl1Xj9FvuDFGELeAO5kpGTAmChZLQfExO6X9UO/rxQJUjn+GK0HcmDKURnjGNvF3dhWWuQ+NOFW6bLTL2n39KISomSqlNGpTaD0uR6eYZ98wqXVhg/HZa63uYRJoK9u/cSDOb2oN/tkGzm4gmF3db0xnXVtKYx/o2H9BByUioO2HN0jnWHDK58am2XQqVFOnpqunEvHCXe9Gz59JJC/gfGGSXux27/7m9R2UQpXCEqb+XKwFrcOE0zqIMULpSypSDQpYp0CpkQQWcW+ZnHDBlEpRn4q90b/X4/x94LSgJv/mHyfnaNm+v 4VCR6OIF MO9hklC6jijoEQT+HVFD9394H7mgUPTd0ZRQOz4c6/uMwIEgOwJPwGYezPQMCjBCUfMinCErcHflSVa+SluELsms8ABWID/h9pd8eOgFJyh+g+WSTZEtZzP7QUVluMpZuKnXElxnJzuzLswErPWifON+P2IoOyErOC7Lhi9XC28XTVULDToDTL83HUWdcqUtjyOZBmTSHMgeCMMDgUShvK6VNYQcObVtXB/qedf9YlvgLKJYTrKu4lLFZKOc/oRn4LWqg4W5ftdgk+3rjcKUOligaImFIxowu7nvYuymeZMQgLLcShvVjElWzhGcN0go1vikSKTa4LVwxo7s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: stcctm() uses the "Q" constraint for dest, therefore KMSAN does not understand that it fills multiple doublewords pointed to by dest, not just one. This results in false positives. Unpoison the whole dest manually with kmsan_unpoison_memory(). Reported-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/cpu_mf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h index a0de5b9b02ea..9e4bbc3e53f8 100644 --- a/arch/s390/include/asm/cpu_mf.h +++ b/arch/s390/include/asm/cpu_mf.h @@ -10,6 +10,7 @@ #define _ASM_S390_CPU_MF_H #include +#include #include #include @@ -239,6 +240,11 @@ static __always_inline int stcctm(enum stcctm_ctr_set set, u64 range, u64 *dest) : "=d" (cc) : "Q" (*dest), "d" (range), "i" (set) : "cc", "memory"); + /* + * If cc == 2, less than RANGE counters are stored, but it's not easy + * to tell how many. Always unpoison the whole range for simplicity. + */ + kmsan_unpoison_memory(dest, range * sizeof(u64)); return cc; }