Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp732264rwi; Wed, 2 Nov 2022 17:57:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6cP6mJUHJyifj3uOvlCeHC5+0lloRptLnHYeHg9WrmBrtyOFNSFl7Vymssq+Yvh1vn/s1m X-Received: by 2002:a05:6402:1553:b0:461:539d:9b88 with SMTP id p19-20020a056402155300b00461539d9b88mr26783383edx.286.1667437074919; Wed, 02 Nov 2022 17:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667437074; cv=none; d=google.com; s=arc-20160816; b=y2RIBFcmHor9mP+Twv3EoJOf4ugOz0KCY7nnx0vd/10RYzsG6DmarOdVI+ctmsy9Jy d3x+56ybJW4dMHWu/ETqj23ZGpvbUVRg5gu9emhiFVT2aUhIuumYKWnmakqx/1HMILAL GZLTWlJfPP4Q4A7h0GHn08fI6cZRWn8Fb+inGJ1bzWe/GUBbtaffphF2nDWR+w22Z5l8 stS4nxuFDdIe0CZ/3cETn9AgdA4gVCNZdHPXOnCSjkHcDiD6gwGaCa/5MT5tKeEwQbLd iEGEHhIROAB1/n3lHajr09v3IEcSD+nddtgg9psKyt5P3Vce07qvMK0+YaIO0oY/Pi68 7V9Q== 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:date:dkim-signature; bh=uYBBsfmshVQx/VAhIoQJxW1c2jQ56hHqTePXAdb9GwA=; b=gAuTGy6X+fpWZ0DDCOL+cRI5gaJlR2rCOaBeSCV1pzXsGCF1Jh9YflR8ERKepEu0qJ m++/yOxeMAEHS0r1/pJnh4trbtdXF/1sC01ozssRSo+Yk3cgVVyatkTlkF10kkktanQY tneBWGDwG2hmvKlCLbR85ZbwhkekQUr3pQ4UZ4u58P5FaFYjut71CXPnow8q3XQ/XdJs wlmDazObo9/Ewu3Pa4ymqnnCykbMXzfQhRE2AIFKcePy/157rQe2l8Ihu1LqazYrQy4l BMt4cXm65sE/8CfceCfTiTdcRF9Eh5lSUqCT4zYdhSarYkHBRbd0N6SzpUfMNO5DlBEj ndCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lbCp5Ez2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm20-20020a170907949400b00779a3220c5asi19290836ejc.343.2022.11.02.17.57.29; Wed, 02 Nov 2022 17:57:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lbCp5Ez2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230427AbiKCAT7 (ORCPT + 97 others); Wed, 2 Nov 2022 20:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbiKCAT4 (ORCPT ); Wed, 2 Nov 2022 20:19:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 831909FEC; Wed, 2 Nov 2022 17:19:55 -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 3C96FB82521; Thu, 3 Nov 2022 00:19:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43080C433C1; Thu, 3 Nov 2022 00:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667434792; bh=Tst9FZn+PSNvZMX9r7WTW29UtRFXetjshyspQF5HoVg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lbCp5Ez2LUzxaW6vzzzQG5CEC+aJfHviHZBhbml/Jr6xAa4IaGLlLO/KXub/ZUnk7 D52q7DFLkrKw/pgLQqI7sB00OUfUiWLuHy5+Whve8McIREr4unOSxLOcrSLtohQ1PD Wda5XdSeeAznGV3U5S2KZTPNemCoGXtw8sw8+qak= Date: Thu, 3 Nov 2022 01:20:48 +0100 From: Greg Kroah-Hartman To: Elliot Berman Cc: Arnd Bergmann , Bjorn Andersson , Dmitry Baryshkov , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Andy Gross , Jassi Brar , linux-arm-kernel@lists.infradead.org, Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Will Deacon , Catalin Marinas , Srinivas Kandagatla , Amol Maheshwari , Kalle Valo , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 13/21] gunyah: vm_mgr: Introduce basic VM Manager Message-ID: References: <20221026185846.3983888-1-quic_eberman@quicinc.com> <20221026185846.3983888-14-quic_eberman@quicinc.com> <7c59a115-36c5-c954-5610-ef5ef1dbb83e@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c59a115-36c5-c954-5610-ef5ef1dbb83e@quicinc.com> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Wed, Nov 02, 2022 at 11:44:51AM -0700, Elliot Berman wrote: > > > On 11/2/2022 12:31 AM, Arnd Bergmann wrote: > > On Wed, Oct 26, 2022, at 20:58, Elliot Berman wrote: > > > > > +static const struct file_operations gh_vm_fops = { > > > + .unlocked_ioctl = gh_vm_ioctl, > > > + .release = gh_vm_release, > > > + .llseek = noop_llseek, > > > +}; > > > > There should be a .compat_ioctl entry here, otherwise it is > > impossible to use from 32-bit tasks. If all commands have > > arguments passed through a pointer to a properly defined > > structure, you can just set it to compat_ptr_ioctl. > > > > Ack. > > > > +static long gh_dev_ioctl_create_vm(unsigned long arg) > > > +{ > > > + struct gunyah_vm *ghvm; > > > + struct file *file; > > > + int fd, err; > > > + > > > + /* arg reserved for future use. */ > > > + if (arg) > > > + return -EINVAL; > > > > Do you have something specific in mind here? If 'create' > > is the only command you support, and it has no arguments, > > it would be easier to do it implicitly during open() and > > have each fd opened from /dev/gunyah represent a new VM. > > > > I'd like the argument here to support different types of virtual machines. I > want to leave open what "different types" can be in case something new comes > up in the future, but immediately "different type" would correspond to a few > different authentication mechanisms for virtual machines that Gunyah > supports. Please don't add code that does not actually do something now, as that makes it impossible to review properly, _AND_ no one knows what is going to happen in the future. In the future, you can just add a new ioctl and all is good, no need to break working userspace by suddenly looking at the arg value and doing something with it. thanks, greg k-h