Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp539604imu; Thu, 20 Dec 2018 00:57:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/US1ylQtenBvX2ZIKhroSaqkhITzGGlGTiru+GGfy0UN/DB2zSrESfcsOEY0OvUYSo+1Wvi X-Received: by 2002:a62:a510:: with SMTP id v16mr23399809pfm.18.1545296229840; Thu, 20 Dec 2018 00:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545296229; cv=none; d=google.com; s=arc-20160816; b=PBaJajnduuYD3WC9Q8EaocfGTpKpCLA2nKS4Edd7NEjheVRv0s0Agum9CWQDLKS/IR iUrpmMiQ7W9Z4epZGqoCtpLZ2jO09uji4jlNP/CH78OmlRl+XOH/p7JlpXWaKRvwScm6 xd15GJ4qX6lrine4l4JFpMjDoFWDVUPeiMMO537Cn9tnHNjYEz+286G5lWLHG6NLXt8E fNw87V2aeZ/mCwomaE7hgisob3rgGPChq3PTD2Hxi1DpD2EZuuS6xqJ7mjiCh4qGlr9r RwLdc89SQOjXcUM2xgOhAZpXpNhU1kShBAhwbOOjgxMBxp1lR7LGH3/dKXFhR2JG3U2V XJGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=fyLATC5uknVYvSE6rnnjR7w9590bzmLpN1/PnMxU5QE=; b=SMerQzpb+bBNUBOT2BQ7r5NbDUvSnlpftXl4I/0p3ADmWCmfJ7qGxmbOLF+Wyy3tMX uoQUWVWiBjgfwHC5wBafKWes2NeAzHM8h8/WHeBC2lvGquWw0jhPlRLbed35xe9g2Hb1 lUrT4FNG8erek3Lie1h01+QeMZ6fMehljfXCtrPNIWchcvJ/+2taOVaHExQ1I6uiqEzC Gx9y5Txm3U48HM0oiXPh04uKDiTeGDgT3OeV3r3HZ05w0nXeSKlwSr3gCXPxJbbbsvIy HE96dtwtN307TZMTpRco7o5kwk1fIUL5k7m31RZhK4DTek4/FKDsRvswCvvbJvfjvb0s ul6A== ARC-Authentication-Results: i=1; mx.google.com; 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 23si18426021pfu.2.2018.12.20.00.56.54; Thu, 20 Dec 2018 00:57:09 -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; 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 S1728853AbeLTGkg (ORCPT + 99 others); Thu, 20 Dec 2018 01:40:36 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:10174 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbeLTGkg (ORCPT ); Thu, 20 Dec 2018 01:40:36 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43L2FZ0hSNz9vBLV; Thu, 20 Dec 2018 07:40:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id sEVh946JcXzW; Thu, 20 Dec 2018 07:40:34 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 43L2FZ09jgz9vBJf; Thu, 20 Dec 2018 07:40:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D610E8B796; Thu, 20 Dec 2018 07:40:34 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id QpDKGWTlCJ3l; Thu, 20 Dec 2018 07:40:34 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A6ABE8B755; Thu, 20 Dec 2018 07:40:34 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 6735371733; Thu, 20 Dec 2018 06:40:34 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [RFC PATCH v2 0/3] KASAN for nohash PPC32 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 20 Dec 2018 06:40:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This serie adds KASAN support to nohash PPC32 Tested on 8xx Changes in v2: - Rebased. - Using __set_pte_at() to build the early table. - Worked around and got rid of the patch adding asm/page.h in asm/pgtable-types.h ==> might be fixed independently but needed for this serie. In principle, this should also work on the 603. For now I have not been able to boot, it stops before early console is active, so I'm quite blind at the moment and don't really know what's wrong. Any idea ? For hash32 (not 603), it cannot work as is because due to HASHPTE flag, we can't use the same pagetable for several PGD entries. Christophe Leroy (3): powerpc/mm: prepare kernel for KAsan on PPC32 powerpc/32: Move early_init() in a separate file powerpc/nohash32: Add KASAN support arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/kasan.h | 22 +++++++++ arch/powerpc/include/asm/nohash/32/pgtable.h | 2 + arch/powerpc/include/asm/ppc_asm.h | 5 ++ arch/powerpc/include/asm/setup.h | 5 ++ arch/powerpc/include/asm/string.h | 14 ++++++ arch/powerpc/kernel/Makefile | 5 +- arch/powerpc/kernel/cputable.c | 4 +- arch/powerpc/kernel/early_32.c | 35 +++++++++++++ arch/powerpc/kernel/setup-common.c | 2 + arch/powerpc/kernel/setup_32.c | 31 ++---------- arch/powerpc/lib/Makefile | 2 + arch/powerpc/lib/copy_32.S | 9 ++-- arch/powerpc/mm/Makefile | 3 ++ arch/powerpc/mm/dump_linuxpagetables.c | 8 +++ arch/powerpc/mm/kasan_init.c | 73 ++++++++++++++++++++++++++++ arch/powerpc/mm/mem.c | 4 ++ 17 files changed, 191 insertions(+), 34 deletions(-) create mode 100644 arch/powerpc/include/asm/kasan.h create mode 100644 arch/powerpc/kernel/early_32.c create mode 100644 arch/powerpc/mm/kasan_init.c -- 2.13.3