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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D3F5C4332F for ; Thu, 5 May 2022 12:04:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E90B34B2A7; Thu, 5 May 2022 08:04:15 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IPsWRHrKB6HY; Thu, 5 May 2022 08:04:14 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id CC7B24B26D; Thu, 5 May 2022 08:04:14 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B69354B23B for ; Thu, 5 May 2022 08:04:13 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WvYCbezZEBAn for ; Thu, 5 May 2022 08:04:12 -0400 (EDT) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 82B1A4B206 for ; Thu, 5 May 2022 08:04:12 -0400 (EDT) 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 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 Cc: kvm@vger.kernel.org, Will Deacon , Catalin Marinas , Peter Shier , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm