Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp833780ybl; Thu, 12 Dec 2019 05:42:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzctZyzQsua4o0ot2HxfgQY3aEr3puPPybwqo+hweGsrEypAuVo6o6vFBGbBtiMGYoVQYUo X-Received: by 2002:a05:6830:1e81:: with SMTP id n1mr7899603otr.53.1576158138116; Thu, 12 Dec 2019 05:42:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576158138; cv=none; d=google.com; s=arc-20160816; b=aEKeLS8yj5bXyb48pEPfjU0BiSLD33DRUZmcLbB0R54J1vcu0JyM5Gc9DQ4ZwBnGTd lV2TuSNtR7qXBnodsDzDSNcj/G0g/vwgnCvfhN4xXkYH0kHG1YSQyjBnCUnHAPmYabQU i6xqaP4BXDjxv34jqmszPj0oCFG84ChSiEG8o69SxB3eACamdmlYS6Px+l6jV9TQITsM HkMtXOOKwWOvssPZPX4fq192yk5i1C2FcqYr+cp7lx19OHXeFkp8+hTlDFE8EWE40Ajy R8z07IRU0YdkJmjPLSAMpyqU+xtRWx0dKiY9LVKOd21sBOLcHZi9sdOMGi/uRhPQk2Cc yfSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=K1dcdOatOeVeFsIQxT5aEB0ANkvhzz2V9qjht9zfLUs=; b=ojJgtskRcKYyMxyQOkYoW2bOeNfMXVLVsZcELuVo4NQ7xnVXy87HbNWqxyux1ooaae OGy7cAc64mF4IlpO+8lOW8WgAAv9/+D6MGgyrEMaDGVW/uoV75fP5sn200XbJQlGGj76 GP+z+xinpEPC8Xjs4+SopqByamKCNVS9/xaPvSOYThJabdR0ALalnma9BHN7GPChYGQi W9pYiZt9fklZsoIEgyZs8pk9c1n7d4k0vKY46nnsmaYiNhn70Z9MsZHXwSWUa3Px7qwn Z8bzQsJjpAszz1CQ0PugYLOBMmuSQs37Zdr9K8hagHBjWge0TtYV2CDuE2M8pXwynhjD lJ2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=GdElbodE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si3271289otd.109.2019.12.12.05.42.05; Thu, 12 Dec 2019 05:42:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=GdElbodE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729527AbfLLNlT (ORCPT + 99 others); Thu, 12 Dec 2019 08:41:19 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:43783 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729429AbfLLNlS (ORCPT ); Thu, 12 Dec 2019 08:41:18 -0500 Received: by mail-pj1-f66.google.com with SMTP id g4so1048207pjs.10 for ; Thu, 12 Dec 2019 05:41:18 -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=eq/l1C0NSGLFX431zY8p6/F3eEK/yFATW6GMrSWpxbwcprNf7FZQCnI/aE6YyAwh46 JU8/l4wKRZOejQG1yUno2sCXNg/WqXlqs7VJLWaT5FIa73dxvcWn5Uf3/9TJlFkGd2U6 BEbUvB1adY/wbNLh07Elry3pP8YWirtohaWc3uS7k2mV50Kj7/MJoIiM86UueVKnePz6 PHKPViUznnQtTZge2/w7uU7Cpufb0SpwhvA5NI5I2S4aGMBYRLqLrwV8KzqyFxfzgRh2 89ljzP8nho2LVcB6/c/xsiMWm3xE4Hb2+/TbAjRQpjZY5O98BZHGeDRvShCwbq09h2ix Pnow== X-Gm-Message-State: APjAAAVGQ9nBzlJo388+sEdWWtFQcHWLSt//n69ENklxQh2b55dbkakt h7f1byYcBOtUNe3f0OYrCfR00Q== 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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