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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2662C433EF for ; Wed, 8 Dec 2021 18:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Awh5i42yW4jFcPYu0A7nrTDdclofDxk5bL8nLiFI8p4=; b=XpAAtt56F8DrD3 bupj6l3F6AmppFCx64YkrAscCMZpnFnoG8/ke1PzdyosLmIG68ji6NUzbnf3KkZHszPXPaxsxMfFq 9ub7HcAwgySypwZs2dzXSNOkJB9xlt0cUrechvnB0MzGBMQX17Vrvy/z5s6T3LKoMVzyyMbU9208A RtNUl65hbD47kAgkW+CHAHuzgYRkrqtXebQka3yyFDBwKof9hB0th83RGbTvZHIJVeuly/wk0m/yd bVPK4CwMGVVnRUV1nihuGQ9XLifJE8Y0WWOd3eFRAT2MViBIz3xWTfNN0D3EnfC8cDhSZH5k9Qt8g kQk8ZlszK6AAl53Qf1bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mv1d2-00Dsxb-5B; Wed, 08 Dec 2021 18:25:20 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mv1cy-00Dsw5-Ab for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 18:25:18 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 07483B82249; Wed, 8 Dec 2021 18:25:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F844C00446; Wed, 8 Dec 2021 18:25:12 +0000 (UTC) Date: Wed, 8 Dec 2021 18:25:09 +0000 From: Catalin Marinas To: Yunfeng Ye Cc: will@kernel.org, wangkefeng.wang@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, wuxu.wu@huawei.com, Hewenliang Subject: Re: [PATCH v2 1/2] arm64: mm: Rename asid2idx() to ctxid2asid() Message-ID: References: <506863a9-b934-3af3-c70d-3284e14478de@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <506863a9-b934-3af3-c70d-3284e14478de@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_102516_525301_D97FE5AB X-CRM114-Status: GOOD ( 13.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Wed, Dec 08, 2021 at 05:16:45PM +0800, Yunfeng Ye wrote: > The commit 0c8ea531b774 ("arm64: mm: Allocate ASIDs in pairs") introduce > the asid2idx and idx2asid macro, but these macros are not really useful > after the commit f88f42f853a8 ("arm64: context: Free up kernel ASIDs if > KPTI is not in use"). > > The code "(asid & ~ASID_MASK)" can be instead by a macro, which is the > same code with asid2idx(). So rename it to ctxid2asid() for a better > understanding. > > Also we add asid2ctxid() macro, the contextid can be generated based on > the asid and generation through this macro. The changes look fine to me but please repost with your Signed-off-by. Thanks. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF51C4332F for ; Wed, 8 Dec 2021 18:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238866AbhLHS2t (ORCPT ); Wed, 8 Dec 2021 13:28:49 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:46914 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbhLHS2s (ORCPT ); Wed, 8 Dec 2021 13:28:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1034DB82268 for ; Wed, 8 Dec 2021 18:25:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F844C00446; Wed, 8 Dec 2021 18:25:12 +0000 (UTC) Date: Wed, 8 Dec 2021 18:25:09 +0000 From: Catalin Marinas To: Yunfeng Ye Cc: will@kernel.org, wangkefeng.wang@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, wuxu.wu@huawei.com, Hewenliang Subject: Re: [PATCH v2 1/2] arm64: mm: Rename asid2idx() to ctxid2asid() Message-ID: References: <506863a9-b934-3af3-c70d-3284e14478de@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <506863a9-b934-3af3-c70d-3284e14478de@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 08, 2021 at 05:16:45PM +0800, Yunfeng Ye wrote: > The commit 0c8ea531b774 ("arm64: mm: Allocate ASIDs in pairs") introduce > the asid2idx and idx2asid macro, but these macros are not really useful > after the commit f88f42f853a8 ("arm64: context: Free up kernel ASIDs if > KPTI is not in use"). > > The code "(asid & ~ASID_MASK)" can be instead by a macro, which is the > same code with asid2idx(). So rename it to ctxid2asid() for a better > understanding. > > Also we add asid2ctxid() macro, the contextid can be generated based on > the asid and generation through this macro. The changes look fine to me but please repost with your Signed-off-by. Thanks. -- Catalin