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 5E9B1C2BA4C for ; Wed, 26 Jan 2022 13:32:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234965AbiAZNcc (ORCPT ); Wed, 26 Jan 2022 08:32:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234653AbiAZNcb (ORCPT ); Wed, 26 Jan 2022 08:32:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA941C06161C for ; Wed, 26 Jan 2022 05:32:31 -0800 (PST) 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 71CD461221 for ; Wed, 26 Jan 2022 13:32:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC591C340E3; Wed, 26 Jan 2022 13:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643203950; bh=BF//QCDOYS765nSWE02GmvKsCguT/tbnogB393KJsJM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OtdyjI/W2x8VM9/qRRMiy18NtCc12qQjh8ucaKuH2HYe1uyh224S3gzJnq9kyw/vZ 901K73rwgkCD+dq3v48DCyEEY+N4imMVLXo73IX/TOCGqhqUNncpb60TZJKIh59UpK xs5HrwgocEVUbtqnXoLk9BNnegqcAE8S6ng0bXA6ZvaO/r6Y8gvnaryudFphLpzEpk c74kngZzaOF7ZyvfJC5PSiMLwkgyOA7jkfv3NBcA5kOIwMt9B0PxoGLq24mAlnOfTU VPuwp2SnB8kMi9h6E+mZ5+HHxoMxH9YbFwn/LKrKkbKbtn1I4xLdwCXOWu/Y1lJ2U8 YKz6OeBnQR9lA== 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 1nCiPU-003Duu-R8; Wed, 26 Jan 2022 13:32:28 +0000 Date: Wed, 26 Jan 2022 13:32:28 +0000 Message-ID: <87bkzy7hcj.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Shuah Khan , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kselftest@vger.kernel.org Subject: Re: [PATCH] kselftest: kvm/arm64: Skip tests if we can't create a vgic-v3 In-Reply-To: References: <20220125192851.3907611-1-broonie@kernel.org> <87h79q7tln.wl-maz@kernel.org> <87czke7ima.wl-maz@kernel.org> 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: broonie@kernel.org, shuah@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, 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: linux-kselftest@vger.kernel.org aOn Wed, 26 Jan 2022 13:21:17 +0000, Mark Brown wrote: > > [1 ] > On Wed, Jan 26, 2022 at 01:05:01PM +0000, Marc Zyngier wrote: > > Mark Brown wrote: > > > > > So you now only test whether it is possible to create a virtual GICv3, > > > > but don't actually create it. How does this work? > > > > Oh, that's rather obscure in the API - so the file descriptor returned > > > if the test flag is specified can't actually be used? > > > No file descriptor is returned at all from the kernel, so you should > > always get -1 as populated by kvm_create_device(). > > > See virt/kvm/kvm_main.c::kvm_ioctl_create_device(). > > Ugh, right - the descriptor is returned separately to the return code > but is then mapped onto the return code by the library since the library > just aborts on error in the non-test case and in the test case the kernel > returns an inverted boolean which gets passed straight through. Like I > say the API seems a bit confusing here. That's a very... "kind" way of putting it. M. -- Without deviation from the norm, progress is not possible.