Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1134988lqb; Thu, 18 Apr 2024 00:39:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDLo5Kkj/QiM6QyW1fxMK+FUaHOqt/sD6NpazZZGJCHpR72fqI0Ajva6SxjLwsXX9H6629n0qHMIo1xw9d7RSYHrO3iMrB8qVbmu4Dxw== X-Google-Smtp-Source: AGHT+IH3n7OsuOxwSZSTx/0ABrjclZPcwEUwXaMKh+BM6bxv3B74jfAdfvbBP8CPN5veXN+6GxAq X-Received: by 2002:ac8:5f06:0:b0:434:9ba7:de66 with SMTP id x6-20020ac85f06000000b004349ba7de66mr2310312qta.32.1713425982590; Thu, 18 Apr 2024 00:39:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713425982; cv=pass; d=google.com; s=arc-20160816; b=pmhY8jYQB2EFBJ8TTRPQJmGv+48vtHtt6Jee1hvpoyaKa925+o610MJbjCRDEOIgi9 Z6LeoDR+SXXlVhtC2uYd0KBZTQFwEw2EJst1+IAHVPNpehH99e82DmjQklssHcrBQZCj rs8vO5qI2FU7pz+GGM85zvMd5BwVHaA95Zy1bx12Lg+9xP2YKZm69uauT8CwwZO8+1KY EYUXV5J947ttAXds360efhbYrMnGCTGHFUghuDAgnYvm/fe+ozq0erYeks+aj2G0OQAN gURO3SUTXtL6PZtGAH0rad9ERzg9lPfrr8QIoKjnIoC3hnh5DiTQ4bSbL/ZTGPw3yn1f VkKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=tcPW4OBhdBi/wKHGRw7uf+99nzPH1fqOqhaqrJrmzQE=; fh=Fdf/YUNH9/W65JjUyN7EvZq9B3Otp5rhjQQaOJmibI4=; b=upCtNaU4Od5aoDLtcrD3wqomLuJvShZrEFCdq4n4qLe4rVenr/AA0UHTnoZ0LrhZz/ qJYefc3YImeaw0QH8ev27bCIkdxQSjRiZoslF9+fN5GEfwRWn4W4FoZumcMpOIXd069y 4/emOoa2tpmQBtlvm92Au/+gSJ1LlgXPNWfjD6xSjIRAx5/C2UYq8OGt7aoY1jqb5qjx hJzyUk0D89gXwep6WPR55cMlNONNQ7WcTapa00bNcaUCAKZ5wKfcaPgWSq3ZYlO9zPHd sHByV3yDLmbtEAK46NyqYht0QFE+7EKAsLY+8jsgmuwdHkVjVPD1YwFR51yUCNQu4+Kj u1eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WzOBxWl6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-149665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i14-20020ac85e4e000000b0043659515ffesi914002qtx.265.2024.04.18.00.39.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 00:39:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WzOBxWl6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-149665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 540EA1C218FE for ; Thu, 18 Apr 2024 07:39:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 927B16E5EF; Thu, 18 Apr 2024 07:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WzOBxWl6" 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 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.