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 68D4FC43217 for ; Thu, 5 May 2022 12:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359455AbiEEMHy (ORCPT ); Thu, 5 May 2022 08:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244273AbiEEMHx (ORCPT ); Thu, 5 May 2022 08:07:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDAC545527; Thu, 5 May 2022 05:04:12 -0700 (PDT) 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 AE3B6B82C2B; Thu, 5 May 2022 12:04:11 +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") Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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.