Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5654313rdb; Wed, 13 Dec 2023 15:37:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEL5rxiHIa4v/oe3MsqX/qUPPwBw23H7FTt9DLqr8pIyzvbCm4USzqwpI8AayrOe96Hbl0A X-Received: by 2002:a05:6870:f20e:b0:1fb:2188:5b96 with SMTP id t14-20020a056870f20e00b001fb21885b96mr10961482oao.24.1702510671040; Wed, 13 Dec 2023 15:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510671; cv=none; d=google.com; s=arc-20160816; b=R+Mz//0NSswuEQCcmNEcfqGOtK/LRDH0M07M9YEoL9G6IKCMx6qNRZTgQ1mlwFHyU7 89doRJo9FLOpyBEVdT5TVrFKFvbvbP8peCWbnswEXcUoC/9OTbdTv+ALDYFVowpJthVM M0wnMqWC3h7aRDuSkogseVcvcomo7pn//PpCs/o0Rpri7ZEzN1tDeCw/CaPTcsSv7zRB xjj3x2VRfBO/AtNxd05NiRCqlKruOs9M2I2mk7P9KM6gdCOpSXz4cyH8t2NIvZyb9frv U4VvVJI/j5lVk/T+nZJ4+1Ym9HvjxBWS05XqhQNgXHVG1r9fQCEkj0h0rWA8kKCHTGm9 bKDA== 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=N2VaTm6j283+4VwN//hURwYHK/YhopDpRgkaZ9Xc+7w=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=i7DkdBSGzq79hugUitZ+NgHYbarfEQYr8z+utfQmfQ0/b1Jc5rxJ7xINB+zYP3TsXs u9pPcOrDZ4rb3uGAdehmaNdyUuTfxgsjFPiEUCnu+fi4+C/3lnvdYBQ3OgkA75fSf5yD yVx2kG8SZM+xIiSUCWJiFXNc/TY22YiMR/+Y3SFeB2XirFFXtRxIyg8GJHNanX5Jt4QG zIptu8PA8oqUwP4eZ06CeyTPbX1ydULGA9viw4MIW22cvGo3CtFyRmzinkPkPu7t0B1U SG7GmVkzXH1zXrRguC6JRqSmxF4jFgmr9m+J3dk0TfteEVuq4Mb9PSI8qkdX/K9Y9+2S omyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iR+7Or7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p20-20020a63fe14000000b0059d48c43152si10377709pgh.40.2023.12.13.15.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:37:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iR+7Or7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 CF699802F55A; Wed, 13 Dec 2023 15:37:46 -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 S1442931AbjLMXhV (ORCPT + 99 others); Wed, 13 Dec 2023 18:37:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442754AbjLMXhE (ORCPT ); Wed, 13 Dec 2023 18:37:04 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23ABF182; Wed, 13 Dec 2023 15:37:04 -0800 (PST) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDKfjZw013021; Wed, 13 Dec 2023 23:36:43 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=N2VaTm6j283+4VwN//hURwYHK/YhopDpRgkaZ9Xc+7w=; b=iR+7Or7YdXWiP0cRh8mmEvW20/46so1iauaAzWrGF5pWT3F6B8ispajfo+rM+A/i4GXi NARmXniCxGDHFis6+XTxhrSeVZJHAm1KX5HKlPY+uzoitBksMKMAwwb8Mts387I7wo0+ SFFBLvtZ1hqCpnfAkgf9mmHzBFuoIGfJdFUJpXD0VYMZQw9XEf6JBOnOvU/zVtJdrqzv +gpXbNuGTFCPXgeyHkAwEiWkfsZJ932iiYINyPZiOpxHGoA5bvqSxE7TrbxFlZxsP76A sDKnlKBYRlPtm3zmqx4J44uQpzwnU8smaSDyvU1g8B9+10kbhDb7BUMSo+4AIkKwSUZr gg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uyjg35xnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:43 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BDNSl2V015630; Wed, 13 Dec 2023 23:36:42 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uyjg35xmw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:42 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDN0HV2014803; Wed, 13 Dec 2023 23:36:41 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw42kg1xp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:41 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BDNacXs44237494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 23:36:38 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E859120040; Wed, 13 Dec 2023 23:36:37 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7C47620043; Wed, 13 Dec 2023 23:36:36 +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:36 +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 18/34] kmsan: Accept ranges starting with 0 on s390 Date: Thu, 14 Dec 2023 00:24:38 +0100 Message-ID: <20231213233605.661251-19-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-ORIG-GUID: cPCpBguRX25yk0cY5HbnO3wP8bPYoaUi X-Proofpoint-GUID: tWEK5BHWwLFqmCkK5VSnrvyWkz9szQAT 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 clxscore=1015 impostorscore=0 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=993 adultscore=0 malwarescore=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:37:46 -0800 (PST) On s390 the virtual address 0 is valid (current CPU's lowcore is mapped there), therefore KMSAN should not complain about it. Disable the respective check on s390. There doesn't seem to be a Kconfig option to describe this situation, so explicitly check for s390. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/kmsan/init.c b/mm/kmsan/init.c index ffedf4dbc49d..7a3df4d359f8 100644 --- a/mm/kmsan/init.c +++ b/mm/kmsan/init.c @@ -33,7 +33,10 @@ static void __init kmsan_record_future_shadow_range(void *start, void *end) bool merged = false; KMSAN_WARN_ON(future_index == NUM_FUTURE_RANGES); - KMSAN_WARN_ON((nstart >= nend) || !nstart || !nend); + KMSAN_WARN_ON((nstart >= nend) || + /* Virtual address 0 is valid on s390. */ + (!IS_ENABLED(CONFIG_S390) && !nstart) || + !nend); nstart = ALIGN_DOWN(nstart, PAGE_SIZE); nend = ALIGN(nend, PAGE_SIZE); -- 2.43.0