From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5963495CB; Thu, 18 Apr 2024 07:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713425975; cv=none; b=kgCgyvenTC7wnMxuKG1yPzucmbpiJ6g0xQ/S3frGUIkMme8tCIVafh1pQtVq38AXHjKIkoNw9eRpFMZCjITgrzoOu8J/tYQLq5Sho3GKTG2L11Qzi8DBS4SHoZbryfaarGX0cj+swVfTXyjVRtEsa4XWvjSGdE6BWg3e3zOpl40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713425975; c=relaxed/simple; bh=Z+sLE9qE5yLeqgmy68oKMe/JtUYYlAxlrjumbj0nrSo=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Io9GK9UqsOMUF+RNpYsNyEufGtDXstcOHzKzyspxAOfIPN3ktxzkRGP3/uGqmcXGQPW8bpShoZjuhs14HtmCbTdxeuXpmCJpRWcaM64ZUxBrLFHtNWiOFP+3bfPLr5e5oJtIgiGXO9iXxniCJ7ggr+HND0uMcDfZnOCXxM6UjQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WzOBxWl6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WzOBxWl6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E00DC113CC; Thu, 18 Apr 2024 07:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713425975; bh=Z+sLE9qE5yLeqgmy68oKMe/JtUYYlAxlrjumbj0nrSo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WzOBxWl6mPuDAJOSKv9gcHYVNsYYmhP3YY/MPeMbnylJljEzJipqQIEUx/6W4dU3O TSLH8oBTTxTgf1x5Fb8TN1LK7wZAbRNNHVNZbJATyDFeImhPD1ewDa+He11W30kayO okkmV9/8VcWuvYpHxd5YiM5nDuITnxvytTM1WQWJXgD55/+KTeUE6QLrreEd4XH1pW nXCQ2eAdMktJA1Z0/PNOlb72voRriKmSb8PiL5eQj9kFmXTpBmLNUfGTE/3lh5WILt T+Trrn0Ihf+4BnIcu//dHa+gZDtVOlLTBeUcx52oL/FcJs+/wm8pTRDZLrEjcQk4m1 eZMPW4XPv1Sgw== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rxMMm-005eQO-Fc; Thu, 18 Apr 2024 08:39:32 +0100 Date: Thu, 18 Apr 2024 08:39:29 +0100 Message-ID: <871q73rufi.wl-maz@kernel.org> From: Marc Zyngier To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, Oliver Upton , Will Deacon , kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Fuad Tabba Subject: Re: [PATCH 1/2] KVM: arm64: Replace custom macros with fields from ID_AA64PFR0_EL1 In-Reply-To: <20240418053804.2573071-2-anshuman.khandual@arm.com> References: <20240418053804.2573071-1-anshuman.khandual@arm.com> <20240418053804.2573071-2-anshuman.khandual@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, oliver.upton@linux.dev, will@kernel.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, tabba@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false + Fuad On Thu, 18 Apr 2024 06:38:03 +0100, Anshuman Khandual wrote: > > This replaces custom macros usage (i.e ID_AA64PFR0_EL1_ELx_64BIT_ONLY and > ID_AA64PFR0_EL1_ELx_32BIT_64BIT) and instead directly uses register fields > from ID_AA64PFR0_EL1 sysreg definition. > > Cc: Marc Zyngier > Cc: Oliver Upton > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-kernel@lists.infradead.org > Cc: kvmarm@lists.linux.dev > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > arch/arm64/kvm/hyp/include/nvhe/fixed_config.h | 8 ++++---- > arch/arm64/kvm/hyp/nvhe/pkvm.c | 4 ++-- > arch/arm64/kvm/hyp/nvhe/sys_regs.c | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h b/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h > index 51f043649146..0034bfffced6 100644 > --- a/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h > +++ b/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h > @@ -52,10 +52,10 @@ > * Supported by KVM > */ > #define PVM_ID_AA64PFR0_RESTRICT_UNSIGNED (\ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL0), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL1), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL2), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL3), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL0), ID_AA64PFR0_EL1_EL0_IMP) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL1), ID_AA64PFR0_EL1_EL1_IMP) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL2), ID_AA64PFR0_EL1_EL2_IMP) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL3), ID_AA64PFR0_EL1_EL3_IMP) | \ If you are going to rework this, can we instead use something less verbose such as SYS_FIELD_GET()? There is also a series from Fuad moving things around, and maybe that's the opportunity to rework this while limiting the amount of cosmetic churn. Not to that this fixed config stuff needs to be reworked in order to match the runtime feature enforcement that the rest of KVM has adopted. Thanks, M. -- Without deviation from the norm, progress is not possible. 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 0B56CC4345F for ; Thu, 18 Apr 2024 07:39:52 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UsrExYau55oqVXWnOknYShROCX91VZkw+4VAyKaXRRY=; b=vzOciDp0w5cvxR aKPw0TY7LQBYy5vsaROf90F144pa6MYl3uMDAeOiM+meDO5wGacN8rIpOSJfF0a++nkvXpS3xl/RA kR4c1rSXSjcN3SXV+VlMJ3TBeE7BjBFDsexjrYfFLOVKMddggdTSUPqBY9IdYN3oSR3llkVNpK+Xz 3K1BkpnT/u6LAsVllm2hzVV0slLRLGn4tAEWsYeFLQ3rfzCOijBGXT308mKmAhBHndyoZUWacleJg eoappvyOODuTPcgcFpSO8WIT5InM9Ekrepmjs4n+a5pmeZeLAciOOzH+u6jA7CsTNaegeYBLQszpJ 2yP2ieU5Y2KOdLx0t8dA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMMt-00000001IWT-2ROV; Thu, 18 Apr 2024 07:39:39 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMMq-00000001IVz-2k3K for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2024 07:39:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8B47A61735; Thu, 18 Apr 2024 07:39:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E00DC113CC; Thu, 18 Apr 2024 07:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713425975; bh=Z+sLE9qE5yLeqgmy68oKMe/JtUYYlAxlrjumbj0nrSo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WzOBxWl6mPuDAJOSKv9gcHYVNsYYmhP3YY/MPeMbnylJljEzJipqQIEUx/6W4dU3O TSLH8oBTTxTgf1x5Fb8TN1LK7wZAbRNNHVNZbJATyDFeImhPD1ewDa+He11W30kayO okkmV9/8VcWuvYpHxd5YiM5nDuITnxvytTM1WQWJXgD55/+KTeUE6QLrreEd4XH1pW nXCQ2eAdMktJA1Z0/PNOlb72voRriKmSb8PiL5eQj9kFmXTpBmLNUfGTE/3lh5WILt T+Trrn0Ihf+4BnIcu//dHa+gZDtVOlLTBeUcx52oL/FcJs+/wm8pTRDZLrEjcQk4m1 eZMPW4XPv1Sgw== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rxMMm-005eQO-Fc; Thu, 18 Apr 2024 08:39:32 +0100 Date: Thu, 18 Apr 2024 08:39:29 +0100 Message-ID: <871q73rufi.wl-maz@kernel.org> From: Marc Zyngier To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, Oliver Upton , Will Deacon , kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Fuad Tabba Subject: Re: [PATCH 1/2] KVM: arm64: Replace custom macros with fields from ID_AA64PFR0_EL1 In-Reply-To: <20240418053804.2573071-2-anshuman.khandual@arm.com> References: <20240418053804.2573071-1-anshuman.khandual@arm.com> <20240418053804.2573071-2-anshuman.khandual@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, oliver.upton@linux.dev, will@kernel.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, tabba@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240418_003936_802896_0F69E77A X-CRM114-Status: GOOD ( 20.21 ) 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 + Fuad On Thu, 18 Apr 2024 06:38:03 +0100, Anshuman Khandual wrote: > > This replaces custom macros usage (i.e ID_AA64PFR0_EL1_ELx_64BIT_ONLY and > ID_AA64PFR0_EL1_ELx_32BIT_64BIT) and instead directly uses register fields > from ID_AA64PFR0_EL1 sysreg definition. > > Cc: Marc Zyngier > Cc: Oliver Upton > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-kernel@lists.infradead.org > Cc: kvmarm@lists.linux.dev > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > arch/arm64/kvm/hyp/include/nvhe/fixed_config.h | 8 ++++---- > arch/arm64/kvm/hyp/nvhe/pkvm.c | 4 ++-- > arch/arm64/kvm/hyp/nvhe/sys_regs.c | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h b/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h > index 51f043649146..0034bfffced6 100644 > --- a/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h > +++ b/arch/arm64/kvm/hyp/include/nvhe/fixed_config.h > @@ -52,10 +52,10 @@ > * Supported by KVM > */ > #define PVM_ID_AA64PFR0_RESTRICT_UNSIGNED (\ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL0), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL1), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL2), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL3), ID_AA64PFR0_EL1_ELx_64BIT_ONLY) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL0), ID_AA64PFR0_EL1_EL0_IMP) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL1), ID_AA64PFR0_EL1_EL1_IMP) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL2), ID_AA64PFR0_EL1_EL2_IMP) | \ > + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_EL3), ID_AA64PFR0_EL1_EL3_IMP) | \ If you are going to rework this, can we instead use something less verbose such as SYS_FIELD_GET()? There is also a series from Fuad moving things around, and maybe that's the opportunity to rework this while limiting the amount of cosmetic churn. Not to that this fixed config stuff needs to be reworked in order to match the runtime feature enforcement that the rest of KVM has adopted. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel