Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5654531rdb; Wed, 13 Dec 2023 15:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrDdKcXwy367YAPqh0vfuO/NJZAJ+7cN9rTjgWMDPRo22fcAiZ03aI3cdvPO1pMrwgtiZp X-Received: by 2002:a05:6808:1294:b0:3b9:d75e:f946 with SMTP id a20-20020a056808129400b003b9d75ef946mr9652679oiw.90.1702510706891; Wed, 13 Dec 2023 15:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510706; cv=none; d=google.com; s=arc-20160816; b=sQ0iHEr939djnT09bYu5feCG+mDycpjWNVvbqxTd/ILhZCXJ0fGguAXFx7tztal01c Qqt5XrVhojO2gsC7qaGuJH2EE1AIiwetGKZhmuBX3SYjC/20k5mmGvl9I6A7+faMbnTJ C1kvNsddoTeFnPCVA+PPeU78iHnvgH8kWt8cayRFTwaWWGaMT2Ml319iusqGFCmvEO+G VNZwSYQPa5s172yKDifwN958LRx7CmeTDGRy/BSTZ0WFuIt2YLuPPYvkfLhA0oUjk74+ woluiVXNfsRr4lc75Y91r2KlQzC31KmwTtdqKKq9rManfNoJaxYT981MjGsBmwxxPkAY Zo/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WBZ4pxSCZ168xcDVwjX2FOwBhQlGhgRwo9SK59J+9m0=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=IsppFGpffYpOGrreBIKdd4PGuUAUtqgLdrmiYQjrlMBqJX5nqRAxIhs3UCXtcyRfxX Uedzt8yfrA2E1K3ggZDqODwDMxgzWuG52HmP6+Dm0IecdwI2MyP7GqsW9dnRIkulsj7U s57SZTDXeTt+BIvXEn6eQCUORgeqlPYO0hYgEAASWWzKdV9RW9PpR8PsidX5SZUENOEI bqri7DjG0l5+uQhkyODM5ZofqITdySwqeSRxlFxOS3xBERrWEC0ve8GBG8rajRnQuUxX KqTlnGzPPuVvyNrrGf6EnBN+2Bxc6EHJ2z5RIhsQIdXhTz4A8uxh27KCvkRgjnk74p7G 6FZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=jnYe0A8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t7-20020a63dd07000000b005c70983efd5si7841300pgg.629.2023.12.13.15.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=jnYe0A8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8EC9A80CD70E; Wed, 13 Dec 2023 15:38:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442962AbjLMXhz (ORCPT + 99 others); Wed, 13 Dec 2023 18:37:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442911AbjLMXhS (ORCPT ); Wed, 13 Dec 2023 18:37:18 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B84901B3; Wed, 13 Dec 2023 15:37:11 -0800 (PST) Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDMS9rP011054; Wed, 13 Dec 2023 23:36:58 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=WBZ4pxSCZ168xcDVwjX2FOwBhQlGhgRwo9SK59J+9m0=; b=jnYe0A8fcI8iL1hPXGZd8lhX75MyTpKgpduKpfvfxaGdim+EgKDkTUJ1ZdTaPoEKqbS2 iUIm7GKB/b1zUmZvX+i5NzBC7pk+1A/vbRk1QaiQj0VsSyIGZLEaEp3kLXNJk1LfThB/ foc9XHDRLkez906tm8BSN0Z/sz5t8Ez51HxMeGllg/iSXx+ONtPMbsi/gb7qaqFWwCDe 7Z5ybO1BYJqMR40OUDb5W0OkCrFxeV2xzq7xtsVZrtOI686ndX9pbiDnIVhEwOgGjkce cU2+FmXLY703Saq+qDnRHZAY6tyaWTJlpJg9zDcQr5uwsu2camM+YUYcnAhh8sO6TlCj sw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uyne61651-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:58 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BDNJSMP013370; Wed, 13 Dec 2023 23:36:57 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 3uyne61632-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:57 +0000 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 3BDMqU2g004701; Wed, 13 Dec 2023 23:36:50 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uw4skm9xn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:49 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BDNalXP13173362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 23:36:47 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 277CB20040; Wed, 13 Dec 2023 23:36:47 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B61FB20043; Wed, 13 Dec 2023 23:36:45 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.171.70.156]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 13 Dec 2023 23:36:45 +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 v3 24/34] s390/cpumf: Unpoison STCCTM output buffer Date: Thu, 14 Dec 2023 00:24:44 +0100 Message-ID: <20231213233605.661251-25-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213233605.661251-1-iii@linux.ibm.com> References: <20231213233605.661251-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: YiKbpWQLLwQUnerv4xUFC7hQLzJO51wl X-Proofpoint-ORIG-GUID: 8HJohiuwzOsfmPazVmpspQiv9nH_OTSY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 clxscore=1015 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=942 lowpriorityscore=0 suspectscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130167 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:38:22 -0800 (PST) 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 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; } -- 2.43.0