From patchwork Tue Jan 28 14:09:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Rytarowski X-Patchwork-Id: 11354385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5BE2414B4 for ; Tue, 28 Jan 2020 14:13:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCAE2246A7 for ; Tue, 28 Jan 2020 14:13:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="iiSpAt5K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCAE2246A7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwRcX-0004ZI-EZ for patchwork-qemu-devel@patchwork.kernel.org; Tue, 28 Jan 2020 09:13:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44215) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwRa3-0003B5-4p for qemu-devel@nongnu.org; Tue, 28 Jan 2020 09:11:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwRa1-0005Qh-Rv for qemu-devel@nongnu.org; Tue, 28 Jan 2020 09:11:02 -0500 Received: from mout.gmx.net ([212.227.15.15]:37429) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwRa1-0005Nf-EU for qemu-devel@nongnu.org; Tue, 28 Jan 2020 09:11:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580220651; bh=5T5EeHP93+UFDJyj4hGYbu4E19lxTL0aMpGCbkzXAMw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=iiSpAt5Ksv9d3FKvHXsFaIGOjLI++6gEzk3iQU2Aoqgk2rr1u3zndaaoXu3NeN5k0 QPSyR/i2bQO1EojGP+v+Czo91KNhoA/9iOOo8asbrmyLO/3orIVaon7hMOY4kLhNJz dbHZCiERCrHSMcCffYGxVfFIIIWUH4TPB9z24Y6Q= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([89.71.135.231]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N9Mta-1jbGUI3xfo-015Kbn; Tue, 28 Jan 2020 15:10:51 +0100 From: Kamil Rytarowski To: rth@twiddle.net, ehabkost@redhat.com, philmd@redhat.com, slp@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, max@m00nbsd.net Subject: [PATCH v2 0/4] Implements the NetBSD Virtual Machine Monitor accelerator Date: Tue, 28 Jan 2020 15:09:41 +0100 Message-Id: <20200128140945.929-1-n54@gmx.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107124903.16505-1-n54@gmx.com> References: <20200107124903.16505-1-n54@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:0d9yom2QoLaFN43T/E9x9LQgEEC8AKxlTwCRhpWaxeYQZkWPDjQ GRUsVLxxlUigipA7v+S4lgqAkqbVkJjkkFK0E8O+j6aTkziSrHjbmv0gMMEvpaHyddJDnzJ H4x3mFG/PNiuk649d6u/RPodUcPoJniWbzlFV3Cax9H2UALWqoUtwYLuVzGz26EOC3jCewQ iemx9I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PsSpscSYGkFar1jLYORba188xTfNj6f Aj3qUQVdGLvFCgZPS2tSZdIDV/SR7SyvfVbt4SN8XUY5kAyMHabwc2zvVoPslX67AGe6TQ5nJ ygdWfnDn16Lg62GiE0tUDD1hgSsNtqBUq2v1QpwRiY3zLQTURXbnSTcoQsI4ZglDbF1OQ1O8m oe2ttns/WwNO3uDYoFTLzYZTAHVyMPjI76yyJhvx7e0ZYfgW/13vkjs96snSAopL4hEEY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamil Rytarowski , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Hello QEMU Community! Over the past year the NetBSD team has been working hard on a new user-mode API for our hypervisor that will be released as part of the upcoming NetBSD 9.0. This new API adds user-mode capabilities to create and manage virtual machines, configure memory mappings for guest machines, and create and control execution of virtual processors. With this new API we are now able to bring our hypervisor to the QEMU community! The following patches implement the NetBSD Virtual Machine Monitor accelerator (NVMM) for QEMU on NetBSD 9.0 and newer hosts. When compiling QEMU for x86_64 passing the --enable-nvmm flag will compile the accelerator for use. At runtime using the '-accel nvmm' should see a significant performance improvement over emulation, much like when using 'hax' on NetBSD. The documentation for this new API is visible at https://man.netbsd.org under the libnvmm(3) and nvmm(4) pages. NVMM was designed and implemented by Maxime Villard. Thank you for your feedback. Refrences: https://m00nbsd.net/4e0798b7f2620c965d0dd9d6a7a2f296.html Test plan: 1. Download a NetBSD 9.0 pre-release snapshot: http://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-9/latest/images/NetBSD-9.0_RC1-amd64.iso 2. Install it natively on a not too old x86_64 hardware (Intel or AMD). There is no support for nested virtualization in NVMM. 3. Setup the system. export PKG_PATH=http://www.ki.nu/pkgsrc/packages/current/NetBSD-9.0_RC1/All pkg_add git gmake python37 glib2 bison pkgconf pixman Install mozilla-rootcerts and follow post-install instructions. pkg_add mozilla-rootcerts More information: https://wiki.qemu.org/Hosts/BSD#NetBSD 4. Build qemu mkdir build cd build ../configure --python=python3.7 gmake gmake check 5. Test qemu -accel nvmm ... History: v1 -> v2: - Included the testing plan as requested by Philippe Mathieu-Daude - Formatting nit fix in qemu-options.hx - Document NVMM in the accel section of qemu-options.hx Maxime Villard (4): Add the NVMM vcpu API Add the NetBSD Virtual Machine Monitor accelerator. Introduce the NVMM impl Add the NVMM acceleration enlightenments accel/stubs/Makefile.objs | 1 + accel/stubs/nvmm-stub.c | 43 ++ configure | 36 ++ cpus.c | 58 ++ include/sysemu/hw_accel.h | 14 + include/sysemu/nvmm.h | 35 ++ qemu-options.hx | 16 +- target/i386/Makefile.objs | 1 + target/i386/helper.c | 2 +- target/i386/nvmm-all.c | 1222 +++++++++++++++++++++++++++++++++++++ 10 files changed, 1419 insertions(+), 9 deletions(-) create mode 100644 accel/stubs/nvmm-stub.c create mode 100644 include/sysemu/nvmm.h create mode 100644 target/i386/nvmm-all.c --- 2.24.1