Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp405472pxa; Thu, 27 Aug 2020 05:51:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKStAf6+83N1cXS+HzPkgp6sRkQnd4+wRhYcb0IZJpS9jB6P7PYip+SPZUeL/FEjLs5gAN X-Received: by 2002:a50:cbc3:: with SMTP id l3mr19855641edi.58.1598532684604; Thu, 27 Aug 2020 05:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598532684; cv=none; d=google.com; s=arc-20160816; b=sDVOWDYarEj9WR4rDpq42K/kppTh+3JSLzg+xqlxYt5h86KOz4MgvHiIOykgV7WkBm Y1iBLx4AzBT7YrBT/RzQ+uhsNBd+TKWITBZsXuXEh7CCZN2fkrWr5MhRDwhT/I1yCNTi XcZHOMBA0fwl72zL09upUlBqbi9kPjWvK5Ldu78yJdgffgMQns1u3D2zKUAVbeZ86Ewb BtIF6SeoRIc4J6TsOOA7qF39WHPoeXXwUB/TAYsX0YNwIuSfF3RBdE1CSqn/pTOAnKtz nJnBoyU4GOzCDqqR0vKews45gERDxceCaoZ+A+ttLGDAVrLHbGZEIFZYjZ1gcGsbSugb Ue/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tpzREOcIrukXANPEmvrI6Q05nccQGVBf08+JNfkt4Jw=; b=yMmeJOPD1DAxyUHahRmdd4MtA5skshq7tK8r9JX5QxC3zZjj5Gwk74tgZBkPKwHb5S wsEnA9pjMnbn90zZX3iEgsPAjAyHjGPZrlxwDhFbJynifR3BsnoMZ+6E/0zY6F1sh7uH fCy+KUzTs3I4E+4YUk8Dq8RYHVjHO2HyobErHFRMt+nmMKnxpyomH4WOJKTUDhWgnZV2 pdIYRW1BgCgc+N81yDQsypqBQhBLMkWNfqEGD9n4qx2x8P2s/bpv7648bCh6H3hetqE8 uk+PMgHTc3QPMm5LfnXqcAigBw57sn1L74tQOUSY1ssgS+vkFgl+Pg8ctres5KEpa7vb HagA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UHlALGet; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si1302941ejb.562.2020.08.27.05.51.01; Thu, 27 Aug 2020 05:51:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UHlALGet; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729186AbgH0MtR (ORCPT + 99 others); Thu, 27 Aug 2020 08:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729018AbgH0Mnh (ORCPT ); Thu, 27 Aug 2020 08:43:37 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 449A2C061264 for ; Thu, 27 Aug 2020 05:43:37 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id m8so3406066pfh.3 for ; Thu, 27 Aug 2020 05:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tpzREOcIrukXANPEmvrI6Q05nccQGVBf08+JNfkt4Jw=; b=UHlALGethP+XF8Xx15Bkd4rjqcoCWixU2Kg9zK1Ai8YR26cFQnGAAfZFhCzGD5exxl 6DUgXAxpJx0VzhgnLZ8veoDW4D2VtOSwi1WssJvi+C5TYGg6zi8NI4Xx0TfZqWjybswN krFsTBIjs/qGYPkYoEJNzjH8DRa716+rz3GW9MehNX+lOGE5gAHWCjuh/5lW4SAhceUK HEmoCmPRKpZ7AvrLMz7QZRECy09ZoOGSoLkjZnOxrvwevweft/o9soFkVMDNBErYheU/ 9UpwsJUd4LVDpWNX5ew7wyXbZHrKg23EZg+XwyPbO6hXuJecShqgfjPIGSmdM0iHK3G1 SvqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tpzREOcIrukXANPEmvrI6Q05nccQGVBf08+JNfkt4Jw=; b=pOjAqBuRGP1sQ2o269evdQTeybeehR6v6IShDcoa78oLPKRREyGbqcBnLzIdXYcwb4 DqehRkI5mNwkfwEIh5Sxmc6eAn5byVJjQ+dBdF5aCLzxBMdt9ljIk7w7vxY8NQRUa2Mp JITXrAfZFzW784EaS4kPun8ktt0F4W5cr8HJ2fb6i2eZWxQq2vR27Uw42Awrf0LyY+9P k52H12CeQ5MVpzKJwVUDDxTXTXxVIWtTKPsZxk6V/XRQehlD9U/ep2q3U9LiCndn0fzJ rwFs2YAWqzbzjiCMqxbTU3GZpXOgTFbpPBanx6TXiwvhWasdAU/HVMrBGCW2ORMnu3A9 PNzA== X-Gm-Message-State: AOAM532Zqc3Mq3Fk7K3Ef9XjtyPKn1mCXFc4tX0d7rWCmg5WrzGPsyOG JmMTb95xlZv5uAKMWdHiiU5qfseDqMaqkZQeTg+bNA== X-Received: by 2002:a63:4c:: with SMTP id 73mr14624887pga.286.1598532216123; Thu, 27 Aug 2020 05:43:36 -0700 (PDT) MIME-Version: 1.0 References: <518da1e5169a4e343caa3c37feed5ad551b77a34.1597425745.git.andreyknvl@google.com> <20200827104033.GF29264@gaia> <9c53dfaa-119e-b12e-1a91-1f67f4aef503@arm.com> <20200827111344.GK29264@gaia> In-Reply-To: From: Andrey Konovalov Date: Thu, 27 Aug 2020 14:43:25 +0200 Message-ID: Subject: Re: [PATCH 26/35] kasan, arm64: Enable TBI EL1 To: Vincenzo Frascino Cc: Catalin Marinas , Dmitry Vyukov , kasan-dev , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Elena Petrova , Branislav Rankov , Kevin Brodsky , Will Deacon , Andrew Morton , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 1:15 PM Vincenzo Frascino wrote: > > > > On 8/27/20 12:13 PM, Catalin Marinas wrote: > > On Thu, Aug 27, 2020 at 12:05:55PM +0100, Vincenzo Frascino wrote: > >> On 8/27/20 11:40 AM, Catalin Marinas wrote: > >>> On Fri, Aug 14, 2020 at 07:27:08PM +0200, Andrey Konovalov wrote: > >>>> diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S > >>>> index 152d74f2cc9c..6880ddaa5144 100644 > >>>> --- a/arch/arm64/mm/proc.S > >>>> +++ b/arch/arm64/mm/proc.S > >>>> @@ -38,7 +38,7 @@ > >>>> /* PTWs cacheable, inner/outer WBWA */ > >>>> #define TCR_CACHE_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBWA > >>>> > >>>> -#ifdef CONFIG_KASAN_SW_TAGS > >>>> +#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) > >>>> #define TCR_KASAN_FLAGS TCR_TBI1 > >>>> #else > >>>> #define TCR_KASAN_FLAGS 0 > >>> > >>> I prefer to turn TBI1 on only if MTE is present. So on top of the v8 > >>> user series, just do this in __cpu_setup. > >> > >> Not sure I understand... Enabling TBI1 only if MTE is present would break > >> KASAN_SW_TAGS which is based on TBI1 but not on MTE. > > > > You keep the KASAN_SW_TAGS as above but for HW_TAGS, only set TBI1 later > > in __cpu_setup(). > > > > Ok, sounds good. Sounds good to me too. Vincenzo, could you take care of Catalin's comments on your (arm64) patches, do the rebase onto user mte v8, and share it with me? I'll work on KASAN changes in the meantime, and then integrate everything together for v2. Perhaps the best way to test only the arm64 part is writing a simple module that causes an MTE fault. (At least that's what I did when I was testing core in-kernel MTE patches separately.) Or reuse this series, all KASAN patches should rebase cleanly on top of the latest mainline.