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 C0F6DC7EE2A for ; Mon, 5 Jun 2023 19:50:46 +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=1/KewR4c+CSzbx6IuQXtPf9sMqYPfTU3L61xlxiOo9E=; b=WhARGH5JOBZBWR bfDJTrtrL+z038vZ8Cde0xJdyx8E0gaMZcKmmVz5q1Z8LsAET/VRbTpbRoY+2OBPBz/WQoVcUpIBz 2mObZYwAYlGpWooOXOBaJ7tsIJDA9ejetWcYII8oR3fYsJ1z4UoLqKejDaQXINHTUsBDt8q0F03HP i4M6i0U0ON9KwEh+lasaXo90or/gG76bP1KnhgPGhVdfft91UPtUhuvNdzTZTROhauGBBkC3l+W/O KGv+Tp5XFXIdpsSlTN8m/OIQi0FzcVCNHA6qUi9hn0DBEwpMbHtBwij0ede+MgZ5KGfDPxeLql6k9 xun/XbaToQcf0VnNU6xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6GDh-00GcAD-1e; Mon, 05 Jun 2023 19:50:25 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6GDf-00Gc8F-0s for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 19:50:24 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-33d22754450so23361525ab.0 for ; Mon, 05 Jun 2023 12:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685994620; x=1688586620; 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=82nuFTgvyuCdNMh4cUoNyR7h+q8YBDGZLD/ENpdarFg=; b=r4bX/8q+XyFRAkjC/h/ZbQa49tzc2xVhtuvXPHNeiHJewTl0iNVmKG0qujmpJ2GVIG qkGZzWnAsCIccXyC5vQIw+KYeH1s7+4AusZLnXLAHTrcZgpSEhr0GTY++gbKjVS3Kw6A UZx8qAFdxPWnfkDEGvtF9ObWmMeHGCZU/fHv1pI8kqkI0WZL6vrcD75nrLgjkKT+O7Qj hK77F1zVl4dT9qo6G7x4lLP6oLLbUnD5Eblsr9hZX1m5D4N4hbahvX7eVIGH3GHH+YOR X1XRqWYgvLdByhxKPXSMjSnOu8WBo5ph8doQcB05nrOYTHtP3P+KtipdMxYI1bPxL/E9 AcYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685994620; x=1688586620; 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=82nuFTgvyuCdNMh4cUoNyR7h+q8YBDGZLD/ENpdarFg=; b=KJDasG7OddrgdSjALpJIDz8Rdq7q9A+VWWCfw8Dsvz3LVTju1zxB5WjZFmiEpI5qxm yb0yFfFYQSTLJUXyqBniC1Y5KBbx/7UlJeW70VZ80EbfIVZYmL9lz+AmZGQQlWLIz6w2 fnNzxwYMp3QF9mk3yKZOldtgFkonJtg3LZzSVAOOBPVnhTJ36lJysW40HuoR9zJSZxfA GVQSUj8tKc4S0jvRNdYLz5OQoYkKdcmKPMVI3KxRzxonWv3EXUjTyT0LnWX/6UVJluxR 8gq0P/XWUxUGaFy8AxJ+/ZDjcdodGXv6YhSLO6n2PwVWi+RpnNS06THXdRF78FF2FvQD cYzw== X-Gm-Message-State: AC+VfDyyDGnUvO7J+RR4Y7zvHFiwsF1G6SQA4byWUO1DUC5150Cxx3gW zI0hwIGkghBSX6KgNJWGuHOUdg== X-Google-Smtp-Source: ACHHUZ7+ZCb+ovtXIbVzGp6Om4MnYS49lhb5mIsXXqx34BOZuyxfpK4Ybvbum9H0Cv9Lf3Espah3TA== X-Received: by 2002:a92:4a02:0:b0:33b:6cc0:ee6b with SMTP id m2-20020a924a02000000b0033b6cc0ee6bmr55690ilf.13.1685994620037; Mon, 05 Jun 2023 12:50:20 -0700 (PDT) Received: from [172.22.22.28] ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id x12-20020a92060c000000b003350061b57csm2520290ilg.81.2023.06.05.12.50.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 12:50:19 -0700 (PDT) Message-ID: Date: Mon, 5 Jun 2023 14:50:18 -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 20/24] virt: gunyah: Add proxy-scheduled vCPUs To: Elliot Berman , Srinivas Kandagatla , Prakruthi Deepak Heragu , Jonathan Corbet , Catalin Marinas , Will Deacon 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 , Bagas Sanjaya , Andy Gross , 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-21-quic_eberman@quicinc.com> Content-Language: en-US In-Reply-To: <20230509204801.2824351-21-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_125023_310746_AAF6563E X-CRM114-Status: GOOD ( 28.20 ) 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: > Gunyah allows host virtual machines to schedule guest virtual machines > and handle their MMIO accesses. vCPUs are presented to the host as a > Gunyah resource and represented to userspace as a Gunyah VM function. > > Creating the vcpu VM function will create a file descriptor that: > - can run an ioctl: GH_VCPU_RUN to schedule the guest vCPU until the > next interrupt occurs on the host or when the guest vCPU can no > longer be run. > - can be mmap'd to share a gh_vcpu_run structure which can look up the > reason why GH_VCPU_RUN returned and provide return values for MMIO > access. > > Co-developed-by: Prakruthi Deepak Heragu > Signed-off-by: Prakruthi Deepak Heragu > Signed-off-by: Elliot Berman To be honest I have spent less time immersed in the VCPU stuff than I would like. I have looked through this patch today, though, and with the exception of a typo I point out, it looks generally good to me. For now I'm going to give you this; I might take a closer look at a future date when you have updated your code. Acked-by: Alex Elder > --- > Documentation/virt/gunyah/vm-manager.rst | 46 ++- > arch/arm64/gunyah/gunyah_hypercall.c | 28 ++ > drivers/virt/gunyah/Kconfig | 11 + > drivers/virt/gunyah/Makefile | 2 + > drivers/virt/gunyah/gunyah_vcpu.c | 468 +++++++++++++++++++++++ > drivers/virt/gunyah/vm_mgr.c | 4 + > drivers/virt/gunyah/vm_mgr.h | 1 + > include/linux/gunyah.h | 24 ++ > include/uapi/linux/gunyah.h | 128 +++++++ > 9 files changed, 710 insertions(+), 2 deletions(-) > create mode 100644 drivers/virt/gunyah/gunyah_vcpu.c > > diff --git a/Documentation/virt/gunyah/vm-manager.rst b/Documentation/virt/gunyah/vm-manager.rst > index 3b51bab9d793..6789d13fed14 100644 > --- a/Documentation/virt/gunyah/vm-manager.rst > +++ b/Documentation/virt/gunyah/vm-manager.rst > @@ -5,8 +5,7 @@ Virtual Machine Manager > ======================= > > The Gunyah Virtual Machine Manager is a Linux driver to support launching > -virtual machines using Gunyah. It presently supports launching non-proxy > -scheduled Linux-like virtual machines. > +virtual machines using Gunyah. > > Except for some basic information about the location of initial binaries, > most of the configuration about a Gunyah virtual machine is described in the > @@ -98,3 +97,46 @@ GH_VM_START > ~~~~~~~~~~~ > > This ioctl starts the VM. > + > +GH_VM_ADD_FUNCTION > +~~~~~~~~~~~~~~~~~~ > + > +This ioctl registers a Gunyah VM function with the VM manager. The VM function > +is described with a &struct gh_fn_desc.type and some arguments for that type. > +Typically, the function is added before the VM starts, but the function doesn't > +"operate" until the VM starts with `GH_VM_START`_. For example, vCPU ioclts will s/ioclts/ioctls/ > +all return an error until the VM starts because the vCPUs don't exist until the > +VM is started. This allows the VMM to set up all the kernel functions needed for > +the VM *before* the VM starts. > + > +.. kernel-doc:: include/uapi/linux/gunyah.h > + :identifiers: gh_fn_desc gh_fn_type > + . . . _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel