From patchwork Thu Jun 17 06:39:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 12326859 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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 9E839C48BE5 for ; Thu, 17 Jun 2021 06:40:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16D986141B for ; Thu, 17 Jun 2021 06:40:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16D986141B 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 43A216B0070; Thu, 17 Jun 2021 02:40:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C4446B0071; Thu, 17 Jun 2021 02:40:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2166B6B0072; Thu, 17 Jun 2021 02:40:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id DE65A6B0070 for ; Thu, 17 Jun 2021 02:40:05 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6E248824C45D for ; Thu, 17 Jun 2021 06:40:05 +0000 (UTC) X-FDA: 78262265970.31.386BFAD Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf22.hostedemail.com (Postfix) with ESMTP id 96B1CC0091AE for ; Thu, 17 Jun 2021 06:39:53 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id o88-20020a17090a0a61b029016eeb2adf66so5309926pjo.4 for ; Wed, 16 Jun 2021 23:40:04 -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=z5tXXD3iVvEIVZ0tTMhEKfG6zykuiGGLtMWYWjRDWYs=; b=ZvI05WcGmnfe5oUfXHNoGdM/4PM/h3nxOJp96Y+tFn5U15FBFxeWkFmjh3oZf1EL8A ADkJUTvU+y/ObXXNwK0vGCrvjU1eU92ZHL7pmy1vKZFrzb+YG+Yqm32icH5OIHbXYy2p a2oGBtVpOoRVNRRYQe6ovJIHlhAuYmObTEb5E= 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=z5tXXD3iVvEIVZ0tTMhEKfG6zykuiGGLtMWYWjRDWYs=; b=bi6Sm5GnacQ92Tpzd56/ZvozNqH+k5vTRJ4Cimc2RmJ4u+BnHjQNwIfLo96/DKiC3/ NLmkLQ0RPr3fE7RaZFEuiLr/1Z+rJUY8ab3TwYaqZMbXIrxSTDmI9u4hL6jbkP2XE5od A5cRqhGhrr8IUkguMb/SIKuN7W/aezEMjdcMTX4DnbalA8WdCHvSrxPnB6nzJcfnNJzp BTC/Gy5COUaZ7Vjny1LvqHJtVLdRr4Ll/ZQ7wFCO/+DppKsUnNPKU5MC1/PNDLH0JeW4 xGIF8q5qi7iUDBpyjNm4FYtZUQy1E8hee9cPfvAGgZGWtmWuBzW/FPXgcCC6qQfcGRh3 /j/w== X-Gm-Message-State: AOAM53249szQnxV6TkTI8phL5BCazwIxYpO6kTC+Ml7sfGi8rAJbdbOh ln/Uc60pP0Poj7BScTi9ivqrvg== X-Google-Smtp-Source: ABdhPJzXBEGC2svL4/w6uQzTlhwr8EKMXDJngko+LKuujG1Wr3mcyI7qAM8QXo2oeD3ihoXSYQO+3A== X-Received: by 2002:a17:90a:f193:: with SMTP id bv19mr15312947pjb.86.1623912003744; Wed, 16 Jun 2021 23:40:03 -0700 (PDT) Received: from localhost ([203.206.29.204]) by smtp.gmail.com with ESMTPSA id b1sm4112148pgb.91.2021.06.16.23.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 23:40:03 -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 v14 0/4] KASAN core changes for ppc64 radix KASAN Date: Thu, 17 Jun 2021 16:39:52 +1000 Message-Id: <20210617063956.94061-1-dja@axtens.net> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=axtens.net header.s=google header.b=ZvI05WcG; spf=pass (imf22.hostedemail.com: domain of dja@axtens.net designates 209.85.216.51 as permitted sender) smtp.mailfrom=dja@axtens.net; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 96B1CC0091AE X-Stat-Signature: heqx4dorir9jxchb4jq69x7afxgfx6z1 X-HE-Tag: 1623911993-810057 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. 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 v12 series at https://lore.kernel.org/linux-mm/20210615014705.2234866-1-dja@axtens.net/ ) v14 applies to next-20210611. There should be no noticeable changes to other platforms. Changes since v13: move the MAX_PTR_PER_* definitions out of kasan and into pgtable.h. Add a build time error to hopefully prevent any confusion about when the new hook is applicable. Thanks Marco and Christophe. 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. Daniel Axtens (4): kasan: allow an architecture to disable inline instrumentation kasan: allow architectures to provide an outline readiness check mm: define default MAX_PTRS_PER_* in include/pgtable.h kasan: use MAX_PTRS_PER_* for early shadow tables