From patchwork Wed Jun 16 08:02:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 12324465 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=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 4D029C48BE6 for ; Wed, 16 Jun 2021 08:02:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D303D6054E for ; Wed, 16 Jun 2021 08:02:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D303D6054E 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 524776B0071; Wed, 16 Jun 2021 04:02:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D5746B0072; Wed, 16 Jun 2021 04:02:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34E986B0073; Wed, 16 Jun 2021 04:02:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 04E396B0071 for ; Wed, 16 Jun 2021 04:02:50 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9E5D4181AC9C6 for ; Wed, 16 Jun 2021 08:02:50 +0000 (UTC) X-FDA: 78258845700.05.E4A64D4 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by imf23.hostedemail.com (Postfix) with ESMTP id A2B8FA00025B for ; Wed, 16 Jun 2021 08:02:41 +0000 (UTC) Received: by mail-pg1-f171.google.com with SMTP id v7so1328998pgl.2 for ; Wed, 16 Jun 2021 01:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cw10uFtM6j6ivpIAHKyfGYAPjF+AZvHLGbY1I1Cvnes=; b=QPnQjC/imXfUDfxqjiSI4NF+/NKMtw6Adrdw/ELeXbXZra76qgDP9zC6J1U1y9NOt4 u3kgAKeQQuREYzGZQlZMFN4+Pq0lK/VqesWv/DqZLZyDm6UlMjUAZqIob+QtbqgV6ZMS Cop5PE067jtkmcXpYSnRdeBlAyFJ/etIcr1Eo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cw10uFtM6j6ivpIAHKyfGYAPjF+AZvHLGbY1I1Cvnes=; b=rUXvHH2OLVkv99SUqsa//uBN7VoNkidA5Bm2/hfCCI1F7kIzrpBAojrICPd+s3w7vp 6HZwZaXkf1gvwPVN5O1koToFMOYl12LilQQR6eUu7JIQiD9tGYD+zxU2CEJKnuXo0Hls rljQX9/mwF/4o82ruznPtoqDpljXAZVjxiZUGpjTm+98tSFK2IoOLwX1OftiZSexSFsJ 89+d0038CBToMZCg5Gsa6n/ydpmzPQn25jizrOonr8E5L/ZjIsK5KOsSAEF9/ygcZL5E GuRXrTUVMq8EEcS42w1R6az630lRinsDg4leDSM800fP0BeHk89hEl9dv0QA4574d9LY w7PQ== X-Gm-Message-State: AOAM532jP82TnNNOB9FOs8H6wp7dPpGQMidgMtpajayhAE56W/I/6Yaf NhuJR+PKaCQxAbPSFITDEFzEuw== X-Google-Smtp-Source: ABdhPJy5hVPBnk/1qjUJFKWZR7abAM3qeGiX96PaDRnrHnAkkctatxXsM4js2+i2npCAT/eew3P16A== X-Received: by 2002:a63:a805:: with SMTP id o5mr3777437pgf.328.1623830569286; Wed, 16 Jun 2021 01:02:49 -0700 (PDT) Received: from localhost ([203.206.29.204]) by smtp.gmail.com with ESMTPSA id k19sm1408921pji.32.2021.06.16.01.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 01:02:48 -0700 (PDT) From: Daniel Axtens To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, elver@google.com, akpm@linux-foundation.org, andreyknvl@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, christophe.leroy@csgroup.eu, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com, Daniel Axtens Subject: [PATCH v13 0/3] KASAN core changes for ppc64 radix KASAN Date: Wed, 16 Jun 2021 18:02:41 +1000 Message-Id: <20210616080244.51236-1-dja@axtens.net> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A2B8FA00025B X-Stat-Signature: d1mdmypmhbr6gxkbtxaf3uz9hipamsyy Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=axtens.net header.s=google header.b="QPnQjC/i"; dmarc=none; spf=pass (imf23.hostedemail.com: domain of dja@axtens.net designates 209.85.215.171 as permitted sender) smtp.mailfrom=dja@axtens.net X-HE-Tag: 1623830561-446345 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Building on the work of Christophe, Aneesh and Balbir, I've ported KASAN to 64-bit Book3S kernels running on the Radix MMU. I've been trying this for a while, but we keep having collisions between the kasan code in the mm tree and the code I want to put in to the ppc tree. So this series just contains the kasan core changes that we need. These can go in via the mm tree. I will then propose the powerpc changes for a later cycle. (The most recent RFC for the powerpc changes is in the last series at https://lore.kernel.org/linux-mm/20210615014705.2234866-1-dja@axtens.net/ ) v13 applies to next-20210611. There should be no noticeable changes to other platforms. Changes since v12: respond to Marco's review comments - clean up the help for ARCH_DISABLE_KASAN_INLINE, and add an arch readiness check to the new granule poisioning function. Thanks Marco. Kind regards, Daniel Daniel Axtens (3): kasan: allow an architecture to disable inline instrumentation kasan: allow architectures to provide an outline readiness check kasan: define and use MAX_PTRS_PER_* for early shadow tables include/linux/kasan.h | 18 +++++++++++++++--- lib/Kconfig.kasan | 14 ++++++++++++++ mm/kasan/common.c | 4 ++++ mm/kasan/generic.c | 3 +++ mm/kasan/init.c | 6 +++--- mm/kasan/kasan.h | 4 ++++ mm/kasan/shadow.c | 8 ++++++++ 7 files changed, 51 insertions(+), 6 deletions(-)