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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D396AC77B73 for ; Mon, 5 Jun 2023 19:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:Subject:From: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R2O/r7m8EZNx6WzHvpvuF9XkfagQ4tVtVJJVq2xZwyA=; b=4ighW62cZ7HulL wa2TPCslBcJfdVI+V0dTmOoMl9zNZkU6nlFUCcCRYRj82t61Y+Fw1ljNEPGE3nGBHB5YsI9evSzOz MCl9aJ/ueloIKzGpg8JK4Z1kHA/BCiUfeqnRzT3HWe3PIYTtz7hradE3Q+QqfT0AUHx0RJJYW4Y1x h3WgtG4ZaW/Yuec1GgPxvudXQuiJnAP55DTIwmiT6F7p+1wpYBmV9Rxoh5AO3lm39dYAW+emP3Gvl 3eqz1VFmb3GdcGK2GWibWHUqgeU8kg3/5S4GXvRjCHvHt4KPJklrQnqEBr+X6KPcF9ebC1o/PvIYY zi+WFxUD7No5Pu22cFQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6GBp-00GbHO-34; Mon, 05 Jun 2023 19:48:29 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6GBn-00GbDq-1W for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 19:48:28 +0000 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-33b4552e55cso16130775ab.0 for ; Mon, 05 Jun 2023 12:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685994505; x=1688586505; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=CCJxTC/QdIHN1GnfEAwbC+2stOJ6s3qwapkXQDES9zI=; b=Mxq3KNrO9t5P4+wTN0n6VQPCCY/GnWdb2TWR0l27hf+7cUAlO2LuSvPpFA8DRJOJ1T yHzUpWgP3e7xt1/ZfRYPqeg6TFAQP1U9mevenT2R3ym8jloXFW3pIoJVWxhUpit+rZxY UzoToZzJPfEj+BvoazukTmUVvrjAF9mBWwLEZ+xAnf7zZ6YhbVKY8dN2VZ47V90WWnHC dCwS63yfHQmJzaEz/0nnqkH40P3bOvJBOXWD1Z3y80gQmv/Gs4ARsPlMSNoqo3T7RErI hdz7FpC8K9bbUQsPuQgpzXSsnQBetssYm7wJwTJ9iUVXb3BhOFlj28/o6Tb2WP5WSc8C FcmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685994505; x=1688586505; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CCJxTC/QdIHN1GnfEAwbC+2stOJ6s3qwapkXQDES9zI=; b=inzERF2TEwJpMQF+Zm26RassYbDRDWVU50n3tW+3XgYz28BXuulcca1+okCkGlxu6e 8e6TJT0gfpqWAwncT3Er9lHi0RRDWZ0moZ9CdihJ/PCiHykWHlyRi2nAgfIJZFEi1miz 7e4iFcoc2PsiUifjIcWeO6LclbJ2PnI3xL8DPZlTW1sBWomSCJukFau2Y2imaRJBcNfg u2b7I42rULneHUKDqV1cnFjNPvSDfkJpQ9BVOVgJDLohAbsjyIeGJe23zZBHKJ+1VRnb wbP660CNkbUc2Vwq8yGRu5TyDiqiMvKotFvxVHwrPC1rAIOHgkeC6zfYTyLTEboe5q+w ddAQ== X-Gm-Message-State: AC+VfDxdkKrf4Q5LB6zaKLWts9VngbfwL1Wt+m8zsZ01oRW/sSh1G9xL h5bnNKkRLcSNFMfnGr2ZVdfByQ== X-Google-Smtp-Source: ACHHUZ7ugAPzi9uVbGY8Gzgw9mdLbeSgf/MgIeHnUdMdP/b+cM+PByU07Pbr7UJGLSjdLBaGcfDUfA== X-Received: by 2002:a05:6e02:588:b0:337:d335:6469 with SMTP id c8-20020a056e02058800b00337d3356469mr380061ils.5.1685994505338; Mon, 05 Jun 2023 12:48:25 -0700 (PDT) Received: from [172.22.22.28] ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id e4-20020a02caa4000000b0041ac54cbc60sm1848087jap.56.2023.06.05.12.48.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 12:48:24 -0700 (PDT) Message-ID: <028b5a7f-7d7d-178d-be74-6c93368e06f5@linaro.org> Date: Mon, 5 Jun 2023 14:48:23 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Alex Elder Subject: Re: [PATCH v13 11/24] gunyah: vm_mgr: Add ioctls to support basic non-proxy VM boot To: Elliot Berman , Srinivas Kandagatla , Prakruthi Deepak Heragu Cc: Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Dmitry Baryshkov , Bjorn Andersson , Konrad Dybcio , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Bagas Sanjaya , Will Deacon , Andy Gross , Catalin Marinas , Jassi Brar , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230509204801.2824351-1-quic_eberman@quicinc.com> <20230509204801.2824351-12-quic_eberman@quicinc.com> Content-Language: en-US In-Reply-To: <20230509204801.2824351-12-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_124827_577986_81CD9EED X-CRM114-Status: GOOD ( 19.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/9/23 3:47 PM, Elliot Berman wrote: > Add remaining ioctls to support non-proxy VM boot: > > - Gunyah Resource Manager uses the VM's devicetree to configure the > virtual machine. The location of the devicetree in the guest's > virtual memory can be declared via the SET_DTB_CONFIG ioctl. > - Trigger start of the virtual machine with VM_START ioctl. > > Co-developed-by: Prakruthi Deepak Heragu > Signed-off-by: Prakruthi Deepak Heragu > Signed-off-by: Elliot Berman I point out a spelling error, but otherwise this looks OK to me. Reviewed-by: Alex Elder > --- > drivers/virt/gunyah/vm_mgr.c | 215 ++++++++++++++++++++++++++++++++ > drivers/virt/gunyah/vm_mgr.h | 11 ++ > drivers/virt/gunyah/vm_mgr_mm.c | 20 +++ > include/uapi/linux/gunyah.h | 15 +++ > 4 files changed, 261 insertions(+) > . . . > +static int gh_vm_ensure_started(struct gh_vm *ghvm) > +{ > + int ret; > + > + ret = down_read_interruptible(&ghvm->status_lock); > + if (ret) > + return ret; > + > + /* Unlikely because VM is typically started */ > + if (unlikely(ghvm->vm_status == GH_RM_VM_STATUS_NO_STATE)) { > + up_read(&ghvm->status_lock); > + ret = gh_vm_start(ghvm); > + if (ret) > + return ret; > + /** gh_vm_start() is guaranteed to bring status out of > + * GH_RM_VM_STATUS_LOAD, thus inifitely recursive call is not s/inifitely/infinitely/ > + * possible > + */ > + return gh_vm_ensure_started(ghvm); > + } > + > + /* Unlikely because VM is typically running */ > + if (unlikely(ghvm->vm_status != GH_RM_VM_STATUS_RUNNING)) > + ret = -ENODEV; > + > + up_read(&ghvm->status_lock); > + return ret; > +} > + > static long gh_vm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) > { > struct gh_vm *ghvm = filp->private_data; . . . _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel