Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7526461pxb; Thu, 18 Feb 2021 12:27:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9TZY4aviRJjE1Kx+g5pN5dvYRkSN/bmctR8qVF7Np8ymnOlybEfF9cwRl6vYyffFTFl/z X-Received: by 2002:a17:907:2d8e:: with SMTP id gt14mr5725459ejc.325.1613680034403; Thu, 18 Feb 2021 12:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613680034; cv=none; d=google.com; s=arc-20160816; b=XHCRsipA1sTFgqLShOiVEgSZx4khGMFaR70BPKQcB3v03aaUt+O0TDG44AqEWF8qWV mIKt31s2H0N6F5CODIGE0hsFLvR8QW083sZQ2bfa+uULuxmBwWoFYimEGAotGGvB6sDT qmnA4bdlt+rFd5grARcfrfccdGb91utHT8RkJtjzlVJ3Sq/GMvGYTWeBm/umJqsLX6Wh DeKygVoDavV1wyUMZXwEvgobUhM08JvmUwDc16BS2aBKOBJ/lnMqjynpUETT3peM+tcx RgnJU1ph0UUhcod+YaggINnz8+CEA+M/RSogMjgnUelO8P87B+oL1aKaJ0w6Nmh38VdX g2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9RsUf6DAvJrxkKF61sw0FoJj/88tOAO5Hu0eokieYoU=; b=l0YIrdBvKi84rXLpkhFRqOodAhqW5h0mwiDcBLfkzWTEbFWoSrqBc8pYFWcfj+ymmC zZPRzM0oZFmpdfRGDqwmPBwg27dpOJNjln7fU3wW3ah3NXffxbG+Vgz/AV8c8LlhSXOI lTJ/RgYZbB0FPcqBfqO0uN8+xZfOWpMyfSEwry7T94sIYz/5RaH0x1jNX9Kk4b1aXAq+ GI8Jbh2j7q5OOYhYfrFcZsyND3wYR3M6mTctW4gWWqMTG2UYzB+Qu59F2CGFY90RvRwZ n6T176EGmIBP4o/g2M5sUZsiwcSLTrV5gOhEl7ztM3ZI+n/bAJU0JJZPdx0VcD97CF01 g2Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uVV7VcwG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si4523517ejh.391.2021.02.18.12.26.50; Thu, 18 Feb 2021 12:27:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uVV7VcwG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbhBRU0C (ORCPT + 99 others); Thu, 18 Feb 2021 15:26:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230199AbhBRUZl (ORCPT ); Thu, 18 Feb 2021 15:25:41 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 794E0C061574 for ; Thu, 18 Feb 2021 12:25:01 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id o63so1878748pgo.6 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=iw5yrrsX7cV0Wn0S28zz0OS/rSgdoIPw5mUcTn6m+LxnAW9/fJAfvWxZXYghpkS+Gi 9A9INkP7Gdlvbm6eDki13cWwPvYL4Ha2oyb5ikAB4AVXjstJOIPOPVu0VSHRbyY7yZCM JxIafoQ8SLyi4KUkTWkJWtAvycXvONdFD5PTQASE9Eo14EGWzkg/Bk3Awif2x/X+LHlw PgNZSIjYkpGTujl0Jamh+6KFMQNzmqyJgjEUvKkTZtcKlFfBUIZWdVW79vLW1XMIbUYb w5Z0692YzgRcHzr8M6HWC0+stQ5IMngpLSGmuXcnqxEm97YTMeALn8EOhQkKRCNvc2t+ Shzw== X-Gm-Message-State: AOAM530e7VSGhEiZeaTA8M4/RhKa6Tu20wp8CWtRP1zmQItlaf1uG0Tp GiNzNHSMdhmFrR4JKkM5oj0M0D+Gswi8/SLgPCVdwA== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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