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 3389FC77B73 for ; Mon, 5 Jun 2023 19:49:53 +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=Fp+0y+soj6cMooNaFo1msNnmaZPXusLwJgNkcSrK6cQ=; b=MGuYNofuUWvcVH kRfGnEPMqY4fmSG/0MPQqBQQIaf1LKZlHhUlpLf8CjpA3kWDTaVvN6idkPyLnjlzcvvbpg+zNg/Qm 0iaq1DdRqppP3zSPYZGJysa0kMtZnS/VNjpDuR9KgZj4QbpKQEj/DDHoT9kICIj0yPHFFieYlZMWf lRVeIVe+ERRqPsfMaQqXXA5Xs6fWLKOtpsPeFV0IXP67lTHP1GRbaMM41u1VohfJ6eUhT0Uf5M3L/ R5LZJqv3cER5DoID7ORYkMo5kbAzhwOSai1qecg06iz4llI6OX5oQVbbeRMHE4x/so0hijCRUl5Y1 Gcedzac2vFzIp5p+j61Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6GCo-00GboR-28; Mon, 05 Jun 2023 19:49:30 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6GCl-00Gbm1-2s for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 19:49:29 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-76c64da0e46so171887039f.0 for ; Mon, 05 Jun 2023 12:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685994566; x=1688586566; 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=wtTjjHT5CTUXdvB6JknWClu6BA6lKhbvtH4FRzorLWI=; b=E1Ev02VgKfzRmJSBLh3zCUukvGn2rZgrMgi7nVOBUaeEBIP2o+AZzGcXhHMBBAgoo5 +55Xu72M/t54WZ7ljWgM7hM0RHygj9YSzHfQbHGnfla4zu2KYoey/LxLzHLWtWSmrHYE u75spKNBPHTDhjHa2Rzq3K/xDvZqPucyepBTzpBVNaeiitvs6uf9RimUQrguY2MLQ15U uDzrId4bZg8rQR6J1lJvsjMW2K1WEKlLHNKHlWahhPoILHZa//XGoHKbB9LQWL/IWu6d ipS0lJDfOsSY30KkJFi/Ya/QUYgT7nAemgqojA6d8pfQAJ7PpOwF4cmPA+IOCERvv/kj RrSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685994566; x=1688586566; 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=wtTjjHT5CTUXdvB6JknWClu6BA6lKhbvtH4FRzorLWI=; b=HYVy4drHagjWjHGY77MBLhFKUTXPfb5vCOHnsDHUqeT0byJOSrAGJctVy6sKvD7Bpm MfXKvnxbUhsuZRsPkAXy118a/bbDNkd7BlvuwiN4CAR8TRWW9Sf03OHZjJuhMrLV3UEi 9s+p9+vwHx6M6K4b4tPSdQsse3aVrYa2vg3+pXZV+9B5BGl5VpF5vfFnSAyrq65Q7hHH pK3k3V8NB+lGNib7+63pJo7Xlui1D/ft6kDmmqMMboGCwAWz2YUsMdkIdBGT7QF/BtjH RYHIYbYuowhYf+MBnzUh0LFz7w8sD2heTbpOY9AbMp3u69gWLlWJD6BdvLTVmY4+TQKp s4mg== X-Gm-Message-State: AC+VfDzo7je2IcdbHM2YQV2Uhe1wM7ec/FQU2isw3hKaakz7NLeXq4D3 /VClAnRETcwi6tqg83/MgsHn8Q== X-Google-Smtp-Source: ACHHUZ5NUH7RpIcCsVW2rT3VDUV+aTHO4WNVhit3iaQrJr9ZeBUlDMt6gd7v6HR0GnISocoH7REDgw== X-Received: by 2002:a6b:7a0c:0:b0:776:f992:78cf with SMTP id h12-20020a6b7a0c000000b00776f99278cfmr128026iom.12.1685994565932; Mon, 05 Jun 2023 12:49:25 -0700 (PDT) Received: from [172.22.22.28] ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id i1-20020a02b681000000b0041ac9dd35f0sm2301285jam.132.2023.06.05.12.49.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 12:49:25 -0700 (PDT) Message-ID: <0e2825da-e247-8656-2c18-f523a291cbcc@linaro.org> Date: Mon, 5 Jun 2023 14:49:24 -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 15/24] docs: gunyah: Document Gunyah VM Manager To: Elliot Berman , Srinivas Kandagatla , Prakruthi Deepak Heragu , Jonathan Corbet 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 , 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-16-quic_eberman@quicinc.com> Content-Language: en-US In-Reply-To: <20230509204801.2824351-16-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_124927_934895_41839D1C X-CRM114-Status: GOOD ( 35.19 ) 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: > Document the ioctls and usage of Gunyah VM Manager driver. > > Signed-off-by: Elliot Berman This patch does not apply, because at this point in the series, "Documentation/virt/gunyah/index.rst" does not exist. I'm going to ignore that. I have some suggestions, but this generally looks good. I'll wait to see v14 with the full "index.rst" before I give my Reviewed-by. -Alex > --- > Documentation/virt/gunyah/index.rst | 1 + > Documentation/virt/gunyah/vm-manager.rst | 82 ++++++++++++++++++++++++ > 2 files changed, 83 insertions(+) > create mode 100644 Documentation/virt/gunyah/vm-manager.rst > > diff --git a/Documentation/virt/gunyah/index.rst b/Documentation/virt/gunyah/index.rst > index 74aa345e0a14..7058249825b1 100644 > --- a/Documentation/virt/gunyah/index.rst > +++ b/Documentation/virt/gunyah/index.rst > @@ -7,6 +7,7 @@ Gunyah Hypervisor > .. toctree:: > :maxdepth: 1 > > + vm-manager > message-queue > > Gunyah is a Type-1 hypervisor which is independent of any OS kernel, and runs in > diff --git a/Documentation/virt/gunyah/vm-manager.rst b/Documentation/virt/gunyah/vm-manager.rst > new file mode 100644 > index 000000000000..50d8ae7fabcd > --- /dev/null > +++ b/Documentation/virt/gunyah/vm-manager.rst > @@ -0,0 +1,82 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +======================= > +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. Does everyone know what "non-proxy-scheduled virtual machines" are? > +Except for some basic information about the location of initial binaries, > +most of the configuration about a Gunyah virtual machine is described in the > +VM's devicetree. The devicetree is generated by userspace. Interacting with the > +virtual machine is still done via the kernel and VM configuration requires some > +of the corresponding functionality to be set up in the kernel. For instance, > +sharing userspace memory with a VM is done via the `GH_VM_SET_USER_MEM_REGION`_ > +ioctl. The VM itself is configured to use the memory region via the > +devicetree. Without looking at the code, I'm a little unsure what that last sentence reallly means. > + > +Sample Userspace VMM > +==================== > + > +A sample userspace VMM is included in samples/gunyah/ along with a minimal > +devicetree that can be used to launch a VM. To build this sample, enable > +CONFIG_SAMPLE_GUNYAH. > + > +IOCTLs and userspace VMM flows > +============================== > + > +The kernel exposes a char device interface at /dev/gunyah. > + > +To create a VM, use the `GH_CREATE_VM`_ ioctl. A successful call will return a > +"Gunyah VM" file descriptor. > + > +/dev/gunyah API Descriptions > +---------------------------- > + > +GH_CREATE_VM > +~~~~~~~~~~~~ > + > +Creates a Gunyah VM. The argument is reserved for future use and must be 0. Maybe mention it returns a file descriptor representing the created VM? > + > +Gunyah VM API Descriptions > +-------------------------- > + > +GH_VM_SET_USER_MEM_REGION > +~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +This ioctl allows the user to create or delete a memory parcel for a guest > +virtual machine. Each memory region is uniquely identified by a label; > +attempting to create two regions with the same label is not allowed. Labels are > +unique per virtual machine. > + > +While VMM is guest-agnostic and allows runtime addition of memory regions, > +Linux guest virtual machines do not support accepting memory regions at runtime. > +Thus, memory regions should be provided before starting the VM and the VM must Thus, for Linux guests, memory regions must be provided... > +be configured to accept these at boot-up. > + > +The guest physical address is used by Linux kernel to check that the requested > +user regions do not overlap and to help find the corresponding memory region > +for calls like `GH_VM_SET_DTB_CONFIG`_. It must be page aligned. > + > +To add a memory region, call `GH_VM_SET_USER_MEM_REGION`_ with fields set as > +described above. > + > +.. kernel-doc:: include/uapi/linux/gunyah.h > + :identifiers: gh_userspace_memory_region gh_mem_flags > + > +GH_VM_SET_DTB_CONFIG > +~~~~~~~~~~~~~~~~~~~~ > + > +This ioctl sets the location of the VM's devicetree blob and is used by Gunyah > +Resource Manager to allocate resources. The guest physical memory should be part s/should/must/ /* ? */ > +of the primary memory parcel provided to the VM prior to GH_VM_START. Is it possible to provide multiple memory parcels? If so, is the "primary" memory parcel the first? > + > +.. kernel-doc:: include/uapi/linux/gunyah.h > + :identifiers: gh_vm_dtb_config > + > +GH_VM_START > +~~~~~~~~~~~ > + > +This ioctl starts the VM. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel