Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2466888rdb; Fri, 8 Dec 2023 08:57:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgSShQ9tOmdulxmlxCUGf8F2pO2LIuqvEZUUVk28PDhuxUQ9waBAhb14r9hU2Nohi5CXBg X-Received: by 2002:a17:902:aa90:b0:1d0:b1a0:8a30 with SMTP id d16-20020a170902aa9000b001d0b1a08a30mr302397plr.41.1702054639526; Fri, 08 Dec 2023 08:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702054639; cv=none; d=google.com; s=arc-20160816; b=qO/dHvauH8DyPJXIa+q5X5sB6i/+USQt83KScwM+eWoLfjYHt1Ms3vRDyN1uFQUz68 Acy2qkUpS9YfxEpHraaDF8EowIhBueLP0l9wkGcJ9eYKmvTxbC55o39hmwQYFHV/SAz/ KbC0hdTtytITQ/WxE85XAQu72wIa6OBmV8PxV0pAI/EGhvN/h2tymE+dFppFcgLN9/bV Ym4PXPFFwAzW2QIGm2vLfB47KhlsabB9sW/pUHeisCu+XOQzbsJn1NywhbdtCtej2xc+ E77I4yZYo/gR1NqGkSuDbW8V7jlzwZOEK8G+xgQIDwNxU7wqLWTKhyXt1KHf/MfkhOWT GSwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=p7eBdMYz2oO1gCYv2gO3b03vyzDyBixdRfjwy6xmbYk=; fh=kmKVJfn1Y9YZhlVPpqCDHuVVZsVgm/oqvGOUm8JK+fE=; b=bh1ZOTrja0RSy+Yy5ytywB0+Up2FPIWt0bjKpe6hGWOqSnaXMoQ4g6Yswn0twWmjXo ifhcy7rz3Z0xjEewdA8VfGYKUIAXD+KtJFQiRtfr5pZQTQUfzNbEsZyq3I8V2+i8wQZW 3APuffQGRuk8CJ8b+68stVP80q7BI//UgZAQPTb+pFJ3i8zlWqSBZXiEOfdDy4cs3thd 3f7di3mNqeGrr8VgohLmEEpmgcpSvEkTIwenFTOMSGQp2351MTYBULUnTAYalrcBmnEv Yx3XQPGyhpUxdoQ6+9AnesgHxnW7+IajfIlNlhLIapTeCblMM9y23WmVBWV0UNUO0ZuX 3LaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PmK2XbxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ja5-20020a170902efc500b001cfc154c64bsi1821094plb.104.2023.12.08.08.57.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 08:57:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PmK2XbxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CB91884A84D8; Fri, 8 Dec 2023 08:57:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233657AbjLHQ5C (ORCPT + 99 others); Fri, 8 Dec 2023 11:57:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232094AbjLHQ5B (ORCPT ); Fri, 8 Dec 2023 11:57:01 -0500 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94EE98 for ; Fri, 8 Dec 2023 08:57:05 -0800 (PST) Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-67acdcb3ccdso14273936d6.1 for ; Fri, 08 Dec 2023 08:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702054625; x=1702659425; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=p7eBdMYz2oO1gCYv2gO3b03vyzDyBixdRfjwy6xmbYk=; b=PmK2XbxCIv3dIWNCXiX6whjWumGAUc6xF5Vo/I/DNguZMP6/AsTyAAF33DgKQjsU69 Hy+a+8Vsqf1eFR+dvvO4N0R8iA3lHLf2z2xLk2ioso4X+JVX7PvxpNZk9aA861nTMOGC ozE1gdUK5vTQESIwfQS8jZHFUp8l9inF7ABOzL1Q06E/iNKqmcDt80fC495/+NtimrBa PkeRnJKPT8ws4rzxnaIZVHfwnvDf0NtKq+CoACtgp7v+RMfUSdJv4tCLgrf46MJ4eATg oiopZPdry7Iuxvi2BJFBMxINisVddJ4Ue5X1R7GgwP/WJppiEA2XEMD7yYx8/KMD50y0 XnBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702054625; x=1702659425; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p7eBdMYz2oO1gCYv2gO3b03vyzDyBixdRfjwy6xmbYk=; b=byfixxc3wPQTkvyudQDr2sAHGJPboDNqiCovpDI6Aug3myJype3+sDLFKtLCMs86+e ZZN78WrpAUXtBLmmZ3qC9wzpPyRZBVSj0UGJAkCi+iygJnLNQjbSRtttT9UXm8gq8HHC wrB+cURh/t42CT/+b3luVlnUoNSMtESLd/nsN5SwSGyhVdaUqBCOhsA644IdCMHtq5xj wiwDztBzzcm1/pfN5NPlffh7So60e87/ym+mlBhp+azMh3XZfasqpbWnh7vNzMeDIn53 R/vSGW0wA0d2B3QwIFMJIvztD8/++QplaHqgLwSolvNka1xB4kIMIKJ2L7VIcIbb+zFF T0Zw== X-Gm-Message-State: AOJu0YyTGJyZSwkcp23FQtkCgP0FLlMRjQ53LiMUgIvVDkdnYmW8sMao DHrNHvi6h5HHmTQ0dlklohkghatMT6SS8FFz9ByICQ== X-Received: by 2002:a05:6214:d0:b0:67a:49c5:8cc3 with SMTP id f16-20020a05621400d000b0067a49c58cc3mr269853qvs.32.1702054625028; Fri, 08 Dec 2023 08:57:05 -0800 (PST) MIME-Version: 1.0 References: <20231121220155.1217090-1-iii@linux.ibm.com> <20231121220155.1217090-24-iii@linux.ibm.com> In-Reply-To: <20231121220155.1217090-24-iii@linux.ibm.com> From: Alexander Potapenko Date: Fri, 8 Dec 2023 17:56:29 +0100 Message-ID: Subject: Re: [PATCH v2 23/33] s390/boot: Add the KMSAN runtime stub To: Ilya Leoshkevich Cc: Alexander Gordeev , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 08:57:17 -0800 (PST) On Tue, Nov 21, 2023 at 11:02=E2=80=AFPM Ilya Leoshkevich wrote: > > It should be possible to have inline functions in the s390 header > files, which call kmsan_unpoison_memory(). The problem is that these > header files might be included by the decompressor, which does not > contain KMSAN runtime, causing linker errors. > > Not compiling these calls if __SANITIZE_MEMORY__ is not defined - > either by changing kmsan-checks.h or at the call sites - may cause > unintended side effects, since calling these functions from an > uninstrumented code that is linked into the kernel is valid use case. > > One might want to explicitly distinguish between the kernel and the > decompressor. Checking for a decompressor-specific #define is quite > heavy-handed, and will have to be done at all call sites. > > A more generic approach is to provide a dummy kmsan_unpoison_memory() > definition. This produces some runtime overhead, but only when building > with CONFIG_KMSAN. The benefit is that it does not disturb the existing > KMSAN build logic and call sites don't need to be changed. > > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko