Message ID | 1ed03d53ee679cba52ba7118d2acbef948d21fcc.1543337629.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 F39871869 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E331B2C3F0 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D70A82C4A4; Tue, 27 Nov 2018 16:56:53 +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=unavailable 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 758FE2C48A for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCC276B494F; Tue, 27 Nov 2018 11:56:16 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B798C6B4951; Tue, 27 Nov 2018 11:56:16 -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 9F5856B4952; Tue, 27 Nov 2018 11:56:16 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by kanga.kvack.org (Postfix) with ESMTP id 414376B494F for <linux-mm@kvack.org>; Tue, 27 Nov 2018 11:56:16 -0500 (EST) Received: by mail-wm1-f72.google.com with SMTP id t199so17858300wmd.3 for <linux-mm@kvack.org>; Tue, 27 Nov 2018 08:56:16 -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=5TjQJgkFl+PVCxLsWj9vCgbjvK0haYDKUt+yI6asfBc=; b=gaZo3NOjXZdc1/jVVOp7lB1U/7i3seNCGu4jlJ6LkNDDi8jFLli5uOOhYhRznNsQTd eiXcdYlGD8m4Dwwyr3qOUiVfFY/uPrbO5+BegD5GIvBZDgmmFI0rjYk+uDEOZ3LJLUaE XLrmgghMVVpqsN60YSbgWXhpvjay2cre8zBqAG6aB3AOV+vjsF8VsSS9i2yTHkaUepF0 A4UWP76maOVvwb/XVVktVibNbkAVqcjEFfcZ3G+FCCSZXMizqTtB+1yz9ZHvX8jTwE9Z 9vvI8c+b68bvOw2jhTRloPoY3iq2EngVJd5QJvNd6q5Cy3O5julHlJXQIDa1ZuO0/Ppd 3YFA== X-Gm-Message-State: AA+aEWYulfcd1dVxXyJcoXMdqjO7mq4Z4eGECYSc+zg9DDpt9MdS/S7A qbSsw7TsFHtaDXA1CIjKxZ3tBmnpMhdRUsAXBNAdqVqfEW+dAX2paSjfJH/eDCbb56KVUUsRRSd pLnKoJhfAg7hP2C8GA5jBn7vIbhq/uIEUwjZLEBzk/tDcObNzCmJl66JSqePy5S/prFm8GT+CfI EsUkX70U+SMhFq8+vCx/qxaXtxhFzcCtsKB3CZIfJWWgaXl4oo0HxOkZ0RvO1pG0okW0z+fU1Sk 6nSU0ixY5K0SvKnbqA5WJjGDzgmIGmm+cLYDOc+eravTpHVtsZ8a0E+R71DQFem5p6lHm+OjhTy oAon51/NY9Zvoa1ldogIrJRVBAzbayRxiLvUiaOnTpI3t/yMAnm5dKMCgMD6xnX+egawzaDGlzY 6 X-Received: by 2002:adf:9467:: with SMTP id 94mr27961525wrq.305.1543337775740; Tue, 27 Nov 2018 08:56:15 -0800 (PST) X-Received: by 2002:adf:9467:: with SMTP id 94mr27961473wrq.305.1543337774947; Tue, 27 Nov 2018 08:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543337774; cv=none; d=google.com; s=arc-20160816; b=M4mHDCRjzrUZa06Msl/hHAqTQH4Ng8iiWQaSNPb6mo/qSp6+NreOT6aDsnOMTi6El5 1wAfashLD4L7Tz6Dk+rMsrA4KTn9t+fDC1T3F+ATS3pkJMAofx+H2yOapjOhyosiNaAp YT4He5KDDn0aNLQCe3d2lNNE4EvfEKvzGwbjl1NrfepSOguV4Ob+/mc99rRyfYO9StZI id9f4Y66DCq/Olkeh9xOWr0GwjB0hPbmLlJShfipK83sjFysrajFiGws3R01Bntv/OXt eEYvQAhgzp4EDgDJVs7Ejwt8gZenRwC7FpeQWZ6TghuIxgOjRWys+inufcA3z2DjIzll cyVQ== 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=5TjQJgkFl+PVCxLsWj9vCgbjvK0haYDKUt+yI6asfBc=; b=y5wLNfl/rfFQLClHgnal07ige6E+MtwAebOuKsvL5mi3QkAAw8AKKWHyD0N5i7kiUo i9Uae/JXafJ1+V+DK+gY95cceZIVn49xEDbst4D3ypzOYxFLMeqoB83EoWUwXvcMugzt bWr+AgS2zMbvS5z80vlFg0g9O3oBsQLa8bUQFEw5LGJwU+LNoNAlnim4G9jvzxy8WL+l BgtMJODxD/TjeS/EbrM/5USGrwRZyO6yMUrSUzWugvsHJ3PnySGlaoceS196GZbSx3OA kVdrWXDMRytGGtuS0HILls8hmCdPzBg3dIiqAt60NsPChNYB48ZIdV86RFpQQWcgcaW0 gUgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vq8xJz4L; 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 i18sor3125757wrw.50.2018.11.27.08.56.14 for <linux-mm@kvack.org> (Google Transport Security); Tue, 27 Nov 2018 08:56:14 -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=Vq8xJz4L; 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=5TjQJgkFl+PVCxLsWj9vCgbjvK0haYDKUt+yI6asfBc=; b=Vq8xJz4L04oXAVPDvOzYuzz+wHl1QGBnQgoEk8zjm/CZt1EqPmCV4MXLs83CCDHriG nZQo2iAfvSYq4/G3CcCYjx4+keudcdowz/V+f1xuztB78kVIxdEUZPxUlxAPXdNGfB8r xuY642dJ4/Jr9SFclo8bI/fnE/NGVNXmJm4HZJ33i2h7k3awNqoEHgHv2j3ghoHSetBq N8DthHjipq15+ycjHXS4dovDb+hu7nsTOkP31YrSMZgr2yUOtGuEakHyfOu0gQJ0gQKp +mRR4yL+iYIE+weqA0Qvd988IjrsHCP9yGsIKBnEAOfNH/W7HPJ8EjTjXk2hbR05NzUV UPEQ== X-Google-Smtp-Source: AFSGD/VnXoSEtN3ApgD8MSpZdtG9X13UEEYBU7XpEpIdqGrEHViBzH7UhGky5kkFLvu375ZFYdDdzA== X-Received: by 2002:adf:c711:: with SMTP id k17mr15658939wrg.197.1543337774345; Tue, 27 Nov 2018 08:56:14 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:3180:41f8:3010:ff61]) by smtp.gmail.com with ESMTPSA id k73sm6383099wmd.36.2018.11.27.08.56.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 08:56:13 -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 v12 14/25] kasan, arm64: enable top byte ignore for the kernel Date: Tue, 27 Nov 2018 17:55:32 +0100 Message-Id: <1ed03d53ee679cba52ba7118d2acbef948d21fcc.1543337629.git.andreyknvl@google.com> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog In-Reply-To: <cover.1543337629.git.andreyknvl@google.com> References: <cover.1543337629.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 /*