From patchwork Fri Jun 21 00:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13706589 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 9FBD7C2BA18 for ; Fri, 21 Jun 2024 00:28:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F113A8D010B; Thu, 20 Jun 2024 20:27:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E73AB8D0108; Thu, 20 Jun 2024 20:27:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C506D8D010B; Thu, 20 Jun 2024 20:27:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9A3448D0108 for ; Thu, 20 Jun 2024 20:27:15 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5BE71140696 for ; Fri, 21 Jun 2024 00:27:15 +0000 (UTC) X-FDA: 82253006430.24.99753EE Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf26.hostedemail.com (Postfix) with ESMTP id 31978140006 for ; Fri, 21 Jun 2024 00:27:13 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=CpVjcAR0; spf=pass (imf26.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=1718929620; 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=hop8BCpVSniaFM1MpaXvqCFGVqZnzKhq9StiRXmewRE=; b=hQXqVUHtgkrtbFfaCD58tGoQF7gwwX8b8d49VX5+qVKUiXnsn7fjQa8jKf8tJaeY3i7klW V4HvPBKWH1vAGPEXCGs2gnKVKhIquGRrv6zFJ+sOrCPle/z4fo7FmxuZ3bCNAiPQzfT4ut uOvIVlXtE6fX+ImIIn/u1n3L+Q8gdpU= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=CpVjcAR0; spf=pass (imf26.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=1718929620; a=rsa-sha256; cv=none; b=5gS6UBH7UagpFIW1tCihM8GaxhiDcJEaWus2xlEpHnVf2daNo4tKSBiuCeuznx0zg0zdEw dUKw8MmYon6Wh3+JR8TrhE4a08BSpO6sEK5fZGh1OPLbO/NThde6Ori7cT51A1NNE5kwoj 9p89auhf7Zwa9v7pRDi9p6TQwmZ63Rk= Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L0QZfW022585; Fri, 21 Jun 2024 00:27:07 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=hop8BCpVSniaF M1MpaXvqCFGVqZnzKhq9StiRXmewRE=; b=CpVjcAR0OosZ+FQKvo8Jt1i1ShciW NC5NUYX6ovbPR0EhliBF9Qb655atP4PZX5N4DlLuKNKwQDQ8wNwBP7xnzeEtKHJZ eDBa9JXexUaC70+QolO/rHSeHJFDr8zvCdnFDX2ZY7VytXmVGKuBL7TwVGyfprAx 6EwH2gcc6rnckKj1HnyOHBe12aMzjxtKW6RK9T4tGHaopCFZo3ycBmNwAgY4+3MF 79lmxIJPWcuP10J4wCpKrWpN0FvyscQq9DDNu+WdDM5zj+anGyOBGm8rU0R51TEe UAQaHxcjva3oSw3RNbkhAiwvhZzpKw6gXjYKhe5La3fPrG3GE74isni9w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yvvs6g7t0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 00:27:06 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45L0R5ij023521; Fri, 21 Jun 2024 00:27:05 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 3yvvs6g7sw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 00:27:05 +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 45KLcZY4030993; Fri, 21 Jun 2024 00:27:05 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrsstn3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 00:27:04 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45L0QxY857213382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 00:27:01 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2AC832004B; Fri, 21 Jun 2024 00:26:59 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AA3520043; Fri, 21 Jun 2024 00:26:58 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.10.44]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jun 2024 00:26:57 +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 v6 32/39] s390/ptdump: Add KMSAN page markers Date: Fri, 21 Jun 2024 02:25:06 +0200 Message-ID: <20240621002616.40684-33-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621002616.40684-1-iii@linux.ibm.com> References: <20240621002616.40684-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: D7iiuOSKyPIFLwMOccTbCBPFEbLUtDDO X-Proofpoint-GUID: opa2CPcd6-_OVWf6pOKSPr_YpfqQEXBE 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-20_11,2024-06-20_04,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 phishscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210001 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 31978140006 X-Stat-Signature: z1jmxnjre1g884otbpbpkr6js6psj858 X-Rspam-User: X-HE-Tag: 1718929633-419053 X-HE-Meta: U2FsdGVkX18eGZXoYPxLM1VK5P7K8NhuyG9YQAIsd552HbBxOti105dkS4YUbZhHh99HZBgfeoSYSTSkiFhe1O2+zHFtkbfnj/A37rR23dL7WV6kRTjcBrVOCDxG+mj+tVX/aWcbLp3owg9nGmgl5tW2e4OK/ziK26FmTU4ECayfBdvB+qa5PhRj9hAm8ZNe84vU0EYuTyRUoNEUsvkwtRKPwl8wAxoTmAWps6HUlS78zK1WUoKYr5uMrnuAZPSWRkksau3Sg47YhzwPhBsVSS3EhrRQ4upvhvcHJCp/y55WykpadARlKwiSZf+AcvkyGtixiEWPOWxCiiv9D7TFVcSTS4oq1RdIRasUlAP+mcikvRrY/oDRIE/Pnv7kzV8iCGvzNamIki9P69UU+Kc9llxpvSkq5Ssa0ERI7B9CTUpQm8rK6yEiaRa6QABDlFnPMFWOqp2M8w0CygzCfiJEf8HGF3CmtpkzoPxo/gLo3Coy/eqqSvSlA0Ae2dvqtvqZrtoqweo6wA0fKxzJHSbq58hKw26g/gyDcT5hhVdQ3nkdR2jg8a8u5mb1HQy9fLwywpHSrGg/ZbNPGt58ywLJwyIN++S4AoLXzefLv+MWUG/Nhfq/wrxxWoyWGUFnWXXNZLGOmndw98ay5VBZ3/14gwg0+lRjTo00MuEOF3YlN41zbCqjbCCjPNnYqMxM/VESLYclm8ESfHvZEAsTaF4IlzTLZL2Soc2+Rw+JvYKcLCsgTYy3zdJxgTwPb6L6DoEY7U/Zxq30Y+FhnE83yJ4NJki5Xo1ecz/qgQXglL1pqoJBJNRRWrD9bFtLmf/ao5jTFrbFZdKZ84Tky1gp+jx/eAtBBuW+cLATFKwWyNg74GArHkk47EEnEW0X8+LCX4w1nviHpQuZBz5F3NSCZHm/swAeTZJt6TAAvNqS3O/CItfUEhyzSFShDSnwrgZt7esXsBeGkfJRxSG5mdmNhDB Oz0AAWxq qashX7LCtqz5vRCFUiBVBc5fVIshwWn6Xkix23YQJiX6HL8L4Afxa2dDnNYsB9y4IdHdg6OPBy+btTdn7aGavqCx8Uj3Zi6IF49WMHNo12/dEODWAgj01LdUG2vm754Gt3+Vku5XRZLwHRAY82GUzXJLnTHIq9cLjJ9vcM0jkUM1IFiuNLhWZ9o+mUCGBpZLf4MHg4XcxVzBWYV87WdTHeDEW+z3J7RLOfI5Jdu6Jru/AdBuvs6L0JCHHhYNqNg7x9JXP 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: List-Subscribe: List-Unsubscribe: Add KMSAN vmalloc metadata areas to kernel_page_tables. Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko --- arch/s390/mm/dump_pagetables.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/s390/mm/dump_pagetables.c b/arch/s390/mm/dump_pagetables.c index ffd07ed7b4af..f51e5d0862a3 100644 --- a/arch/s390/mm/dump_pagetables.c +++ b/arch/s390/mm/dump_pagetables.c @@ -36,6 +36,16 @@ enum address_markers_idx { VMEMMAP_END_NR, VMALLOC_NR, VMALLOC_END_NR, +#ifdef CONFIG_KMSAN + KMSAN_VMALLOC_SHADOW_START_NR, + KMSAN_VMALLOC_SHADOW_END_NR, + KMSAN_VMALLOC_ORIGIN_START_NR, + KMSAN_VMALLOC_ORIGIN_END_NR, + KMSAN_MODULES_SHADOW_START_NR, + KMSAN_MODULES_SHADOW_END_NR, + KMSAN_MODULES_ORIGIN_START_NR, + KMSAN_MODULES_ORIGIN_END_NR, +#endif MODULES_NR, MODULES_END_NR, ABS_LOWCORE_NR, @@ -74,6 +84,16 @@ static struct addr_marker address_markers[] = { #ifdef CONFIG_KASAN [KASAN_SHADOW_START_NR] = {KASAN_SHADOW_START, "Kasan Shadow Start"}, [KASAN_SHADOW_END_NR] = {KASAN_SHADOW_END, "Kasan Shadow End"}, +#endif +#ifdef CONFIG_KMSAN + [KMSAN_VMALLOC_SHADOW_START_NR] = {0, "Kmsan vmalloc Shadow Start"}, + [KMSAN_VMALLOC_SHADOW_END_NR] = {0, "Kmsan vmalloc Shadow End"}, + [KMSAN_VMALLOC_ORIGIN_START_NR] = {0, "Kmsan vmalloc Origins Start"}, + [KMSAN_VMALLOC_ORIGIN_END_NR] = {0, "Kmsan vmalloc Origins End"}, + [KMSAN_MODULES_SHADOW_START_NR] = {0, "Kmsan Modules Shadow Start"}, + [KMSAN_MODULES_SHADOW_END_NR] = {0, "Kmsan Modules Shadow End"}, + [KMSAN_MODULES_ORIGIN_START_NR] = {0, "Kmsan Modules Origins Start"}, + [KMSAN_MODULES_ORIGIN_END_NR] = {0, "Kmsan Modules Origins End"}, #endif { -1, NULL } }; @@ -306,6 +326,16 @@ static int pt_dump_init(void) #ifdef CONFIG_KFENCE address_markers[KFENCE_START_NR].start_address = kfence_start; address_markers[KFENCE_END_NR].start_address = kfence_start + KFENCE_POOL_SIZE; +#endif +#ifdef CONFIG_KMSAN + address_markers[KMSAN_VMALLOC_SHADOW_START_NR].start_address = KMSAN_VMALLOC_SHADOW_START; + address_markers[KMSAN_VMALLOC_SHADOW_END_NR].start_address = KMSAN_VMALLOC_SHADOW_END; + address_markers[KMSAN_VMALLOC_ORIGIN_START_NR].start_address = KMSAN_VMALLOC_ORIGIN_START; + address_markers[KMSAN_VMALLOC_ORIGIN_END_NR].start_address = KMSAN_VMALLOC_ORIGIN_END; + address_markers[KMSAN_MODULES_SHADOW_START_NR].start_address = KMSAN_MODULES_SHADOW_START; + address_markers[KMSAN_MODULES_SHADOW_END_NR].start_address = KMSAN_MODULES_SHADOW_END; + address_markers[KMSAN_MODULES_ORIGIN_START_NR].start_address = KMSAN_MODULES_ORIGIN_START; + address_markers[KMSAN_MODULES_ORIGIN_END_NR].start_address = KMSAN_MODULES_ORIGIN_END; #endif sort_address_markers(); #ifdef CONFIG_PTDUMP_DEBUGFS