Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4642070iob; Sun, 8 May 2022 20:18:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTRETDb59PAjV9i5V8Ly6DS4xKPPmp/c9qwwGmd7ZozTlwQjC5kbvxbjj0dx24hLirrKEd X-Received: by 2002:a17:90a:ce13:b0:1d9:acbe:7ede with SMTP id f19-20020a17090ace1300b001d9acbe7edemr24469767pju.16.1652066310808; Sun, 08 May 2022 20:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652066310; cv=none; d=google.com; s=arc-20160816; b=R+jefk7f2e/xnf08jxHBT8sAELFQ8yrW3Kq8A639dwSD+ug4PVX8wyVHib92TKDqta zqrpvkuLy2fNMRLyvpJKygF9rJ72ByOSNSiMn2KdGzurP0VHR5SBCVmlELrTfUwdQLdv lvu7+MfySN0GCKxKB7FLDWs2nnUmualtFE9kVIlHNnnGqST0GFJxCWmGBT3tQkoxNJr0 cwB4C/mnMGa0Ec+urw5d496ie4s4MliMoo3MUE/zTrZ4fqpFqamTKJ5MMGEtl2oI8Q7N 9yfc2XoB81f6oaPlcWmfqY2LJskFH2qLoID3Lw765ppfXAL349ALcl/T2xylxzlI/efA bqAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=FyRvLCdjxr5S4dYGmmtu1CLJ36sD0PgDp/PY7+sxD/Y=; b=Vtx/d+VJ3l1/hy5inSHZduObGFI9upik6UEouJmJNqZoxRO9WgWRsJwgcX027vX4gm flV0xQRbR5/p4xWWY9R559VZxFZocRdlboTZotXPi2taVNwDEtkcRMpS3KTJeWv8AU8P UObaMqJ9ATvms04Xgy27qqacFW4d0QTfrMrqjkX/QTmyYGHnJPpay0RTszcOrzn5CUpa qqa07/tyvo9/PA0NiEs7SIu86Sq2Ue0RtYRmkM84G07EDbs9pKqOJlxw78eFeYjkgaaW jhrHwQKQtFTfSS8QGotgkOZ900KAY3mycPm1NPHXj8KSSK1K7ogXC/KpY0BXZHV/MmO9 fnFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="td/Txg+E"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l64-20020a638843000000b003c66ac08612si8484588pgd.524.2022.05.08.20.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:18:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="td/Txg+E"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A3F4795485; Sun, 8 May 2022 20:16:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359475AbiEEMHy (ORCPT + 99 others); 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.