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 47650C433FE for ; Wed, 2 Nov 2022 13:06:28 +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: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Bt+Kz8J+vzj4kLc6QajsimimnX+s9FW7VpIVoUIaRrQ=; b=LOBlFp+aL3WGseZrpy6vZXWmXU pS1arFBqotrLHhNY2V4F+PvXwDSnXMY1gJjRbuWpgpKEMUoloCG3a1/dOOpzVSOxuQRKd6nrD+5JG qF4/ive3mjKQkv7s+6L0xQz0qAjRJ03TAigJC5yaTs5+hjUTY43OKS9GSNUSBRsgCdKKuDHliFw/P oorK2n45tbMug1CUO45Pmz0KOnoot+FmqxNY5V2YfeVBOUdaSHegLnx0FymPn2bpEiwrJmzbOsmYK zNeN1kX0Jx9AGRYt1PFaxtLz1YRWRbk2IaSdBzuqU53x4LOxBuYEOALXUosMv18gAogmP3GSIW3X7 F4Do+cqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDQk-00B9SQ-Hl; Wed, 02 Nov 2022 13:05:18 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDQg-00B9Qm-Nx for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 13:05:16 +0000 Received: by mail-pl1-x636.google.com with SMTP id y4so16529651plb.2 for ; Wed, 02 Nov 2022 06:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Huyh9wUKlgeHcrDnqlzfeeXrkbo7IuxRYJnuX9s8J4U=; b=GmrLDJoVj+xHnDQUa/s1aE0/2/0uPVB41AXo8Yh/AFc3pMPlNQmBwTjJsTbWGxbQ6W tUTpqNJ0SSIva40zLzQNRtJeRaYMPOqL2/b8HWD3NXCq+PrhuPWPClYI0OB+HsG+s6tP G41wlFYnhO+pye0ONy5uDRt2cV/rDFz9X8Ev63vKPAuwS9qHcnAzbtydtr4B295QgFvY DjmROBwhCgmmtSyZF1TwS6tTJWm+/zJ94H1AZiceNE8zDmhGwGz59WErXNsWkMJyPbS/ 2pY3t4FszouIRgcZDqrI0Pjq0bHqr3keHUElPnHulsA0hn+Ax4Ef4Yp8xtNMuMpe2YD2 Ktuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Huyh9wUKlgeHcrDnqlzfeeXrkbo7IuxRYJnuX9s8J4U=; b=XyE1xwA2hg38Px9QVYSZvjMCLJMskbEOPAP8N9Mx+nt2/MAi9t+6QoJFqsKsUwotMo VRNU7H2UlorSTGakUJGsC0ElzkLLkGHa0xlz0hQZwcedR7FFAF8hOZLPICZlibxc8hFx uipVhqFzoHAG7NoM2PBmhe33M7+YKnp035W2p0UcaGLDfQO9S2S7bYHHdope970ehHBB yeEX0JYA3DUmwBxbZd+zLiSlv7UsuIyc53qZKa4dLTjfzub1I9a39X4bdUUyUete/ebt pYLbjHYwZY+mo2ceGnDgJNYvI5GN6NqBoCOIbiDQFdgEwIfcweCAsTQ3xioLWILD7Y6s LsDA== X-Gm-Message-State: ACrzQf0rdc6MCENoMyqczx2ihH1q+eVTcPNjoybAxvTjh5qewa3Tvy1Z eWXO/c6O9stsY/kqx/L3T+E= X-Google-Smtp-Source: AMsMyM5da1P+z5SC6LESKmsXTekNfxELJMlJkCDcJaieLHd+JXNW11xqXAsm+I1Z/8BFyNvd0nvFTw== X-Received: by 2002:a17:903:1d0:b0:187:1305:39d5 with SMTP id e16-20020a17090301d000b00187130539d5mr19385133plh.93.1667394311166; Wed, 02 Nov 2022 06:05:11 -0700 (PDT) Received: from debian.me (subs32-116-206-28-50.three.co.id. [116.206.28.50]) by smtp.gmail.com with ESMTPSA id n4-20020a6546c4000000b0046ec7beb53esm7617767pgr.8.2022.11.02.06.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 06:05:10 -0700 (PDT) Received: by debian.me (Postfix, from userid 1000) id 84D88104209; Wed, 2 Nov 2022 20:05:07 +0700 (WIB) Date: Wed, 2 Nov 2022 20:05:07 +0700 From: Bagas Sanjaya To: Elliot Berman Cc: Bjorn Andersson , Jonathan Corbet , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Andy Gross , Dmitry Baryshkov , Jassi Brar , linux-arm-kernel@lists.infradead.org, Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Will Deacon , Catalin Marinas , Arnd Bergmann , Greg Kroah-Hartman , 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 21/21] docs: gunyah: Document Gunyah VM Manager Message-ID: References: <20221026185846.3983888-1-quic_eberman@quicinc.com> <20221026185846.3983888-22-quic_eberman@quicinc.com> MIME-Version: 1.0 In-Reply-To: <20221026185846.3983888-22-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_060514_809859_176D6D59 X-CRM114-Status: GOOD ( 35.30 ) 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-Type: multipart/mixed; boundary="===============2418110085440057939==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2418110085440057939== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hj7LpSjy5/N/rAip" Content-Disposition: inline --hj7LpSjy5/N/rAip Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 26, 2022 at 11:58:46AM -0700, Elliot Berman wrote: > diff --git a/Documentation/virt/gunyah/vm-manager.rst b/Documentation/vir= t/gunyah/vm-manager.rst > new file mode 100644 > index 000000000000..c232ba05de7e > --- /dev/null > +++ b/Documentation/virt/gunyah/vm-manager.rst > @@ -0,0 +1,94 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Virtual Machine Manager > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The Gunyah Virtual Machine Manager is a Linux driver to support launchin= g virtual machines. > + > +Summary > +=3D=3D=3D=3D=3D=3D=3D > + > +Gunyah VMM presently supports launching non-proxy scheduled Linux-like v= irtual machines. > + > +Sample Userspace VMM > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +A sample userspace VMM is included in samples/gunyah/ along with a sampl= e minimal devicetree > +that can be used to launch a Linux-like virtual machine under Gunyah. To= build this sample, enable > +CONFIG_SAMPLE_GUNYAH. > + > +IOCTLs and userspace VMM flows > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > + > +The kernel exposes a char device interface at /dev/gunyah. > + > +To create a VM, use the GH_CREATE_VM ioctl. A successful call will retur= n 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. > + > +Gunyah VM API Descriptions > +-------------------------- > + > +GH_VM_SET_USER_MEM_REGION > +~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +:: > + > + struct gh_userspace_memory_region { > + __u32 label; > + __u32 flags; > + __u64 guest_phys_addr; > + __u64 memory_size; > + __u64 userspace_addr; > + }; > + > +This ioctl allows the user to create or delete a memory parcel for a gue= st > +virtual machine. Each memory region is uniquely identified by a label; > +attempting to create two memory regions with the same label is not allow= ed. > + > +While VMM is guest-agnostic and allows runtime addition of memory region= s, > +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 > +configured to accept those memory regions at boot-up. > + > +The guest physical address is used by Linux to check the requested user = regions > +do not overlap and to help find a corresponding memory region for calls = like > +GH_VM_SET_DTB_CONFIG. > + > +To delete a memory region, call GH_VM_SET_USER_MEM_REGION with label set= to the > +memory region of interest and memory_size set to 0. > + > +The flags field of gh_userspace_memory_region can set the following bits= =2E All > +other bits must be 0 and are reserved for future use. The ioctl will ret= urn > +-EINVAL if an unsupported bit is detected. > + > + - GH_MEM_ALLOW_READ/GH_MEM_ALLOW_WRITE/GH_MEM_ALLOW_EXEC sets read/wri= te/exec permissions > + for the guest, respectively. > + > + - GH_MEM_LENT means that the memory will be unmapped from the host and= be unaccessible by > + the host while the guest has the region. > + > +GH_VM_SET_DTB_CONFIG > +~~~~~~~~~~~~~~~~~~~~ > + > +:: > + > + struct gh_vm_dtb_config { > + __u64 gpa; > + __u64 size; > + }; > + > +This ioctl sets the location of the VM's devicetree blob and is used by = Gunyah > +Resource Manager to allocate resources. > + > +GH_VM_START > +~~~~~~~~~~~ > + > +This ioctl starts the virtual machine. I think the wording can be better: ---- >8 ---- diff --git a/Documentation/virt/gunyah/vm-manager.rst b/Documentation/virt/= gunyah/vm-manager.rst index c232ba05de7e96..772fd970b91d7e 100644 --- a/Documentation/virt/gunyah/vm-manager.rst +++ b/Documentation/virt/gunyah/vm-manager.rst @@ -4,18 +4,15 @@ Virtual Machine Manager =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -The Gunyah Virtual Machine Manager is a Linux driver to support launching = virtual machines. - -Summary -=3D=3D=3D=3D=3D=3D=3D - -Gunyah VMM presently supports launching non-proxy scheduled Linux-like vir= tual machines. +The Gunyah Virtual Machine Manager is a Linux driver for launching virtual +machines using Gunyah. It presently supports launching non-proxy scheduled +Linux-like virtual machines. =20 Sample Userspace VMM =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -A sample userspace VMM is included in samples/gunyah/ along with a sample = minimal devicetree -that can be used to launch a Linux-like virtual machine under Gunyah. To b= uild this sample, enable +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. =20 IOCTLs and userspace VMM flows @@ -23,7 +20,8 @@ IOCTLs and userspace VMM flows =20 The kernel exposes a char device interface at /dev/gunyah. =20 -To create a VM, use the GH_CREATE_VM ioctl. A successful call will return = a "Gunyah VM" file descriptor. +To create a VM, use the GH_CREATE_VM ioctl. A successful call will return a +"Gunyah VM" file descriptor. =20 /dev/gunyah API Descriptions ---------------------------- @@ -51,29 +49,28 @@ GH_VM_SET_USER_MEM_REGION =20 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 memory regions with the same label is not allowed. +attempting to create two regions with the same label is not allowed. =20 While VMM is guest-agnostic and allows runtime addition of memory regions, Linux guest virtual machines do not support accepting memory regions at ru= ntime. -Thus, memory regions should be provided before starting the VM and the VM -configured to accept those memory regions at boot-up. +Thus, memory regions should be provided before starting the VM and the VM = must +be configured to accept these at boot-up. =20 -The guest physical address is used by Linux to check the requested user re= gions -do not overlap and to help find a corresponding memory region for calls li= ke -GH_VM_SET_DTB_CONFIG. +The guest physical address is used by Linux kernel to check that the reque= sted +user regions do not overlap and to help find the corresponding memory regi= on +for calls like GH_VM_SET_DTB_CONFIG. =20 To delete a memory region, call GH_VM_SET_USER_MEM_REGION with label set t= o the -memory region of interest and memory_size set to 0. +desired region and memory_size set to 0. =20 -The flags field of gh_userspace_memory_region can set the following bits. = All +The flags field of gh_userspace_memory_region accepts the following bits. = All other bits must be 0 and are reserved for future use. The ioctl will return -EINVAL if an unsupported bit is detected. =20 - - GH_MEM_ALLOW_READ/GH_MEM_ALLOW_WRITE/GH_MEM_ALLOW_EXEC sets read/write= /exec permissions - for the guest, respectively. - - - GH_MEM_LENT means that the memory will be unmapped from the host and b= e unaccessible by - the host while the guest has the region. + - GH_MEM_ALLOW_READ/GH_MEM_ALLOW_WRITE/GH_MEM_ALLOW_EXEC sets read/write= /exec + permissions for the guest, respectively. + - GH_MEM_LENT means that the memory will be unmapped from the host and be + unaccessible by the host while the guest has the region. =20 GH_VM_SET_DTB_CONFIG ~~~~~~~~~~~~~~~~~~~~ @@ -91,4 +88,4 @@ Resource Manager to allocate resources. GH_VM_START ~~~~~~~~~~~ =20 -This ioctl starts the virtual machine. +This ioctl starts the VM. Thanks.=20 --=20 An old man doll... just what I always wanted! - Clara --hj7LpSjy5/N/rAip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSSYQ6Cy7oyFNCHrUH2uYlJVVFOowUCY2Jq/gAKCRD2uYlJVVFO owilAP9rOWj2RSc16xKy16v6rBpgFMf9kWpJ6RaRz4vJ/jImiAD9EL+mrL03+yCQ uK+z+aXFFpnKScR58vO7PtNiq6SouAk= =F0L1 -----END PGP SIGNATURE----- --hj7LpSjy5/N/rAip-- --===============2418110085440057939== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2418110085440057939==--