From patchwork Fri Jun 21 11:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707341 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 B4C20C27C4F for ; Fri, 21 Jun 2024 11:38:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 262918D015F; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C3288D0160; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBA088D015F; Fri, 21 Jun 2024 07:37:41 -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 B8F8E8D0160 for ; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7B238A0DF3 for ; Fri, 21 Jun 2024 11:37:41 +0000 (UTC) X-FDA: 82254695922.14.AFFEA2E Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf01.hostedemail.com (Postfix) with ESMTP id 35AB74001C for ; Fri, 21 Jun 2024 11:37:39 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=amWRvAmR; spf=pass (imf01.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969854; 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=7avJjwTuFym2wG7+MlqEChwiWsTpmWUbDN/PJOnw5AExfUuRx7JUFNgLDJWDUaobI4zy/f oNuEPHJXuFb3Wu/bc+TiVabbrCEZ23l2SDOXgN8LQ5M7hgBOWdHaLR0OBUYYD6Rc3s+aee g61QsxoXdxmmIZwb2BfIejkOCVZT2Xk= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=amWRvAmR; spf=pass (imf01.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969854; a=rsa-sha256; cv=none; b=MrNnUCf+iOrxlSTMUdDBBnXXbr3ye8JNj0Q5F1kQv0DkhZRoTsJQzBUaYHcIBVdI/PrkWO /jJwZVu4dp4XPfyVyUcbWmU2ORjKj5KK5W++2D0t5X+2wAJgDY/gSWcbT+y7/CIiGDbEqM M4o/36s2CeGZcDeA/1eausFkgkoQlTA= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBSoRS031855; Fri, 21 Jun 2024 11:37:33 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=amWRvAmRhVDzE6K1W1T2lzLvLYRA2 RaswMMsd1qritqfM/5YWqOW1G2Brn0SP/fI/GrcovouGrkDTQDZcKmFnR5fHNTqt EgkSu/TMSn31fOqgpp+XGuEelNNcB8RipF7hDVMQtuBHxk4Q6nCGkpKyXodhHpLV PKWDoQ0EKjRNejDT/nM3oA44IFVcMRN47zlAMzJb+Qkq1xqs3WerJOcjzVWYfZdh H14mPYHwcjV32tl8BmOwA6IFlIEFU5YCUptYIZCjXRdm5e+z/zeTX4CK8889g8jL 7cR6ohmXREXPIFxbpR6B07N+1tPVXNSiw6FrcRfq9ba5x8GMouz1CqoSw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0kb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBaDh2011409; Fri, 21 Jun 2024 11:37:32 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0k4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9ITHE019974; Fri, 21 Jun 2024 11:37:31 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupw0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:31 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbPWL34603592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:27 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 95BB820040; Fri, 21 Jun 2024 11:37:25 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C15F20063; Fri, 21 Jun 2024 11:37:25 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jun 2024 11:37:24 +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 v7 27/38] s390/cpumf: Unpoison STCCTM output buffer Date: Fri, 21 Jun 2024 13:35:11 +0200 Message-ID: <20240621113706.315500-28-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621113706.315500-1-iii@linux.ibm.com> References: <20240621113706.315500-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: sJZxLZqi83f1gaq2C2xaVmzrDntGvdhy X-Proofpoint-ORIG-GUID: 47w3i0YnpjSgJH2Im2QQDMm0uJXN-cRp 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-21_04,2024-06-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=958 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 35AB74001C X-Stat-Signature: uho3oag1x7e4trscnd6qk585iuzyp66z X-HE-Tag: 1718969859-489597 X-HE-Meta: U2FsdGVkX18z3S8Rg6dUQwiI7NLf0R6yj7/qX5puylyafqASvbLWACag7Rc2GZiySGBgfTZNPGY1T4OZP/qDQCAG/OXEHhK9lG+Y4yA/DWhPgo9zvyepseBqfvER3NNcA55nq6ljKRLf77U/5dSakhvZNnn2MlM2trWBTPfIKbu4VkOPHUcycpIqyxRN7+QlnNAw/mPkVfH1WemIRp2EorT/K0holDbICX425w/dpmM03DMkCh3Njdu25J8bK6ytoy/4SZQ07JvTjLW3gWQEV/EduLC5wcpgVFi7J7ZMl1Db6d7/GHN2WrQoXuCteYu5qjSpZJJ5qEJL8zI0IUKeT7bpzUviG+7MbpUpHCP7tW22CHSyOb0ppY9rumPN8QV7TrI/LOo9AwZocNyy1WEVzzaoed6Pwt/K/aL63nHPm3ZdKzMLSJPJIxoFhCMKUJQaWatREiSry3Z4BS3oo9zEr/B7YaUvnrMX29xsVh//nPQP/M++z/0/ueE4T4uEzXiEspmuuKYVo5T1O1xQ/To5rAmbdIb6lrnUEIMUGsfI6BMjGa+wPEJcBKyDgcsA+2JfhE2xE+hdSj8m2x20m2fRJXp5V4GgtvIBJbYst6jyrxQcQFnvGhJpn9vLj0q3+EhxLq/DmSN+fjNRU7aN2uERh0/9SGLPM67afkPI44kb94nEF+LNdiUHugJ21z32gkAcO8jW5/8aPDFT6UHIUa3mTOhPqZDzxNeUKGm4gp/B0llqz6S8SDlBINo6xrC5lWHfFIkT2fHuPs8Pc/5e5T5JCOGiL0DwwQXNHKNHeyi+YOMEsmhoOfrwGATv4+12cwM5bjqsNvjGLmkR4lkyECvoGuwkhb7pg+Ioedli6nNvyr8dc0gADTidHOSsO366tw9BiuZQRKxlOzgQ7Si1HSeS7sC/k3+XcvD9WDEyvp9t8IRj6+XOgzN7eRCm/bv4vNLMaGlmByEzAFIkp5IPe2z 4E6sIN7P UP2tKRMwbu6EUQChmRqul51T8Jh9/unRxtShsDLcxUWy4y7odMddkDa8cruib6XcWL4SFjDciBljGJVBo7XLtlUUKAbpW3iULszdgdX6+qmIUxqNJ2wnD+fkXz88Y5g+TB0YSDALZrtF54oRbU8UaZXDq3fo6EhZd138eWrNHG9uyfTgzZpFBKeXdBnuqOFdJgVkSOzBWXsLEfmImM7DrrTDOTzM3PT51t6nW1V+cqTPv2hUuKmgsV/rrCJtYT7bwUv5/4egCaIv0P989uQ/F+P3jqkVPnLGHWe/5L+wY9eaM0HZkq6TBVhS3J59zbhY2ANbjLcpTn7PgyTqs0anqU5hT0mVS4D+Ivhmh 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; }