Message ID | dd9cda296c70ca6b1839cf4de3ee3137cf5030e7.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 449CD109C for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33E602C431 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 319FB2C4AF; Tue, 27 Nov 2018 16:56:40 +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 96C8A2C4A8 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D7966B4949; Tue, 27 Nov 2018 11:56:11 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 736A96B494B; Tue, 27 Nov 2018 11:56:11 -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 560296B494C; Tue, 27 Nov 2018 11:56:11 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by kanga.kvack.org (Postfix) with ESMTP id F2EAE6B4949 for <linux-mm@kvack.org>; Tue, 27 Nov 2018 11:56:10 -0500 (EST) Received: by mail-wr1-f70.google.com with SMTP id q18so18556640wrx.0 for <linux-mm@kvack.org>; Tue, 27 Nov 2018 08:56:10 -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=y8jDgA1AyN3NE4eBg/lwMVayjAlQQavKYDtyjUMWkmY=; b=KafB7X51c1qtn3cZALDv5hQyGB3IStzVO5taAhqrBS+8gUzJ0bppT4W1SZE8CXGUbo eS46AA4ST2yYVJrCjLbtgKMjvxd/h0tt+f4GWvvoECluaVRjON5fKrmEPPwFKfgKTDP6 +iiNor7FsdLkEn0u+F7k0+uL4sodctgKphMqhKutyyVa+OcNzSsBOQd/iSO6slWOgj3Y 3YJEFLLxAzAN8OLjKrQiSzpgulvQfHxguXimEMOaIFBExDg+meziCXAKqNUTzhiyAlt5 cw4xp2F85VPe9IjA8hJcZoYW6UNKqyra9aO4dTyddid1jqovLISylAWUvcukDim56i6w ZFvQ== X-Gm-Message-State: AA+aEWbEGNFAxBU3ReATqlTlIs8yG6iiM1BzRI7YCvXNBxGIMAzVDRG0 2x1vJdTtcSUcbdRLPS/S/bpDTs7jJGLBs6cExNHzdHMrFqJQ1/j9u3+uJltnaxlz1BUjFF6tLWN g3wdvV2PUhYT4XKNIp1WYrKbqxOMAnaTy9anufV2743qqBtG4duOB8g7ClUHUhY5FiUjnRNxvF2 mnI9Z7eqhJ1J/f9SdKXVWBqRh2j2aTCHSi7UCQGJeh31U7DBDbYoH1wa5B13d+8XYHiTluRwugw PCQgmgYDAWySQ/N2qzY1AIhTGjlrqkxhsN/ifpn4h54DdlGwVCOAcuxeZ2jiYOk339aGTuCS2oz L/ru9Fm3dJHU/U7Tuj94WBFsyKzyJe/fOyh46cZroCfjCwDsvhQn42ESwuHk37u/UpcXPqCjXYW V X-Received: by 2002:a7b:c397:: with SMTP id s23mr1306508wmj.127.1543337770391; Tue, 27 Nov 2018 08:56:10 -0800 (PST) X-Received: by 2002:a7b:c397:: with SMTP id s23mr1306455wmj.127.1543337769534; Tue, 27 Nov 2018 08:56:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543337769; cv=none; d=google.com; s=arc-20160816; b=GwiWMTxo9gKdngNE8YsBC4fBn1GvM1RBSnCV34aCwiQZs3IrvW5OwK1agphPacQi1d OE+LCLU08qia3xLd2VkwG3uXL/NUnmWyzyw1x5y/ahj34BSrGtXvy1hIIM5n4de6Qd5T JT0UjWfNtEDjlq2HRvOOWY2PNP0+0i56mDsbzr2Noc1jlVoPUFy7XAZ/L87dYefIS88m d5aZW6SLYC4XnoEihbsOaAbRS1efLifIVmtSxp+1PYD7Tgmx/JWWDzAidWeoUVda78V4 JCBfe6XcLYejpwpm+Li6xwMHLZ4uLLAf5IrTGehCxVsLrwY6ooFm8di/BFbrjVICSyOF uUYg== 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=y8jDgA1AyN3NE4eBg/lwMVayjAlQQavKYDtyjUMWkmY=; b=QWoaD5NhlRfcjO2fHDicmdKlTsO+dxc9sNr93Ti3L0D+BUpdH9idClYChz0VR92Obu yiCLpLqkcpKHN91etWmWiwm1NmHaMERwydA7OGw88FGalCmZagQGJHQdfAE4Y225ZWXO pbPuQOo4cJnDZ+/5Rt64xEYrGsLywnSdAF3uy/FzjE71O/AOB64ec62hByRCIoVIUkHI k4qJaL7ZFUT1lR9k/E7W/rEN4/8iTSVwxZye98ELjCjP3wOP8edcsMY67S4FEdwF4z0L VF/sNRgFio/q8eMPQG2teWKoebDripDW3L/po/uO4+s/fGwOE6Hc4lGVlnZ76TWUrhpg sohQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bxo3E4Rb; 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 y4sor3165331wrl.33.2018.11.27.08.56.09 for <linux-mm@kvack.org> (Google Transport Security); Tue, 27 Nov 2018 08:56:09 -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=Bxo3E4Rb; 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=y8jDgA1AyN3NE4eBg/lwMVayjAlQQavKYDtyjUMWkmY=; b=Bxo3E4Rb7z32spR+GjTU3/UkKTGzAZUE/6ScwrxnZHct9+8n6DhIPAlWfNPk4yvtAq PkF5qmbAKLUkwJhskz+edVmt8U0gNIS7JXhbzegEAAnxrdyJob+N+sL6TAIVBVcjvmD4 PwOc2fCWgzsAQX/lmgBsIe2l2PS+aXGvAZR8ehnhsFLiJngL0VkrxwD6JHkJ2PO4YGx3 XB9Nzoo5zvl1XhXpRJOFc0QeTA1hfU/SeQYwjx5psTSN9ZZuB3a0BO0gCZ+p/qF4b0oG tG+bFW16AGvNk5yTKTIM2JfWNcFnKaii4O5xUCK1MdbaQ2VOisQTBmWTaf8vD/SjaVeQ oypw== X-Google-Smtp-Source: AFSGD/UriVYn0glnQslEJ+Tb2vBU5XdWPYCPaYmqBE94vU0Fqn7cyDlFXFag3HaZdSEdMQAwYsLMhw== X-Received: by 2002:adf:c711:: with SMTP id k17mr15658629wrg.197.1543337768904; Tue, 27 Nov 2018 08:56:08 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 08:56:07 -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 11/25] kasan, arm64: untag address in _virt_addr_is_linear Date: Tue, 27 Nov 2018 17:55:29 +0100 Message-Id: <dd9cda296c70ca6b1839cf4de3ee3137cf5030e7.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/memory.h b/arch/arm64/include/asm/memory.h index 83c1366a1233..5fe2353f111b 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -322,9 +322,10 @@ static inline void *phys_to_virt(phys_addr_t x) #endif #endif -#define _virt_addr_is_linear(kaddr) (((u64)(kaddr)) >= PAGE_OFFSET) -#define virt_addr_valid(kaddr) (_virt_addr_is_linear(kaddr) && \ - _virt_addr_valid(kaddr)) +#define _virt_addr_is_linear(kaddr) \ + (__tag_reset((u64)(kaddr)) >= PAGE_OFFSET) +#define virt_addr_valid(kaddr) \ + (_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr)) #include <asm-generic/memory_model.h>