Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp165830rdb; Thu, 16 Nov 2023 15:23:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcaqGVKIMpBbSNnr8iu2AyEetghDHNVBXlPLgUqsn6yO25awLFXgGJM/Pee42kbacNNTIP X-Received: by 2002:a05:6a20:7295:b0:187:804:91fa with SMTP id o21-20020a056a20729500b00187080491famr9710518pzk.35.1700176996780; Thu, 16 Nov 2023 15:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700176996; cv=none; d=google.com; s=arc-20160816; b=bKHYDXQl1K9KU1uNqOmZHoBEWt+7WCLj8sd4VTbJIpyfHA02G2h6KK7ZgWjHF2noDv 3UD6qxBlp2qWXEfjVtCW0ADEb7mpW95Q5Hn0CkbGOkj6sTzKsy10pBekic4KNkL7VMmC eYRYXEEhIJggoYe1E9dWWOZERQx+fZ1zOI44Uopj7/Y8Rp3LtldUHnWlt2AMHYeKcStZ UfzWXNKw6sVxJ2X7CU10mv0WW5R8iwDlIdliPWL/UjuH92cI03v2XJksXHsTpn0lFnWh LoXR6lU37S3tRsFnIe4BRbNibOByiNRdf/aPEMAoMYlJH/1ZHLBsOaS5EMfz1CE/5v/a HBug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=ql19/OGj64AFFaCoG3rNb0IvzQY8kBjJxvcnLCSOPkE=; fh=ah0XOax8FjSMashPHGJA4i7Nc0huj0uEhGhLMiNTfKQ=; b=frNU/lmajyZqisoycrspmxTQ8Ow2v1BR94WdukCFrbmJ46iVFc7+PctYqzFn1BXab7 PzCakOUgGt/Ms6bgpq1wEv4zTw65SldcSxGjT4CeBJuHRVZqz+n3Y097goxR4BRk48rA 1F6ZMOdBKmwkVzsQ8x2GQfWUmlfYevU574n5w8XvqTqE/jLGcyiysfsp7Xnc1XLB4ppO xu/Q/yQ4MJSbGWzWJQBiEksTd+FEc1VrGEdpUvlzs5AjA/hFJp/b/eiauttc9U9JH8W9 YaQ631+0EvS9VOZ3icHQ5/sorKVAPb82LXQURJvyz1rOMtz6FL7tPHQ9+0KlKSDhaGPO Yznw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=R8N+dwXM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z1-20020a056a00240100b006c21aeb4041si598299pfh.125.2023.11.16.15.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 15:23:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=R8N+dwXM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 783F98088697; Thu, 16 Nov 2023 15:22:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229745AbjKPXWf (ORCPT + 99 others); Thu, 16 Nov 2023 18:22:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjKPXWf (ORCPT ); Thu, 16 Nov 2023 18:22:35 -0500 Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [IPv6:2001:41d0:203:375::af]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2A4EA for ; Thu, 16 Nov 2023 15:22:31 -0800 (PST) Date: Thu, 16 Nov 2023 15:22:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700176949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ql19/OGj64AFFaCoG3rNb0IvzQY8kBjJxvcnLCSOPkE=; b=R8N+dwXMjjEbQXwnXgnMViFOkdYDxySMg7onZbQpLj/tOmnHLechypeTzAq+V0LetrVLWJ WA5CT9AJKg+AwMhnccXO7mdC0rgkOjk+G+5eyWGxMT2HDH7UMds2PWp178gFqUDSq6S4z2 pFHr6VXLWTQNKBE3e33gvmO+YXukj8g= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: "Russell King (Oracle)" Cc: Jianyong Wu , maz@kernel.org, james.morse@arm.com, will@kernel.org, salil.mehta@huawei.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, justin.he@arm.com Subject: Re: [PATCH] arm64/kvm: Introduce feature extension for SMCCC filter Message-ID: References: <20231116114152.912344-1-jianyong.wu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 15:22:37 -0800 (PST) On Thu, Nov 16, 2023 at 07:06:18PM +0000, Russell King (Oracle) wrote: > On Thu, Nov 16, 2023 at 11:41:52AM +0000, Jianyong Wu wrote: > > 821d935c87b introduces support for userspace SMCCC filtering, but lack > > of a way to tell userspace if we have this feature. Add a corresponding > > feature extension can resolve this issue. > > > > For example, the incoming feature Vcpu Hotplug needs the SMCCC filter. > > As there is no way to check this feature, VMM will run into error when > > it calls this feature on an old kernel. It's bad for backward compatible. > > Can't you just attempt to use the SMCCC filtering, and if it errors out > with the appropriate error code, decide that SMCCC filtering is not > available? That would also work, as we return ENXIO for the unsupported ioctl. > That's how most things like kernel syscalls work - if they're not > implemented they return -ENOSYS. glibc can detect that and use a > fallback. I generally agree, but KVM has gone in the other direction of providing auxiliary interfaces for discovering new UAPI. ENXIO has been slightly overloaded to imply that a given ioctl is non-existent or otherwise unsupported due to some dynamic configuration. Is it ideal? Of course not. With that said userspace may as well use the preferred / documented discoverability mechanism. And in Jianyong's case the KVM documentation is rather unambiguous (for once) about how you discover device attributes. https://docs.kernel.org/virt/kvm/api.html#kvm-has-device-attr -- Thanks, Oliver