Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp298789pxv; Wed, 21 Jul 2021 23:43:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQo3LF6PYCi4+jg/mgJyN3gSUIZLELEIjTq+0dfgnpgHAiouMeW7neM/dOUOtIYLb77hdV X-Received: by 2002:a05:6638:6a6:: with SMTP id d6mr33866606jad.118.1626936193936; Wed, 21 Jul 2021 23:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626936193; cv=none; d=google.com; s=arc-20160816; b=jALMrXI3wcjOS0kr57uM9gNkz28ujsayvpFuQ0hmlrqx0bjBJ5c+GMVM5SD36fchIQ LhkkP6APVJTkfUXm9tzs5xkhB8jwO5nJjqdzxvnk8g5UbxlWzbNYjIdxbcjIRDnqjzf8 0K8+XiEYUsqdnTWdb0garbETEs7A/mcDCzBCx2iR0ucgyXsVknxinDqkXp7E+aeCjvQG cp3izM7ZNkl/NylLZIJXkwWFLDL5F6mr/mmFMgMgiyRD6ePqbKRjjRI9S51wDsAZ+iGx 1xfsn1ni+/osTjZvAv4w9LzqcRNxR6eOt79qRVVvpR/dYtk7cj531T96EY53oH6B9glB TYaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=TAL4r06GHCBeDg0WTyQUnyF7Ts1MFAUdPaoJPlkpg+c=; b=rkiVQj8BK/TLcQmFFLlO4CpadNaVVwNbdIPpOs5Nrs68AxfYBLYpqN8oR8uGFJvDi6 vW9h8DU1GRGSEGiqwotZ5KpmuRKJM/TYWMR3wWbhhHnmJj+7w6hJ6D8bzN5aEVNTUHrS w/5REOup65yoxPsNQ2S7ilE7JxwwNOQMlWylx2ThrPnLG4QrQzUb8Usm0hDrfB2r6eQ1 D60JiJFWo0aOmVWWIBQ7y/hGJ/0wgo8cqAnri40tqQ0AZPaSpP/iqjy0e/l/bUJrVspA S4cIyiownmgA183Hn2EXPiQiKIYIr22IaE494Hqr8Wbr9fCWfrb+40LWFV/ShgbfT6XG OH+w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si5124684iop.0.2021.07.21.23.43.03; Wed, 21 Jul 2021 23:43:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230367AbhGVGBP convert rfc822-to-8bit (ORCPT + 99 others); Thu, 22 Jul 2021 02:01:15 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:3958 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbhGVGBO (ORCPT ); Thu, 22 Jul 2021 02:01:14 -0400 Received: from dggems705-chm.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4GVj4M3zjCz827t; Thu, 22 Jul 2021 14:20:35 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggems705-chm.china.huawei.com (10.3.19.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 22 Jul 2021 14:24:15 +0800 Received: from lhreml710-chm.china.huawei.com ([169.254.81.184]) by lhreml710-chm.china.huawei.com ([169.254.81.184]) with mapi id 15.01.2176.012; Thu, 22 Jul 2021 07:24:13 +0100 From: Shameerali Kolothum Thodi To: Will Deacon CC: "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "linux-kernel@vger.kernel.org" , "maz@kernel.org" , "catalin.marinas@arm.com" , "james.morse@arm.com" , "julien.thierry.kdev@gmail.com" , "suzuki.poulose@arm.com" , "jean-philippe@linaro.org" , "Alexandru.Elisei@arm.com" , Linuxarm Subject: RE: [PATCH v2 1/3] arch/arm64: Introduce a capability to tell whether 16-bit VMID is available Thread-Topic: [PATCH v2 1/3] arch/arm64: Introduce a capability to tell whether 16-bit VMID is available Thread-Index: AQHXYshKGBZfllyF/kqTqR+/q/JZlqtNslSAgAEMQiA= Date: Thu, 22 Jul 2021 06:24:13 +0000 Message-ID: <027c314e664c4d4889917e95a2aa58c1@huawei.com> References: <20210616155606.2806-1-shameerali.kolothum.thodi@huawei.com> <20210616155606.2806-2-shameerali.kolothum.thodi@huawei.com> <20210721152316.GB11003@willie-the-truck> In-Reply-To: <20210721152316.GB11003@willie-the-truck> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.80.98] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Will Deacon [mailto:will@kernel.org] > Sent: 21 July 2021 16:23 > To: Shameerali Kolothum Thodi > Cc: linux-arm-kernel@lists.infradead.org; kvmarm@lists.cs.columbia.edu; > linux-kernel@vger.kernel.org; maz@kernel.org; catalin.marinas@arm.com; > james.morse@arm.com; julien.thierry.kdev@gmail.com; > suzuki.poulose@arm.com; jean-philippe@linaro.org; > Alexandru.Elisei@arm.com; Linuxarm > Subject: Re: [PATCH v2 1/3] arch/arm64: Introduce a capability to tell whether > 16-bit VMID is available > > On Wed, Jun 16, 2021 at 04:56:04PM +0100, Shameer Kolothum wrote: > > From: Julien Grall > > > > At the moment, the function kvm_get_vmid_bits() is looking up for the > > sanitized value of ID_AA64MMFR1_EL1 and extract the information > > regarding the number of VMID bits supported. > > > > This is fine as the function is mainly used during VMID roll-over. New > > use in a follow-up patch will require the function to be called a every > > context switch so we want the function to be more efficient. > > > > A new capability is introduced to tell whether 16-bit VMID is > > available. > > I don't really buy this rationale. The VMID allocator introduced later on > caches this value in the static 'vmid_bits' variable, and that gets used > on vCPU enter via vmid_gen_match() in the kvm_arm_update_vmid() fastpath. > > So I would prefer that we just expose an accessor for that than introduce > a static key and new cpufeature just for kvm_get_vttbr(). Ok. Will change it to an accessor. Thanks, Shameer