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 X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE44EC433E1 for ; Mon, 18 May 2020 07:50:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CA5F207D3 for ; Mon, 18 May 2020 07:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589788248; bh=lqHej4TeaH/h0N1U2FkK0BZnCpJw7cuBwYsE1+Z+y/U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=uv6ORGRvLWgltvt7/Zr24XAv3JlsEdUH3xBH7//u0hGRZmQGW0dOOzzRi5xcvec6j UdMWHiQD/5v4plmnV5ZewphBGOznaNRm1QxW/ut90DjfDMrvMkAxRs6r/3b68W1rgp K22X+pr+JmmzCICUmelHub9DXHQlNPsBDYkxaIic= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbgERHup (ORCPT ); Mon, 18 May 2020 03:50:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:33342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgERHup (ORCPT ); Mon, 18 May 2020 03:50:45 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5D6C20787; Mon, 18 May 2020 07:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589788245; bh=lqHej4TeaH/h0N1U2FkK0BZnCpJw7cuBwYsE1+Z+y/U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LnqTXJ6Xz9beUnIik6bXpG/2hpaTRmYbocdh91cTI0NjQ6MO3VllE9fT0qW/g6uLS xtGr1V+cqVk3tN/5qbWYSM6UOuOiSZ0xliYoUeLXOGX4VG3eSOVWBveH5ouY1UhxBF 6AgF/Wen5TNtdYHkLq6rn987ul1SmmgIrE4jCP0I= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jaaXr-00DBDP-48; Mon, 18 May 2020 08:50:43 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 18 May 2020 08:50:42 +0100 From: Marc Zyngier To: Anastassios Nanos Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Subject: Re: [PATCH 0/2] Expose KVM API to Linux Kernel In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: ananos@nubificus.co.uk, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, pbonzini@redhat.com, sean.j.christopherson@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 2020-05-18 07:58, Anastassios Nanos wrote: > To spawn KVM-enabled Virtual Machines on Linux systems, one has to use > QEMU, or some other kind of VM monitor in user-space to host the vCPU > threads, I/O threads and various other book-keeping/management > mechanisms. > This is perfectly fine for a large number of reasons and use cases: for > instance, running generic VMs, running general purpose Operating > systems > that need some kind of emulation for legacy boot/hardware etc. > > What if we wanted to execute a small piece of code as a guest instance, > without the involvement of user-space? The KVM functions are already > doing > what they should: VM and vCPU setup is already part of the kernel, the > only > missing piece is memory handling. > > With these series, (a) we expose to the Linux Kernel the bare minimum > KVM > API functions in order to spawn a guest instance without the > intervention > of user-space; and (b) we tweak the memory handling code of KVM-related > functions to account for another kind of guest, spawned in > kernel-space. > > PATCH #1 exposes the needed stub functions, whereas PATCH #2 introduces > the > changes in the KVM memory handling code for x86_64 and aarch64. > > An example of use is provided based on kvmtest.c > [https://lwn.net/Articles/658512/] at > https://github.com/cloudkernels/kvmmtest You don't explain *why* we would want this. What is the overhead of having a userspace if your guest doesn't need any userspace handling? The kvmtest example indeed shows that the KVM userspace API is usable without any form of emulation, hence has almost no cost. Without a clear description of the advantages of your solution, as well as a full featured in-tree use case, I find it pretty hard to support this. Thanks, M. -- Jazz is not dead. It just smells funny...