From patchwork Wed May 18 10:03:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 1632726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=LOb3V4kO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L37yP60Zdz9sG5 for ; Wed, 18 May 2022 20:09:49 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4L37yP2ybTz3cdm for ; Wed, 18 May 2022 20:09:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=LOb3V4kO; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4L37wt5tlcz3bxh for ; Wed, 18 May 2022 20:08:30 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=LOb3V4kO; dkim-atps=neutral Received: by gandalf.ozlabs.org (Postfix) id 4L37ws4GCKz4xcT; Wed, 18 May 2022 20:08:29 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: by gandalf.ozlabs.org (Postfix, from userid 1003) id 4L37ws46Rcz4xcR; Wed, 18 May 2022 20:08:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs.org; s=201707; t=1652868509; bh=TxmrULAGiAXYhtXIbJ6kRvZYSTyWm5CFItj3DKlVdfY=; h=Date:From:To:Cc:Subject:From; b=LOb3V4kOYcJFKRcUx8gc27XvpMZEY4x4WVI9fgEJM5yY4R8Ng9BV14jxMRm44xGYe pl6xv2TJ2nQqRhI9Fx0F50kV+ZbL91N0QFBN+GI4A61eq3npdP57YeiaJpyVDvJUd4 8VbCewaHuUSaf+ZMy3SCSyr4FyHCO6UhrSjyJcYd9wXsPw1TFVElFjLdl00ooWncnA rhM6deDh7hY9jG2GDEJWVtGhTOl0jkT0KSKgIeFMpp/w21IZP68oCiaNMAwmSmxeLq OV66QDXXxnYRgLa2GQ3+GRc4HlodYwLLAI7h77nZHfvSM2y2ea+452acsaNIT6/Mo9 zfTujUEZuP2IQ== Date: Wed, 18 May 2022 20:03:27 +1000 From: Paul Mackerras To: linuxppc-dev@ozlabs.org Subject: [PATCH v2 0/6] KASAN support for 64-bit Book 3S powerpc Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Axtens Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch series implements KASAN on 64-bit POWER with radix MMU, such as POWER9 or POWER10. Daniel Axtens posted previous versions of these patches, but is no longer working on KASAN, and I have been asked to get them ready for inclusion. Because of various technical difficulties, mostly around the need to allow for code that runs in real mode, we only support "outline" mode (as opposed to "inline" mode), where the compiler adds a call to a checking procedure before every store to memory. This series has known deficiencies, specifically that the kernel will crash on boot on a HPT system, and that out-of-bounds accesses to module global data are not caught (which leads to one of the KASAN tests failing). v2: Split the large patch 3/3 of the previous series into three patches and addressed review comments; put the generic documentation changes in a separate patch at the end of the series; removed the RFC tag. Comments welcome. Paul. Documentation/dev-tools/kasan.rst | 7 +- Documentation/powerpc/kasan.txt | 58 ++++++++++++ arch/powerpc/Kconfig | 5 +- arch/powerpc/Kconfig.debug | 3 +- arch/powerpc/include/asm/book3s/64/hash.h | 4 + arch/powerpc/include/asm/book3s/64/pgtable.h | 3 + arch/powerpc/include/asm/book3s/64/radix.h | 12 ++- arch/powerpc/include/asm/interrupt.h | 52 ++++++++--- arch/powerpc/include/asm/kasan.h | 22 +++++ arch/powerpc/kernel/Makefile | 11 +++ arch/powerpc/kernel/smp.c | 22 ++--- arch/powerpc/kernel/traps.c | 6 +- arch/powerpc/kexec/Makefile | 2 + arch/powerpc/kvm/Makefile | 5 + arch/powerpc/lib/Makefile | 3 + arch/powerpc/mm/book3s64/Makefile | 9 ++ arch/powerpc/mm/kasan/Makefile | 3 +- .../mm/kasan/{kasan_init_32.c => init_32.c} | 0 arch/powerpc/mm/kasan/init_book3s_64.c | 103 +++++++++++++++++++++ arch/powerpc/mm/ptdump/ptdump.c | 3 +- arch/powerpc/platforms/Kconfig.cputype | 1 + arch/powerpc/platforms/powernv/Makefile | 8 ++ arch/powerpc/platforms/powernv/smp.c | 2 +- arch/powerpc/platforms/pseries/Makefile | 6 ++ arch/powerpc/sysdev/xics/xics-common.c | 4 +- arch/powerpc/sysdev/xive/common.c | 4 +- 26 files changed, 320 insertions(+), 38 deletions(-)