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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 28C0AC2D0C9 for ; Thu, 12 Dec 2019 13:41:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E21082077B for ; Thu, 12 Dec 2019 13:41:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="GdElbodE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E21082077B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7D6648E0006; Thu, 12 Dec 2019 08:41:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 787988E0001; Thu, 12 Dec 2019 08:41:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69D008E0006; Thu, 12 Dec 2019 08:41:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id 50FD08E0001 for ; Thu, 12 Dec 2019 08:41:20 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id E1D6D8249980 for ; Thu, 12 Dec 2019 13:41:19 +0000 (UTC) X-FDA: 76256601078.07.lift63_b9421a26ee26 X-HE-Tag: lift63_b9421a26ee26 X-Filterd-Recvd-Size: 4023 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Dec 2019 13:41:19 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id w5so1046287pjh.11 for ; Thu, 12 Dec 2019 05:41:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=K1dcdOatOeVeFsIQxT5aEB0ANkvhzz2V9qjht9zfLUs=; b=GdElbodEdxjlTrBwa3I6J+sEs4W2s8EoeCX3lxYPy4O5JSwTyZcODXGJSRA1xj4/Th 5RtnvwUWSB2afNeAL6+3jSXcezJ6aTZ2Ul1yCG9FnmvdgLq0A/BabGqxJQXU4aLQibFm sZaLkJC5i3jZy2lEJbSUwiAQSB4z7dLoQktt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=K1dcdOatOeVeFsIQxT5aEB0ANkvhzz2V9qjht9zfLUs=; b=noQ9zGORNTKi5NdAq3huAOMcR/SeL5NpRYiPN2z+S7U8J5XYz65tHIUNB+WKhfwxFz NIxfrOKE5MbNdTq0+lSZW2kqgLwIiPBOXRQ/gG1fUNcrVYmT8wwOFnvPNPODtXtqmBLZ FPOponpZBpfI5ooMoZtilhhdDNtDNCkTggZuk5FDkkoeKHfAyZ4AAHPW4ttgAGcsV/Ig 5eMLX+XY7/02ItlfilizHYxOhbVDv0FL5KqO8qjDUPFVCPsHJs8AC9+Mwfo6t+7JO8F1 QdiC/oSFi75zyixstwsKYw460QOagFyPpWKMop/wga2LGnclT9sbaaQa5T11gy38USvM SUJg== X-Gm-Message-State: APjAAAXpTx3ejsxZ+hds9+dJ4Rkn2PT6ZyaE0LKGaFylMAadOgUN3xvM 6ChTQ/wOZRG5nY2AIGe/S/O9Qg== X-Google-Smtp-Source: APXvYqzPs6Cbt1MwcGO7Ifn/65S78x+5CnY2vxScmtjpazHyalO6+YCcj2OzBuBrETruOG5iKaL2pw== X-Received: by 2002:a17:902:9885:: with SMTP id s5mr9457771plp.217.1576158078207; Thu, 12 Dec 2019 05:41:18 -0800 (PST) Received: from localhost (2001-44b8-1113-6700-b116-2689-a4a9-76f8.static.ipv6.internode.on.net. [2001:44b8:1113:6700:b116:2689:a4a9:76f8]) by smtp.gmail.com with ESMTPSA id i68sm7464966pfe.173.2019.12.12.05.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 05:41:17 -0800 (PST) From: Daniel Axtens To: Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kasan-dev@googlegroups.com, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com Subject: Re: [PATCH v2 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support In-Reply-To: <414293e0-3b75-8e78-90d8-2c14182f3739@c-s.fr> References: <20191210044714.27265-1-dja@axtens.net> <20191210044714.27265-5-dja@axtens.net> <414293e0-3b75-8e78-90d8-2c14182f3739@c-s.fr> Date: Fri, 13 Dec 2019 00:41:14 +1100 Message-ID: <87tv65br0l.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain X-Bogosity: Ham, tests=bogofilter, spamicity=0.000008, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Christophe, I think I've covered everything you've mentioned in the v3 I'm about to send, except for: >> + /* mark early shadow region as RO and wipe */ >> + pte = __pte(__pa(kasan_early_shadow_page) | >> + pgprot_val(PAGE_KERNEL_RO) | _PAGE_PTE); > > Any reason for _PAGE_PTE being required here and not being included in > PAGE_KERNEL_RO ? I'm not 100% sure quite what you mean here. I think you're asking: why do we need to supply _PAGE_PTE here, shouldn't PAGE_KERNEL_RO set that bit or cover that case? _PAGE_PTE is defined by section 5.7.10.2 of Book III of ISA 3.0: bit 1 (linux bit 62) is 'Leaf (entry is a PTE)' I originally had this because it was set in Balbir's original implementation, but the bit is also set by pte_mkpte which is called in set_pte_at, so I also think it's right to set it. I don't know why it's not included in the permission classes; I suspect it's because it's not conceptually a permission, it's set and cleared in things like swp entry code. Does that answer your question? Regards, Daniel