Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp254897lqs; Thu, 13 Jun 2024 09:10:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWseNWgjR56eZiMyuDap2SPp4Jqz68Qo0j2FB96rhMQcw0U38+oRZCH5e9ucOW4/+ANf5lW9bUa4FCeu6tdVKzo64pXVRlQWAlkOFv6aA== X-Google-Smtp-Source: AGHT+IE2VAzOh2O8jccTiDrScgKk/NbPnzJRbXsKLsyZ2DUFu5qYHZP5uwVjB6nlZjt9sund3gso X-Received: by 2002:aa7:8604:0:b0:704:2362:335b with SMTP id d2e1a72fcca58-705d71e3436mr92662b3a.26.1718295020118; Thu, 13 Jun 2024 09:10:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718295020; cv=pass; d=google.com; s=arc-20160816; b=KRGVcQV8wM9uGX3sEG/gtOAD8A84Ka5IRJUtB3KhZovbqFxgDHX5Wzn/sEc6l9oPmm A1ig9j5VPZi0nyoWxzSnyK/mlmfzBIGMbFvKU96RZE2bnA9YiXjin4SfPbRPh3DAbkbO S/s73oX+XXepm3lgD+WRRmvIDo511cj+7bJvxb6ajMFxYSPNFEcSo0MEhSi+zQt6lXrv BqXQBFG1L0BbLEzqFPa7IXJMukzOVMDMPUpZoLwOm52gvdZvhTm7mTHsn1ETPX4keUir AF2V2znDLyMjQrt7ngr/krEtvTz8f11iP+E5IE5tut/0W6vl2pzZTAGFweiUzkO5krsz BMKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eOJVqKOJuZasA86pPY8j/wtn7XC9Zj2RO1nXjWn3Mgo=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=LeXy+Mj40/wvHL15qLVtRZ8yT82wj08I/7//MxCp9kVHIH07M1iZUgtlTXGYAPusci JyCUCGMsLmYVF+RrJfazbuHAE6JUVCkxv0IdzX7E81qilAxgQhuVLEidgkPQ98FZ2eUx ICvsR7gMC6VZSewJ3zDYgYpWLH9EoPNqticVMbS1SjSD9BVjXCkfMLOXfNBgkfQrBcEP SdkA1ddTkGuKLfage5W4p06QnayDSQn061Pdaj6TWHq4HMKrxxLZb1Z11nqryvaR611c gRGm4vY+rFYQ9OcyuoiATNJaj4AFl87ffYw7WJ8AlodSTYM+/+/XqODZcssz0mZdK0Op BaIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BukJUSkj; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-213574-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213574-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccb3bef4si1775093b3a.179.2024.06.13.09.10.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 09:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213574-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BukJUSkj; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-213574-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213574-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2685528CA59 for ; Thu, 13 Jun 2024 15:43:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56D3A15666D; Thu, 13 Jun 2024 15:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="BukJUSkj" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47A1E14A4DA; Thu, 13 Jun 2024 15:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293216; cv=none; b=X3IIY0339TYIFY356LoqQ7vAUTLpZwm8WENUcIl9ydqbYTGrDueXw7O2IKIj0t+RPGUEe0O3Avnidn9GJ332KruhFjgcFO7Opm2PN2VYRLLXjYugXOKmyyQeTs5oeJk5LeVUCpQT5OGJtZmZONIzs8qwtJxdvrztiifIXP9TRIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293216; c=relaxed/simple; bh=bpWldg0OqAAK7JrR+6GGAQ5rFR6/NxLnlT9WzU1H6Aw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N0hV6Jko0tRJ/v9CFYM0LdkRT6vGC/QOjfI5/w3wm+IJQs8XRz+/E2aeQdjpykeeShEy57IEuWY7pZ/kCWpE6z/HKNNJGJs1SiSNlJf2Sdyuhfn+vY4dntRDbTCA13h2kmsGVVF1apC0RI5RtC0H/akIEGF8UivQtQfwh6XCr1I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=BukJUSkj; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DDU5Ym014079; Thu, 13 Jun 2024 15:39:51 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=eOJVqKOJuZasA 86pPY8j/wtn7XC9Zj2RO1nXjWn3Mgo=; b=BukJUSkjWGig/i2Pqbb+I0C4LWrZ2 sJ98mrin5N6kufEajPSUKOdUl3QZjqK/l3CkF8AqEvrKjg6IshFQERAAM0x/grxT 47mwYc5Wuj6dfPyJ1wVZzbVNSuJAL8TCmqSZSXp0fkdjktij7o0PrutEom4F106Q yQ+E8h7CA+f3/264dU4QLGmtJq0NfL5EwNW/XdDTSsChRXbJa9meYR5kHJhQ8chj cUmT7f+Lu/3jtxgwY0o3O9G92WyPhgFpNb8oDOKDx+tBGCUN4xScF+3r1j+7JUrg JRcQ58px+B7uwlShhJvlfoktSl+2gDjqA2AwoOj+auHfVlPfzffvMxy1A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yr1pa8dky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:51 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45DFdYRq029998; Thu, 13 Jun 2024 15:39:50 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 3yr1pa8dkv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:50 +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 45DEh2w7027209; Thu, 13 Jun 2024 15:39:49 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn21197ag-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:49 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45DFdhMV56033720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 15:39:45 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61C6620067; Thu, 13 Jun 2024 15:39:43 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2ADF2004D; Thu, 13 Jun 2024 15:39:42 +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:42 +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 v4 19/35] kmsan: Accept ranges starting with 0 on s390 Date: Thu, 13 Jun 2024 17:34:21 +0200 Message-ID: <20240613153924.961511-20-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 0eY3MbH0HS6MivN5xeWsj9Ia9OM8Lgw9 X-Proofpoint-ORIG-GUID: cRp1zEfmWI6SKhzVPAlyMPh3l82rIXRt 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 phishscore=0 suspectscore=0 priorityscore=1501 adultscore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=998 clxscore=1015 malwarescore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130112 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 9de76ac7062c..3f8b1bbb9060 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.45.1