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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 36D97C2D0A3 for ; Wed, 4 Nov 2020 13:07:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7FAC2071A for ; Wed, 4 Nov 2020 13:07:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aIqyO20A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7FAC2071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AaCTyWgbs6WwTzFx5FVQmaj6AKdNoXS1V2CfF6m/jps=; b=aIqyO20A6ClsBSlsuVchdim77 U0VWn6sWkoUJYz6TdWYGjv669mt3GpUrmTL2VlsY0nbWCRoJPhOkqa/JgiLcx8iINhPezv4Zx4r+v sW9X6SbGJoTzwL3nqQg7B5tPpuPBQq0IJwd5C/0MxmjqVOEiH7Dhx8FnMEd1md6VQ87UiKARozYUs UV4mDtmhE6l8oCR/Wwe36/Gh7BnamtNoAlkFASJbFob/Zh8e1UtVGWwFQ8lDCdhlEyavFe/QPwaP6 zcWW842ACi0MP8U1uJi+DwDJbtkpZISJyigX7Bi18Tg83kCGepfjaPjBhXM9mygCLideL1yfGfObW HVPH8nmNA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaIV8-0006ra-2q; Wed, 04 Nov 2020 13:06:58 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaIV4-0006pp-Mq for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 13:06:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F721139F; Wed, 4 Nov 2020 05:06:51 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.57.109]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29D1D3F719; Wed, 4 Nov 2020 05:06:46 -0800 (PST) Date: Wed, 4 Nov 2020 13:06:37 +0000 From: Mark Rutland To: Marco Elver Subject: Re: [PATCH v7 3/9] arm64, kfence: enable KFENCE for ARM64 Message-ID: <20201104130111.GA7577@C02TD0UTHF1T.local> References: <20201103175841.3495947-1-elver@google.com> <20201103175841.3495947-4-elver@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201103175841.3495947-4-elver@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_080654_817933_B04CE8CC X-CRM114-Status: GOOD ( 18.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hdanton@sina.com, linux-doc@vger.kernel.org, peterz@infradead.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, linux-mm@kvack.org, edumazet@google.com, glider@google.com, hpa@zytor.com, cl@linux.com, will@kernel.org, sjpark@amazon.com, corbet@lwn.net, x86@kernel.org, kasan-dev@googlegroups.com, mingo@redhat.com, vbabka@suse.cz, rientjes@google.com, aryabinin@virtuozzo.com, joern@purestorage.com, keescook@chromium.org, paulmck@kernel.org, jannh@google.com, andreyknvl@google.com, bp@alien8.de, luto@kernel.org, Jonathan.Cameron@huawei.com, tglx@linutronix.de, akpm@linux-foundation.org, dvyukov@google.com, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, penberg@kernel.org, iamjoonsoo.kim@lge.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 03, 2020 at 06:58:35PM +0100, Marco Elver wrote: > Add architecture specific implementation details for KFENCE and enable > KFENCE for the arm64 architecture. In particular, this implements the > required interface in . > > KFENCE requires that attributes for pages from its memory pool can > individually be set. Therefore, force the entire linear map to be mapped > at page granularity. Doing so may result in extra memory allocated for > page tables in case rodata=full is not set; however, currently > CONFIG_RODATA_FULL_DEFAULT_ENABLED=y is the default, and the common case > is therefore not affected by this change. > > Reviewed-by: Dmitry Vyukov > Co-developed-by: Alexander Potapenko > Signed-off-by: Alexander Potapenko > Signed-off-by: Marco Elver Thanks for dilligently handling all the review feedback. This looks good to me now, so FWIW: Reviewed-by: Mark Rutland There is one thing that I thing we should improve as a subsequent cleanup, but I don't think that should block this as-is. > +#define KFENCE_SKIP_ARCH_FAULT_HANDLER "el1_sync" IIUC, the core kfence code is using this to figure out where to trace from when there's a fault taken on an access to a protected page. It would be better if the arch code passed the exception's pt_regs into the kfence fault handler, and the kfence began the trace began from there. That would also allow for dumping the exception registers which can help with debugging (e.g. figuring out how the address was derived when it's calculated from multiple source registers). That would also be a bit more robust to changes in an architectures' exception handling code. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel