From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA804C433DB for ; Thu, 18 Feb 2021 20:25:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4B58C64EDB for ; Thu, 18 Feb 2021 20:25:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B58C64EDB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AB8536B0006; Thu, 18 Feb 2021 15:25:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A41DD6B006C; Thu, 18 Feb 2021 15:25:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 909246B006E; Thu, 18 Feb 2021 15:25:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id 77FED6B0006 for ; Thu, 18 Feb 2021 15:25:02 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 27454181AC9C6 for ; Thu, 18 Feb 2021 20:25:02 +0000 (UTC) X-FDA: 77832517644.01.1736440 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf20.hostedemail.com (Postfix) with ESMTP id B7F3EEB for ; Thu, 18 Feb 2021 20:25:01 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id m6so2098177pfk.1 for ; Thu, 18 Feb 2021 12:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9RsUf6DAvJrxkKF61sw0FoJj/88tOAO5Hu0eokieYoU=; b=uVV7VcwGIlSKFaUa7b1aPfbOLYPEfFHJZjj2DUI9bay30pC6eh7kLqB7j+hN77IW1J QRpm0h2wCf5MdhX65mp4sfhgOfmykbNlA2giUJXS58Yohq8NXBFc3FCTy4of89FlUVgx D3JZz5LP8iiPJLxZPYPonijMJ4MlkgWJrgBUmIDWtU4lthjQHLQdOKQfyDXQBOBKoRJz VBsjzz8BnWoMaNDReGmOVhZe2YM15NWr/q6Kx2CcJxOYVF8C30S1TjVTJ9S+wy2Shb9F AT276VJHaV61fbpvMMwX4aAX6/3A/A49G3Vb7j9wQUsyp+suvODbQHNwhE3xxJ+abv01 tp2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9RsUf6DAvJrxkKF61sw0FoJj/88tOAO5Hu0eokieYoU=; b=PJzblmTh4duf0Qj0s4W1Puyildv31n/ZDSlSGc1Df8vlVOdGsUCBqCvdIrdWObnUH6 dAbkzykwmtPm+BVaCiWPWFVeEfzFNbV1JzN8v0e2Zd0X8ASld9H80TAUhFoSX4Ffnd9F rnNmIwMeOjYS4nT5GkIRQHO6IHPx5xIULo0MH/Uxp7wK9/ALUOXi3iSSza0ZRkHBziWR ADzozHHjAVkrpL0y1AVsSNu4DuAmDoImypHbqOvUDV9ZyiwG3iZ9ytCqbF/eDt9SSi10 OsQpsF8hCWPUCpRIeBB/M+40OTQ33AEm2C//N34+AdpsPGNvFnLXUq+SXoeswD/Ka0Ly W/SA== X-Gm-Message-State: AOAM530TCUiuN7Xek+OBMDFn41e4JzyIql+u0XkJsAp9+A4RwTuGMsEP YkLs2OZNCkxIUJhMgRv0lbREh96CeLbSlYCn4+n6aw== X-Google-Smtp-Source: ABdhPJywjrf+b1Rc115u0wbcv6nZm+Atkfxa49e5vcQLUu9ZBgUmwsWyhbMRPwrI2sTUXDa54lPZ0kFlephrZN9+V7s= X-Received: by 2002:a63:416:: with SMTP id 22mr5353156pge.286.1613679900548; Thu, 18 Feb 2021 12:25:00 -0800 (PST) MIME-Version: 1.0 References: <8d79640cdab4608c454310881b6c771e856dbd2e.1613595522.git.andreyknvl@google.com> <20210218104626.GA12761@arm.com> In-Reply-To: <20210218104626.GA12761@arm.com> From: Andrey Konovalov Date: Thu, 18 Feb 2021 21:24:49 +0100 Message-ID: Subject: Re: [PATCH RESEND] mm, kasan: don't poison boot memory To: Catalin Marinas Cc: Andrew Morton , Vincenzo Frascino , Will Deacon , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Peter Collingbourne , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Christoph Hellwig , kasan-dev , Linux ARM , Linux Memory Management List , LKML , David Hildenbrand , George Kennedy , Konrad Rzeszutek Wilk Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B7F3EEB X-Stat-Signature: 4ap11yj1hetykq6g8583s845roeu79jx Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf20; identity=mailfrom; envelope-from=""; helo=mail-pf1-f179.google.com; client-ip=209.85.210.179 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613679901-759347 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 18, 2021 at 11:46 AM Catalin Marinas wrote: > > The approach looks fine to me. If you don't like the trade-off, I think > you could still leave the kasan poisoning in if CONFIG_DEBUG_KERNEL. This won't work, Android enables CONFIG_DEBUG_KERNEL in GKI as it turns out :) > Reviewed-by: Catalin Marinas > > Just curious, have you noticed any issue booting a KASAN_SW_TAGS-enabled > kernel on a system with sufficiently large RAM? Is the boot slow-down > significant? When booting KASAN_SW_TAGS in QEMU with 40G there's a noticeable start-up delay compared to 2G, but it doesn't seem to be caused by this memblock->page_alloc poisoning, as removing it makes no noticeable difference. I also don't see a noticeable "hang" when booting KASAN_SW_TAGS in FVP, compared to the one I see with KASAN_HW_TAGS. But I do see a "hang" in QEMU when going from 2G to 40G with KASAN_HW_TAGS. It seems that doing STG is much more expensive than writing to the shadow memory. > For MTE, we could look at optimising the poisoning code for page size to > use STGM or DC GZVA but I don't think we can make it unnoticeable for > large systems (especially with DC GZVA, that's like zeroing the whole > RAM at boot). https://bugzilla.kernel.org/show_bug.cgi?id=211817