Message ID | f51eca084c8cdb2f3a55195fe342dc8953b7aead.1544099024.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C45E51731 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 6 Dec 2018 12:25:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B201D297D0 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 6 Dec 2018 12:25:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4D4B2D393; Thu, 6 Dec 2018 12:25:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BBBC297D0 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 6 Dec 2018 12:25:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 986E76B7A0B; Thu, 6 Dec 2018 07:25:13 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 939986B7A0D; Thu, 6 Dec 2018 07:25:13 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73DFF6B7A0E; Thu, 6 Dec 2018 07:25:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id 1A0486B7A0B for <linux-mm@kvack.org>; Thu, 6 Dec 2018 07:25:13 -0500 (EST) Received: by mail-wr1-f71.google.com with SMTP id e14so75965wru.19 for <linux-mm@kvack.org>; Thu, 06 Dec 2018 04:25:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=AkvfG/IDbgZMxYwPX5lSFsN5elmH6vlYt7vVIn43a0U=; b=Kf9D9SLNO4oUMY+KNDSOJ3gEH9gp5+RmO85vMQASUKmOiuJxIwyxUHs1ECBDy4F+ko Y7mIV/6jrcPCVYYbC20NdVCtqEvTl922umJVQBj3MJTLUov2b+GgYxv07AH3xYuvntC+ jowqrsK5MgculILzc+RG6CVin+76dOG0xdbx4Tc5qwQS2pc6iOQGwJCBIp42bjS0K505 0rnTiCwwtg6rLLsHR+l7g0QwJ8dXtvzfTHygMC1RLpmuVo6QJ9UbzoBmZnk4YZXMKU/s fsFiUdhsC+2+SoLJv9EsMkv2/wTUMTI7ZxEq9jdsDQA1hmKW2wyufjjV62jYLkqoQ+sz G3Xg== X-Gm-Message-State: AA+aEWaKOKXcsOC/64uD0K5WH6zhRXDW0+PjcUzWEY72t2lgf6AVbYNj jOAiaNhxQU64SlPW899XfbuuJGJnJRSMEY3vHSAxnvi6yQUb4uGR/IT74OtQn6adGhh4PQHkuwu AYTDBsHYbPmWwYHrlhAZqfX/R2rkniKztpcQ2tcAMBqYv8IIYyZExeRPPlJN1XptYcFQW4eYln7 WABjaFHPYkJxGEXDIz55rQpOjaLT+46i3zRrUR2CEB2+zk/zwm1QF8GpJyyFi9QNkHKJRRjHe/n SsQxqiZtt4UrpefqfEdOYnsbzOk+/w1QjRH3zKyzuw0pM7lj2xnR+wDqPtgx4WQHEy4KBuImobT YkZvJMCrf1LWX2cXCbXg7ITJIeBu/6WEH87Lk8cKbAWTMoSYVe3Dwr51/eDqMzRwhVd+bOmCA25 J X-Received: by 2002:a1c:9692:: with SMTP id y140mr20334329wmd.67.1544099112585; Thu, 06 Dec 2018 04:25:12 -0800 (PST) X-Received: by 2002:a1c:9692:: with SMTP id y140mr20334271wmd.67.1544099111742; Thu, 06 Dec 2018 04:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544099111; cv=none; d=google.com; s=arc-20160816; b=Z+WWam3eR6tditnmUQWksEAHxyK378wn5+ELy89EoD8kOZh2EHYHNgGWAn69lfqqNH kHVGNf67+q4jW+Ow5ntm7ImqpYEdsqTznHclLC88X44m3DJd5uuJcPUAzdBxTSBw0OqW HWggnSO6Na7JEzYVUe1S13MUGl/SYxrOg4aUHCDZV2sz2MQ+W+ZUrYlZF1rL8kZZliia Ll9CXlpm1RDed7aBFGlauAPW8ivh4bnr7KxkvwvZ5xuhkCGqGDkk7A9RzHh2qbo09Glc HMOKxcondv9nKqxoKbBP307YM2URhPoyTcKyruIcPLl6RqX3YG7QHsXdFi33MmrAdMEG OX6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AkvfG/IDbgZMxYwPX5lSFsN5elmH6vlYt7vVIn43a0U=; b=KA/VhvURYaQH1HikS2CfvdfWescdeGwUhs79BXVe8ZGOg84CKxofnUsmaIs4p82n+A 1LFDwee4jJmyyRCSep4xSegRru60Q7GHmkW7c5Wl7rBave/PUZEA6Rtn/COqi7n9HEZm rOwEQ0Io1C3Uhmab9BmElgAxELPIJUb0BDNwHh0ZgQU+c/gqPzLGLkoJbFI0l0d9FGbA lLJwQoHpgMr2jx/NPyQiPXjSlSmWl541ah3lYfbaIdssDkekifKB44HVXWkcI06Aur0C yw/JLRCdvEubuUq00bUgWous2vx7pYuLD8nWzg8l2m9r6nPbJMxSojVnxngBBmKpANiR 5HoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=a0Vwo7+R; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j10sor190251wrx.15.2018.12.06.04.25.11 for <linux-mm@kvack.org> (Google Transport Security); Thu, 06 Dec 2018 04:25:11 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=a0Vwo7+R; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AkvfG/IDbgZMxYwPX5lSFsN5elmH6vlYt7vVIn43a0U=; b=a0Vwo7+R9UWJKWhJ5tdXON+TcRVk8bAd3GrGkAupa9U7c521S0OEfq/71bnrAZ7YI9 qO3e/k1mYl3KHhZ9c+3uOMl2aTRoIRr9SlDaXPW4D8lhbk32Md5fm2bGf9/zOG/6Meus zm9A28pu+SVWQtklpcqHi8Gz496+QwhVd5wIpCU6J9hBR5i/FXMe9o6PAjf92B1EtKkE wUnBhqf9UhEVYjxuBsO+8OlgbhSabAPKLFgHzoSxcvnZIIVzwQ57/4kGb0byLGwVIbuw xb9Pb7kljtzchG8AcB3Q6RRRggT61OjCQ6QMRyg3/B9mgLgiuUws4cV863SNS0HtMxy3 ebpQ== X-Google-Smtp-Source: AFSGD/W4zA6BXuDW4nuwEjrxAwEtRH7jwb51mwQJbpOgSMlyeciRxEfja88tx3NW2n/I+jUstCLcCg== X-Received: by 2002:adf:b243:: with SMTP id y3mr10683692wra.184.1544099111278; Thu, 06 Dec 2018 04:25:11 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:3180:41f8:3010:ff61]) by smtp.gmail.com with ESMTPSA id j8sm339988wrt.40.2018.12.06.04.25.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 04:25:10 -0800 (PST) From: Andrey Konovalov <andreyknvl@google.com> To: Andrey Ryabinin <aryabinin@virtuozzo.com>, Alexander Potapenko <glider@google.com>, Dmitry Vyukov <dvyukov@google.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Christoph Lameter <cl@linux.com>, Andrew Morton <akpm@linux-foundation.org>, Mark Rutland <mark.rutland@arm.com>, Nick Desaulniers <ndesaulniers@google.com>, Marc Zyngier <marc.zyngier@arm.com>, Dave Martin <dave.martin@arm.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, "Eric W . Biederman" <ebiederm@xmission.com>, Ingo Molnar <mingo@kernel.org>, Paul Lawrence <paullawrence@google.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Arnd Bergmann <arnd@arndb.de>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kate Stewart <kstewart@linuxfoundation.org>, Mike Rapoport <rppt@linux.vnet.ibm.com>, kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sparse@vger.kernel.org, linux-mm@kvack.org, linux-kbuild@vger.kernel.org Cc: Kostya Serebryany <kcc@google.com>, Evgeniy Stepanov <eugenis@google.com>, Lee Smith <Lee.Smith@arm.com>, Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>, Jacob Bramley <Jacob.Bramley@arm.com>, Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>, Jann Horn <jannh@google.com>, Mark Brand <markbrand@google.com>, Chintan Pandya <cpandya@codeaurora.org>, Vishwath Mohan <vishwath@google.com>, Andrey Konovalov <andreyknvl@google.com> Subject: [PATCH v13 14/25] kasan, arm64: enable top byte ignore for the kernel Date: Thu, 6 Dec 2018 13:24:32 +0100 Message-Id: <f51eca084c8cdb2f3a55195fe342dc8953b7aead.1544099024.git.andreyknvl@google.com> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <cover.1544099024.git.andreyknvl@google.com> References: <cover.1544099024.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
kasan: add software tag-based mode for arm64
|
expand
|
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index 1d7d8da2ef9b..d43b870c39b3 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h @@ -291,6 +291,7 @@ #define TCR_A1 (UL(1) << 22) #define TCR_ASID16 (UL(1) << 36) #define TCR_TBI0 (UL(1) << 37) +#define TCR_TBI1 (UL(1) << 38) #define TCR_HA (UL(1) << 39) #define TCR_HD (UL(1) << 40) #define TCR_NFD1 (UL(1) << 54) diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 2c75b0b903ae..d861f208eeb1 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -47,6 +47,12 @@ /* PTWs cacheable, inner/outer WBWA */ #define TCR_CACHE_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBWA +#ifdef CONFIG_KASAN_SW_TAGS +#define TCR_KASAN_FLAGS TCR_TBI1 +#else +#define TCR_KASAN_FLAGS 0 +#endif + #define MAIR(attr, mt) ((attr) << ((mt) * 8)) /* @@ -445,7 +451,7 @@ ENTRY(__cpu_setup) */ ldr x10, =TCR_TxSZ(VA_BITS) | TCR_CACHE_FLAGS | TCR_SMP_FLAGS | \ TCR_TG_FLAGS | TCR_KASLR_FLAGS | TCR_ASID16 | \ - TCR_TBI0 | TCR_A1 + TCR_TBI0 | TCR_A1 | TCR_KASAN_FLAGS tcr_set_idmap_t0sz x10, x9 /*