From patchwork Wed Jun 19 15:43:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13704134 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 806DDC27C53 for ; Wed, 19 Jun 2024 15:46:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC93E6B02D7; Wed, 19 Jun 2024 11:45:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4DD76B02E0; Wed, 19 Jun 2024 11:45:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 951AA6B02D7; Wed, 19 Jun 2024 11:45:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6CC346B02DA for ; Wed, 19 Jun 2024 11:45:59 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1B53BC1425 for ; Wed, 19 Jun 2024 15:45:59 +0000 (UTC) X-FDA: 82248064038.08.C453FA0 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf23.hostedemail.com (Postfix) with ESMTP id D78C5140017 for ; Wed, 19 Jun 2024 15:45:56 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=iUuVlM6Y; spf=pass (imf23.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=1718811953; 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=WE3ASvt90HWWKhjLUTLn3R+jUtOfzIMMtdYDGL1//DQ=; b=gTyiG4tmz7MCZSdW3PhZ4qLLSCXV0Y5gfLhXukg2WvMTRlMPsMMC1CktfrPzBwCy8qLjb+ vqUa/ohd4S43j4tUhZOG1dbYlcMtStMNyCZdbaZeRLozLpKUCDxo1f960s0mnUXvxwzHJO b5uF9a22JWjf1dMYSM8OntjRv1IDfOI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=iUuVlM6Y; spf=pass (imf23.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=1718811953; a=rsa-sha256; cv=none; b=jnFMBfrW+9lfx1fPNK7ZRGos9XzZ652fvs+z4P6xVsA4V259gpJvqhITsNozMZHTJt7WL7 Iz3vasnOFsoHJ2oR1j3CwLt2Fl2twXAlzO1frXXEchojEIXTxAlJnjFqQBy0uJJoOzxAUk WBMEVYtDGgxUCTo97I0vNoLlPy+VfNo= 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 45JFSkbb014145; 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=WE3ASvt90HWWK hjLUTLn3R+jUtOfzIMMtdYDGL1//DQ=; b=iUuVlM6YSnZvo4nuzCGPoq66//UbJ SC0glhvGNVzi1I4N3+4Ln9zy8WC/CBMYwfHjMSHTaM9VLIiJyuC7pszwnRUW4ogF jw9BAF3E6hmDQoPki1iIY5fVx/gdyPrWt08BAqr0aw1KOCsk3PS6EXLu3M9mehg3 J5IF4y5M7ohEpxWGDbp4fn4ja0BCNfokllLctJjvXERE/UfBb6REAVCl6dma/K3d 19L8kCI2pnP7+zo9IF7rGhLiVCXWMxKpxqXuHVUhi0Aiomz6IuU3CEM4E8d3TTwh X6XUMVk5h0Wb8QTxm9f2pnKlR8cDottFsh2E5tbgU8REISE3mSAy+uZGA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yv20hr1f6-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 m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45JFjn1h009037; Wed, 19 Jun 2024 15:45:49 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yv20hr1f3-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 (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45JFEHbP019519; Wed, 19 Jun 2024 15:45:48 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ysnp1e4wv-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 45JFjgwd40239564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jun 2024 15:45:44 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3831420065; 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 DDCB32006A; Wed, 19 Jun 2024 15:45:41 +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:41 +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 24/37] s390/checksum: Add a KMSAN check Date: Wed, 19 Jun 2024 17:43:59 +0200 Message-ID: <20240619154530.163232-25-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: Hn2GME85KkjnRdLhqN5eGP0SUkWM6kFG X-Proofpoint-GUID: Gj-cVYCQ0uqm18nKozEI737ERcJzjF2d 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 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxlogscore=937 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406190115 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D78C5140017 X-Stat-Signature: a66sx6jk5pymsr7tah8zzo9goio3k54i X-HE-Tag: 1718811956-359977 X-HE-Meta: U2FsdGVkX18v9UViVW0vVqI3uAOaYFnOlp1rSpjmXkOlS1ZdAvo4d6ztBTEe+McAnMS8GCz4/T3lS8FacpdXVLWpJanbfPlClwTskMo5MNhbgohDwvhPLsHcQoCW62mX8tdZK6CCLaPdIq4ZRhZDSJKgkpMI6NhF0akbJkLlqJBNQQnSdsHi7sO0Yvr1KDBUMUDs0nU1lzPn+ihTxvNsQh4068qYnv+1+28wYduEvmaiQ4EQLH+x68bmxDQhvBLTDqDCow0lM4U8vhTuOyn1EzrxgY++j9A+dBbr2q/FqoiNeP/GdoTurd7IdXLO1BcFBI0jyL/qv9Doak1UxAjmlApakkE8AsWLT0tVqmL7czMtu/Hbm52CV7iz3vmdDZM7GkVJWBM5NWGDICk++lhDiCv4AQ1XgFtEr8TnPb596GpNJX+5fwL0Orl8WY6xpSt76Zv6GxWxpLbntnU+IX1p4HcbvCRELLek/cMkmS/DJxfNks6+cSgv8SagPJKqSqq+OEpA3gqdYpjCp/7q3ns6A/UfbQt3CUgSKYAi20EA7D+CAf+S5Bz4nCAWrPtJBuVFTx8aORp/fB/pA/m3poeI+o8zKfeU7iuswwGGht32gqZr+TU6/zJ1I1KOsyRY+wnEl31w7TXCkJt1vvnVSbbPRZnWJgpr1k55ZDUexPpTUhjUqiziz5ImR1KXRsGSDde/cwhJ+sB2zTnXy9F92Jf0ix16uI9o+7MzCMOedtcQRSJeo6FnmfFpB+wtaSzKvUe4Pq6Wp/o/A5im0QdHtcqZ7YJ2h9nFugOQFQmttPjPqUyA7sZziou0vJEjxDY5YAsquSo58k9vlQo4xw6q4cib9GcX4CKpK/C96o8r+aUoRmJ10d9Xrg85pZoRFdW6my5z+zi4AlDO4L7dFbwivuHUSC0hBaHPyOoYQ0NRdXinE/fwk4pONlziSKQnHBqe9tpLCC3ZRa9zxHve6mx1wP4 7pcCQDYp TDrUT8Y7tHFlWeSLJrzUWQniUxYzQ08TFoBXiYVxe1TpO0/r59+D/KEH2ks0E5yUpDcrYAc5eQuHWwM9PEOGFH2gSQTgWF/06pYCmhPwChTA9/siyJzjxs6ki9mLsNn2vUq15T6XbdYMsmK1/ts1NpKksbWb7rmBxU+yNaAVT1cmPF0RxGvd0q94MGvt1joB4DJljmE4RY+/g1BF2vjWxu7+xfkHMotho1tU/vu0LGSGy/5VMbrmaVF43xXzmlCSEGDqMftQgqKyHu5A2vjRRMRqgnA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000050, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Add a KMSAN check to the CKSM inline assembly, similar to how it was done for ASAN in commit e42ac7789df6 ("s390/checksum: always use cksm instruction"). Acked-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/checksum.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/include/asm/checksum.h b/arch/s390/include/asm/checksum.h index b89159591ca0..46f5c9660616 100644 --- a/arch/s390/include/asm/checksum.h +++ b/arch/s390/include/asm/checksum.h @@ -13,6 +13,7 @@ #define _S390_CHECKSUM_H #include +#include #include static inline __wsum cksm(const void *buff, int len, __wsum sum) @@ -23,6 +24,7 @@ static inline __wsum cksm(const void *buff, int len, __wsum sum) }; instrument_read(buff, len); + kmsan_check_memory(buff, len); asm volatile("\n" "0: cksm %[sum],%[rp]\n" " jo 0b\n"