Message ID | 20240613153924.961511-35-iii@linux.ibm.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1A757C27C78 for <linux-mm@archiver.kernel.org>; Thu, 13 Jun 2024 15:40:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC0346B00BF; Thu, 13 Jun 2024 11:40:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C70FE6B00C0; Thu, 13 Jun 2024 11:40:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9CBE6B00C1; Thu, 13 Jun 2024 11:40:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 88A2C6B00BF for <linux-mm@kvack.org>; Thu, 13 Jun 2024 11:40:09 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3AA651401F5 for <linux-mm@kvack.org>; Thu, 13 Jun 2024 15:40:09 +0000 (UTC) X-FDA: 82226276538.29.6951E11 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf04.hostedemail.com (Postfix) with ESMTP id C7ECB40017 for <linux-mm@kvack.org>; Thu, 13 Jun 2024 15:40:06 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=IRh013pY; spf=pass (imf04.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 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=1718293205; 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=SGtqtZLhmZTpZhOs7cGVRXCfbxWX39hF+gqk+Qx83+U=; b=ky0AgWcfS8fo0HjdSug5SgXJD7RGzi7jmaVRO8tjXQRQB5DcF7QcA9+bmadYcikddnydF9 SbGQE46YivpkQREwuGb9ZlIhVrUEQIivtAlrWPCt/CzK7CnIFkiK7FJYYmPYlVq+5y/luO Y1bduq6ol7ScLlMF8NwA19A3fbDuTJ8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718293205; a=rsa-sha256; cv=none; b=aM0e4hEWaXNMSr/8HGYHo83MKCk+Un4Oxl/Ii5Gj7X2xGeEO8Qokj2eUzZzZ6o3dTbjEeD 7M48IN1CeURM/mOSx0ASSyUXOSoo1ngtg+z31eRiekshmLBRBbfCV7yKLRgGXR32d3qSKn 2gZDVe4ZLfpD7fbJfkAuA22iu1+UHDA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=IRh013pY; spf=pass (imf04.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DFRpXY006834; Thu, 13 Jun 2024 15:39:59 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=SGtqtZLhmZTpZ hOs7cGVRXCfbxWX39hF+gqk+Qx83+U=; b=IRh013pYTuUHW/NKXqynYSO+MHC0K eCs3RfsOQP4rIRmQcWWClReFpk2dA9WZqYD/OyQVUoS7iXmQzHEG6GNLSbpcLojr J9IcDXyNMrmu+5cHvUr1rsqPwVn/mnkpVPXQ1X1b/YdBZEr+L4VxHK1CBvG2x85n EbMLcHYYUaTd2agI11o99DVKLnC9na2QYWVi/LxoST90RPo+YdCm288i+SJ18aw5 6BFz94Y8RwUatNGckTnbPk6XzwZm5CzsbIcYoNEzWy4pUYM2XoxB7+5HHEWL7OXQ Z2sJc1POfOcU6h5wfZfb8LkO9s9acsG29dwyiCNUIXJwSh2PdsqnpCRIQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqrext12f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:59 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45DFdwis029870; Thu, 13 Jun 2024 15:39:58 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 3yqrext12c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:58 +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 45DEAxec023597; Thu, 13 Jun 2024 15:39:57 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yn3un0qhr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:57 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45DFdpMb55705908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 15:39:54 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A321720065; Thu, 13 Jun 2024 15:39:51 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DC672006A; Thu, 13 Jun 2024 15:39:51 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Jun 2024 15:39:51 +0000 (GMT) From: Ilya Leoshkevich <iii@linux.ibm.com> To: Alexander Gordeev <agordeev@linux.ibm.com>, Alexander Potapenko <glider@google.com>, Andrew Morton <akpm@linux-foundation.org>, Christoph Lameter <cl@linux.com>, David Rientjes <rientjes@google.com>, Heiko Carstens <hca@linux.ibm.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Marco Elver <elver@google.com>, Masami Hiramatsu <mhiramat@kernel.org>, Pekka Enberg <penberg@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, Vasily Gorbik <gor@linux.ibm.com>, Vlastimil Babka <vbabka@suse.cz> Cc: Christian Borntraeger <borntraeger@linux.ibm.com>, Dmitry Vyukov <dvyukov@google.com>, 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 <mark.rutland@arm.com>, Roman Gushchin <roman.gushchin@linux.dev>, Sven Schnelle <svens@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH v4 34/35] s390: Implement the architecture-specific KMSAN functions Date: Thu, 13 Jun 2024 17:34:36 +0200 Message-ID: <20240613153924.961511-35-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240613153924.961511-1-iii@linux.ibm.com> References: <20240613153924.961511-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: EyA2kbsVp8WqCccHu6SjxoBNfiDsWCum X-Proofpoint-ORIG-GUID: GZ2-WR2_gP5V6QUvEBJcKL9zIIoL9Eok 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-13_09,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 mlxlogscore=747 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130112 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C7ECB40017 X-Stat-Signature: 3acstpwh4knnubiwno7f6izzgo9kkkcw X-HE-Tag: 1718293206-299445 X-HE-Meta: U2FsdGVkX195ADu/gzeH936Rt9KzID+3HsAxBa+hd5fsvxfe9Ds1Yar1oFvy/2XHA8gk2mOP697+hyF4/BjWWznJD8YfCW3LIzuxnC1JB+tmeQePNTO09UzlisSIerXvYC+vkzIDVYxeDFHOEaenotuIQPuB3Bg9ujj4KNmHGnllDP0aaTrMJ1bww1XiCsi+ysg++ANDbLZELFXpwWzU17ZJWcr0drGI7pYDu1MBqASvu1Gqm0iUgOkJkYe9Z/+8AujKj6Wa+lP9VBqLjkbKLTl+3KmdEPDsnYidp8ii2XTAVRg8owchNPG95WVCADrHuFOLto0SjyE79ILq9QmR3i8ohprAE/6pTcSrKWL3jVpBuhHs1fxC5ZpY94CWyTvBi4Jgiksk8Adc7sBoq5bPjSBrIcRrdYU6wuFInB01S5I/kQEE5kPvNJGF9OoX0rvROz2SQTYiYT48B4XUGgb7jcwd9uFggE0RNZYK6z678y1h1kINa+srNKGG1jeAVDuPNBJgeBQVmrf3H7M22PS1VD/S5AbU7EinV7w5oxlyN7SW1SfSgcKgCftYZoEZYySkkIGF7I5LUcRdQEbG3TMtm/U/3LzM1LFPRVDb3oFUGw28EBpE6Q1nEFjl0gZfbMYT6C0ITylwQbKe6ydOohk1d/a2GbDqvI/uKoGtXifAL94REEw/nJM9a2hnCwoH/OloXvnqr6erZm9Wq3O7QsmO11HuUYXMll1URyLEyeCob0GLHLc12o0c/KmtjL2P0RUAucWuSG9QT7+nrirpJRPgKcSinZECM5CkUS780L9mcD026Rckg1s2n5mTd5cD3Ku37JNJVrY42dt8byHfUUdKQ4pvSicqa9bJer1ewcE8yLsZ0tkZjeV0HjEvgvG3VLZu0loIKoyjWpl73JzbmruKwtD6VHfMf8EJbayrn5LjZ5q56s2s4aQ1EPoEr3klENWx25M+8jcWrFCNKygVnjg sewvi5vU 61z4GYjavt3F1QvV3cFq5VNVj+JaSjhEeFeeitIODA31Ic0uKNP8OX5eghUn7tzdz91sU0etZVAP/tDr3NR8+wxwyk63N7ZFZPkrTZKfLMyQD2+LsGZ7C7euD4x7qnLBgOwUdqRieT1oCFpXsDB+Bnciq/1zo6FLcdedGnkHCk78uIPaB+easwZfQAqNCMIH/vMLukSo9n41Id9xrsyKBHDyIk/OpwXxn2KY8Ys9W50esIMEmRrU6P4OeD7O5db0RlAFSXUjsCGIdpiTmJsuhgN2PWg6jSQQ7I4Nt+nTFSI3Zg8mevtd2LeMOE74UUYz39GV3RIvH9erkyTWH8lEIVQLw8Hx+05d+HFxj2q5eRKH70EU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
kmsan: Enable on s390
|
expand
|
diff --git a/arch/s390/include/asm/kmsan.h b/arch/s390/include/asm/kmsan.h new file mode 100644 index 000000000000..e572686d340c --- /dev/null +++ b/arch/s390/include/asm/kmsan.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_S390_KMSAN_H +#define _ASM_S390_KMSAN_H + +#include <asm/lowcore.h> +#include <asm/page.h> +#include <linux/kmsan.h> +#include <linux/mmzone.h> +#include <linux/stddef.h> + +#ifndef MODULE + +static inline bool is_lowcore_addr(void *addr) +{ + return addr >= (void *)&S390_lowcore && + addr < (void *)(&S390_lowcore + 1); +} + +static inline void *arch_kmsan_get_meta_or_null(void *addr, bool is_origin) +{ + if (is_lowcore_addr(addr)) { + /* + * Different lowcores accessed via S390_lowcore are described + * by the same struct page. Resolve the prefix manually in + * order to get a distinct struct page. + */ + addr += (void *)lowcore_ptr[raw_smp_processor_id()] - + (void *)&S390_lowcore; + if (WARN_ON_ONCE(is_lowcore_addr(addr))) + return NULL; + return kmsan_get_metadata(addr, is_origin); + } + return NULL; +} + +static inline bool kmsan_virt_addr_valid(void *addr) +{ + return virt_addr_valid(addr); +} + +#endif /* !MODULE */ + +#endif /* _ASM_S390_KMSAN_H */