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 139FAC433EF for ; Thu, 5 May 2022 12:08:53 +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=yYgeGkK0XF3tL8uU01qD/GleCcBaxgQM3TUKbi7O31c=; b=hCVLjVjoRg26WZ t1SjvongXBEVfKwc7gwvefukTQSZHFbvXRaNwBVImjUSZK7Yv/oUrIVtWeP/UUyxjuGMuA7raTgCL ONqCbQx7b66XIY8WF+mBoCCnOIDDRMbaGFy0RpemN5IUE2Xh7b9OLPjcAh0WYbWNqf92hxMB9aL4Q FnceID1/+gC1mMhLiH1AHliEHu3UUqWOTCWP50NMEmiK446N8BkYUCEGUonLJw/M3DKf7CPYrbB6w rBrpowsszHzJam50xZG8nGJuFnkBAydV8mmaurwQ4mdRYdjsJbUmGy+fOhnZoDzaA/0HKiEivVXb2 8irz1ke1CFBfPHZqpm7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmaGk-00FgoM-5G; Thu, 05 May 2022 12:07:42 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmaDM-00FeaD-21 for linux-arm-kernel@lists.infradead.org; Thu, 05 May 2022 12:04:13 +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 dfw.source.kernel.org (Postfix) with ESMTPS id EB97061CEB; Thu, 5 May 2022 12:04:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EC45C385A4; Thu, 5 May 2022 12:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651752250; bh=bkJvphN7syBYWRsUJY+LC4KlT+zXODM0ziWUwHCjA/0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=td/Txg+E2NK7U7QAjor3Z4L0qanKjWzlFWAGi8ipOLZ3Z10aa883FcQJL0K8w5RtT j90NRbECApWwgMI097QJ5gDdRY5C2N6nOFLOPxbUPd3LXquIa0qM2dLXFkNOo0crAr l08byEWOYbQamUUdh3FBGhHiyO9dNYPlyHlBy2UFhqkYdgVpMkMOoq/rG+fMccrIIa WqM8yxtwsi8y6LfyPsseXcSlHCpHvxhYeIdqFCzXOE1cP2KPXAhbPRVVd7KqSxCjYa J4Xm3pRGWPwW6p9PVmJbmOnqY8Nse8pls6fs0mNCwKhLTWMJF52M8/emhjuiPvN37B z2ATW/zVAf+iw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nmaDH-009CAb-M4; Thu, 05 May 2022 13:04:07 +0100 Date: Thu, 05 May 2022 13:04:07 +0100 Message-ID: <87zgjw6v9k.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: Raghavendra Rao Ananta , Andrew Jones , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Reiji Watanabe , Jing Zhang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH] selftests: KVM: aarch64: Let hypercalls use UAPI *_BIT_COUNT In-Reply-To: References: <20220504184415.1905224-1-rananta@google.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/27.1 (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.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, rananta@google.com, drjones@redhat.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, pbonzini@redhat.com, catalin.marinas@arm.com, will@kernel.org, pshier@google.com, ricarkol@google.com, reijiw@google.com, jingzhangos@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org 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-20220505_050412_231177_1574B111 X-CRM114-Status: GOOD ( 25.87 ) 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, 04 May 2022 20:58:42 +0100, Oliver Upton wrote: > > Hi Raghavendra, > > On Wed, May 04, 2022 at 06:44:15PM +0000, Raghavendra Rao Ananta wrote: > > The hypercalls test currently defines its own *_BMAP_BIT_MAX macros to > > define the last valid feature bit for each bitmap firmware register. > > However, since these definitions are already present in the uapi header, > > kvm.h, as *_BMAP_BIT_COUNT, and would help to keep the test updated as > > features grow, use these instead. > > LOL, looks like I lost that one in the end! Still, the fact that you're > patching the selftest highlights the fact that there is a nonzero chance > of userspace using this value incorrectly expecting it to hold true > across all kernels. > > Since this is the route going forward can we please consider documenting > the fact that _BIT_COUNT *will* change and is not stable between kernel > versions. Bad UAPI expectations could throw a wrench into this entire > plan we've hatched for preserving hypercall ABI. > > Just a warning at the end of the register documentation would suffice. Maybe something in the kvm.h file as well, as the includes are often distributed without the kernel documentation. Something like: diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index e523bb6eac67..3cde9f958eee 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -342,6 +342,10 @@ struct kvm_arm_copy_mte_tags { enum { KVM_REG_ARM_STD_BIT_TRNG_V1_0 = 0, + /* + * KVM_REG_ARM_STD_BMAP_BIT_COUNT will vary as new services + * are added, and is explicitely not part of the ABI. + */ KVM_REG_ARM_STD_BMAP_BIT_COUNT, }; @@ -349,6 +353,10 @@ enum { enum { KVM_REG_ARM_STD_HYP_BIT_PV_TIME = 0, + /* + * KVM_REG_ARM_STD_HYP_BMAP_BIT_COUNT will vary as new + * services are added, and is explicitely not part of the ABI. + */ KVM_REG_ARM_STD_HYP_BMAP_BIT_COUNT, }; @@ -357,6 +365,10 @@ enum { enum { KVM_REG_ARM_VENDOR_HYP_BIT_FUNC_FEAT = 0, KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1, + /* + * KVM_REG_ARM_VENDOR_HYP_BMAP_BIT_COUNT will vary as new + * services are added, and is explicitely not part of the ABI. + */ KVM_REG_ARM_VENDOR_HYP_BMAP_BIT_COUNT, }; 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