Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7615509rdb; Thu, 4 Jan 2024 02:04:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOQ2X0zOKGU5CPyzb4cicb7yNZ/0GZvpS0v1THdzrwFCRa/efSBTGYHSESKliCygTpADEm X-Received: by 2002:a05:6a00:140b:b0:6d9:3f75:51d5 with SMTP id l11-20020a056a00140b00b006d93f7551d5mr315371pfu.46.1704362677556; Thu, 04 Jan 2024 02:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704362677; cv=none; d=google.com; s=arc-20160816; b=evgnFPVmH8EzhmbPKpAh880HxlHgxJSpaMTjmuoBywaJ10eQwFUJvoNQMUoLsVPFPN MTkz+PMIIwXAHQRdInasAW4ls7VFjLtDqStA8BtfaE86S7DZUqyN1RBiif5PntiELux8 1tLDT4JkTwVQQemTjCk4NDKYDeIkRGZnf85ufBEt2l4yhCoXO0w+eXl0pGIhU7BvA0Wv RIDPRTjdPWsu8TrnFlKql9Ii0GuROjKs8054amfHZcif3HCtoRHZftBwb1Yvb3XXAnNs LsfKGoYy7huBFnPVmki2tQB7XIMsowWEWE3RRSoHLx0v7Cp0HDGXbwORxJHjM/LEcNwB t8AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mEC9RU/7gJsuNRS5VA9HyG1hQ3z9kUtySW0uefqhic4=; fh=LJM85ck+xcuX9BFa5F0pKdGPbzOKut3aE0o1UEkcJfI=; b=rQ4s7nV4al98Eh1u5J7o+khEiiycvZATIYABVG29J1u3YU9XNWqXNAOvo8GnXk6uXy FCvqN1++rM6nkYdbCqgDjgowbp824z8ScQbSwDq6/O8wQWBnRg+wVWj7B4oo9EYz6wsN aqowUN+yUNXksci6vXCE8zZjffXXKXs3+hp0pYoFAQJvNxWcTBuXeMDpUaJxakIDVrk4 +3c5ds+I7FVhF6z7On3O7Pzeow3aDDve4GZyjo3cRrSwBTKSEbPd1al9BQj33tDVHgNp x8LeP+ySaFKKsSyAYByZywymPTV3C6UbKVgLhOKPKyNzDV9FMVGl5yUxdqByYG2ZAeIM KJgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=PwamUfyZ; spf=pass (google.com: domain of linux-kernel+bounces-16480-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16480-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n11-20020a65450b000000b005c6deead022si22712234pgq.603.2024.01.04.02.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 02:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16480-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=PwamUfyZ; spf=pass (google.com: domain of linux-kernel+bounces-16480-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16480-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 37634287065 for ; Thu, 4 Jan 2024 10:04:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36AA620B09; Thu, 4 Jan 2024 10:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="PwamUfyZ" X-Original-To: linux-kernel@vger.kernel.org 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 D271420B00; Thu, 4 Jan 2024 10:04:23 +0000 (UTC) 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 (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4048r1Vv014717; Thu, 4 Jan 2024 10:03:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=mEC9RU/7gJsuNRS5VA9HyG1hQ3z9kUtySW0uefqhic4=; b=PwamUfyZQwMs7zqqv7AyyQ4T/H/ZuwF2rNasPDug3qz4BcWe4HRu5C2VzK8O2nzthgtw IpjAN+oFwhnI1JsI8v0VlD2eEPeVRMFs5peKPXBAIEb18WLGyIS5m2FmtBXuz8XVEM54 RiAxrADaVI5Heg3TcSrUAcuyog3CU2Y2VzWsuXa87vQ1rd/DoH+p1uEV/qPhmGAC2MnR 0mduIbJXj8fJIuY7CwHXivFZpfoXaVQ5xipNO5Nb2UgW/CWKHgid7soEY/ZbGE/bZEeY 4u3h339KxfgLQqk2gVkSMVcDySTQhYIncIR1M8F9AMphMM9GYwxv0zVCBSP2UgUgUDtW 0Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vdsj1a7rh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jan 2024 10:03:50 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 4048sLms018434; Thu, 4 Jan 2024 10:03:50 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vdsj1a7qx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jan 2024 10:03:49 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4048PKj3024643; Thu, 4 Jan 2024 10:03:48 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3vb082g0ew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jan 2024 10:03:48 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 404A3jJr5178108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Jan 2024 10:03:45 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B53B2004B; Thu, 4 Jan 2024 10:03:45 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D71A20040; Thu, 4 Jan 2024 10:03:44 +0000 (GMT) Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown [9.171.45.37]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS; Thu, 4 Jan 2024 10:03:44 +0000 (GMT) Date: Thu, 4 Jan 2024 11:03:42 +0100 From: Alexander Gordeev To: Heiko Carstens Cc: Ilya Leoshkevich , Alexander Potapenko , Andrew Morton , Christoph Lameter , David Rientjes , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik , Vlastimil Babka , 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 Subject: Re: [PATCH v3 28/34] s390/mm: Define KMSAN metadata for vmalloc and modules Message-ID: References: <20231213233605.661251-1-iii@linux.ibm.com> <20231213233605.661251-29-iii@linux.ibm.com> <20240102150531.6306-F-hca@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240102150531.6306-F-hca@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: nbfM0juIhZleyeD13N0-vwHlSIw9D1PP X-Proofpoint-GUID: 48fRanwL7QTj7BMTM-SFy1C7v7RSY4Cv 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=2024-01-04_05,2024-01-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 mlxscore=0 suspectscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=676 clxscore=1015 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401040075 On Tue, Jan 02, 2024 at 04:05:31PM +0100, Heiko Carstens wrote: Hi Heiko, ... > > @@ -253,9 +253,17 @@ static unsigned long setup_kernel_memory_layout(void) > > MODULES_END = round_down(__abs_lowcore, _SEGMENT_SIZE); > > MODULES_VADDR = MODULES_END - MODULES_LEN; > > VMALLOC_END = MODULES_VADDR; > > +#ifdef CONFIG_KMSAN > > + VMALLOC_END -= MODULES_LEN * 2; > > +#endif > > > > /* allow vmalloc area to occupy up to about 1/2 of the rest virtual space left */ > > vmalloc_size = min(vmalloc_size, round_down(VMALLOC_END / 2, _REGION3_SIZE)); > > +#ifdef CONFIG_KMSAN > > + /* take 2/3 of vmalloc area for KMSAN shadow and origins */ > > + vmalloc_size = round_down(vmalloc_size / 3, _REGION3_SIZE); > > + VMALLOC_END -= vmalloc_size * 2; > > +#endif > > Please use > > if (IS_ENABLED(CONFIG_KMSAN)) > > above, since this way we get more compile time checks. This way we will get a mixture of CONFIG_KASAN and CONFIG_KMSAN #ifdef vs IS_ENABLED() checks within one function. I guess, we would rather address it with a separate cleanup? Thanks!