From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 85048C433DB for ; Sun, 17 Jan 2021 12:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E1A02071C for ; Sun, 17 Jan 2021 12:27:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728846AbhAQMYL (ORCPT ); Sun, 17 Jan 2021 07:24:11 -0500 Received: from foss.arm.com ([217.140.110.172]:43802 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728271AbhAQMYI (ORCPT ); Sun, 17 Jan 2021 07:24:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DABEC1FB; Sun, 17 Jan 2021 04:23:22 -0800 (PST) Received: from [10.37.8.4] (unknown [10.37.8.4]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C10153F719; Sun, 17 Jan 2021 04:23:20 -0800 (PST) Subject: Re: [PATCH v3 4/4] arm64: mte: Optimize mte_assign_mem_tag_range() From: Vincenzo Frascino To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Catalin Marinas , Will Deacon , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Andrey Konovalov References: <20210115120043.50023-1-vincenzo.frascino@arm.com> <20210115120043.50023-5-vincenzo.frascino@arm.com> <20210115154520.GD44111@C02TD0UTHF1T.local> <4b1a5cdf-e1bf-3a7e-593f-0089cedbbc03@arm.com> Message-ID: <0c1b9a6b-0326-a24f-6418-23a0723adecf@arm.com> Date: Sun, 17 Jan 2021 12:27:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <4b1a5cdf-e1bf-3a7e-593f-0089cedbbc03@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, On 1/16/21 2:22 PM, Vincenzo Frascino wrote: >> Is there any chance that this can be used for the last bytes of the >> virtual address space? This might need to change to `_addr == _end` if >> that is possible, otherwise it'll terminate early in that case. >> > Theoretically it is a possibility. I will change the condition and add a note > for that. > I was thinking to the end of the virtual address space scenario and I forgot that if I use a condition like `_addr == _end` the tagging operation overflows to the first granule of the next allocation. This disrupts tagging accesses for that memory area hence I think that `_addr < _end` is the way to go. -- Regards, Vincenzo From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 C3BE3C433DB for ; Sun, 17 Jan 2021 12:24:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77BCB20656 for ; Sun, 17 Jan 2021 12:24:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77BCB20656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LAVEVn3B7kcGBzsVvbmP68YHIew77fk4facV7pgHefY=; b=mm2t6cM7XiGNB9HKdB9+k7oFz W8dbF+Q6Hivm/F5ea2u1l3bHo6OZQK6rhWHTxZuz20VPHbH8r5unwx0C4GvgL3S71C1+D9YGZUhWA 9lFgpxYp86rgJWgilx8wrWQCNNRDX57vM98VUr9yXVOhh4wLr7dWNmcStqbidRxbpR0lo2McWsMcH OImp2I67MoH58no0FdThamMmHoauNuNzk90b0jQQCO2toxiqp8eJjW5D2l/30dDteTy4WHiK7ZCRE iE2n6TJkkvMXQVD4jfiBfJEfGP0YL8db/Z/TsOok0o8AjApTqOr6roPMTFGGBFCpMtomhG4IsZOre rSW7Yt4Rg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l175b-0005Cx-UM; Sun, 17 Jan 2021 12:23:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l175Z-0005CY-EC for linux-arm-kernel@lists.infradead.org; Sun, 17 Jan 2021 12:23:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DABEC1FB; Sun, 17 Jan 2021 04:23:22 -0800 (PST) Received: from [10.37.8.4] (unknown [10.37.8.4]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C10153F719; Sun, 17 Jan 2021 04:23:20 -0800 (PST) Subject: Re: [PATCH v3 4/4] arm64: mte: Optimize mte_assign_mem_tag_range() From: Vincenzo Frascino To: Mark Rutland References: <20210115120043.50023-1-vincenzo.frascino@arm.com> <20210115120043.50023-5-vincenzo.frascino@arm.com> <20210115154520.GD44111@C02TD0UTHF1T.local> <4b1a5cdf-e1bf-3a7e-593f-0089cedbbc03@arm.com> Message-ID: <0c1b9a6b-0326-a24f-6418-23a0723adecf@arm.com> Date: Sun, 17 Jan 2021 12:27:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <4b1a5cdf-e1bf-3a7e-593f-0089cedbbc03@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210117_072325_555508_A64B414D X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Branislav Rankov , Marco Elver , Catalin Marinas , Evgenii Stepanov , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Alexander Potapenko , linux-arm-kernel@lists.infradead.org, Andrey Konovalov , Andrey Ryabinin , Will Deacon , Dmitry Vyukov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mark, On 1/16/21 2:22 PM, Vincenzo Frascino wrote: >> Is there any chance that this can be used for the last bytes of the >> virtual address space? This might need to change to `_addr == _end` if >> that is possible, otherwise it'll terminate early in that case. >> > Theoretically it is a possibility. I will change the condition and add a note > for that. > I was thinking to the end of the virtual address space scenario and I forgot that if I use a condition like `_addr == _end` the tagging operation overflows to the first granule of the next allocation. This disrupts tagging accesses for that memory area hence I think that `_addr < _end` is the way to go. -- Regards, Vincenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel