From patchwork Thu Feb 6 21:32:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kamil Rytarowski X-Patchwork-Id: 11369263 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 F2429921 for ; Thu, 6 Feb 2020 21:42:57 +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 A875721775 for ; Thu, 6 Feb 2020 21:42:57 +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="UGsEVrhH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A875721775 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]:46682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izovI-0008DW-IY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 16:42:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37845) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izomT-0008QX-4D for qemu-devel@nongnu.org; Thu, 06 Feb 2020 16:33:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izomR-0006bV-TA for qemu-devel@nongnu.org; Thu, 06 Feb 2020 16:33:49 -0500 Received: from mout.gmx.net ([212.227.17.20]:48093) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izomR-0006W5-Jf for qemu-devel@nongnu.org; Thu, 06 Feb 2020 16:33:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1581024807; bh=43JXsEqXoI6zRifZU5jbyKDtX8fN//Y4L0FT1Lm+1hc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=UGsEVrhH+zMDyFFNCtm9UDE6S0Pz1BvLAmHOH1d4hoDKmmI7iLuYlYkwC7yCZJz8U E6ZaInwzf7uVr4LRH01RPMiC1uugpfk+uKlEX78hXwUo33NhLY1dc6ldCdqzzxAPh4 2d1THvhoQrz/NfLw3DLpuJvYG9+uDqa3fbQIFVCg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([89.71.135.231]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MpUYu-1jIR4M3NUq-00ptFi; Thu, 06 Feb 2020 22:33:26 +0100 From: Kamil Rytarowski To: rth@twiddle.net, ehabkost@redhat.com, slp@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, philmd@redhat.com, max@m00nbsd.net, jmcneill@invisible.ca Subject: [PATCH v4 1/4] Add the NVMM vcpu API Date: Thu, 6 Feb 2020 22:32:29 +0100 Message-Id: <20200206213232.1918-2-n54@gmx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200206213232.1918-1-n54@gmx.com> References: <20200206115731.13552-1-n54@gmx.com> <20200206213232.1918-1-n54@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:AgzSK0caQx13eSEYxLFtblYd8SM6UX5HBNwDUW7ZkzkG9+tqdJW sbWaUHjvJVcRNnbB508Mp57RClxzeUei89fri4nxA/18TS9A85poms4FFeyl0kluF4u2+2p 6WzWTZ9445hOsmmG/qE7aoGzjOHAgG0dqH8maA0HrgqcLj+0jMKDqRrBl/pyokvNw9cj0Pq 4BoX/k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rOisHixHw0lldNWHFV0tUDANQpDt4wi628Q2 P46E9/wUgBh/7iob0P0DETIqs7liNlvBtt6j0YwERW31W/WxnAuaHaI0RX8Xa27djvs0HRpNo mNYPaeEKaVcfqxpOAu2boFhlb4Oje2qrZPacC0hgnAtuxQncjj47D0Yg8kOyDedqteUNlutfh vXEW5H3wuaBbqv1SdmnNmj4dyALs5q5ILyFmCO1+aAmJjtJjI9jwIPeb0LUNuJ7f4lj0c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 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" From: Maxime Villard Adds support for the NetBSD Virtual Machine Monitor (NVMM) stubs and introduces the nvmm.h sysemu API for managing the vcpu scheduling and management. Signed-off-by: Maxime Villard Signed-off-by: Kamil Rytarowski Reviewed-by: Sergio Lopez Reviewed-by: Philippe Mathieu-Daudé Tested-by: Jared McNeill --- accel/stubs/Makefile.objs | 1 + accel/stubs/nvmm-stub.c | 43 +++++++++++++++++++++++++++++++++++++++ include/sysemu/nvmm.h | 35 +++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 accel/stubs/nvmm-stub.c create mode 100644 include/sysemu/nvmm.h -- 2.25.0 diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs index 3894caf95d..09f2d3e1dd 100644 --- a/accel/stubs/Makefile.objs +++ b/accel/stubs/Makefile.objs @@ -1,5 +1,6 @@ obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o obj-$(call lnot,$(CONFIG_HVF)) += hvf-stub.o obj-$(call lnot,$(CONFIG_WHPX)) += whpx-stub.o +obj-$(call lnot,$(CONFIG_NVMM)) += nvmm-stub.o obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o diff --git a/accel/stubs/nvmm-stub.c b/accel/stubs/nvmm-stub.c new file mode 100644 index 0000000000..c2208b84a3 --- /dev/null +++ b/accel/stubs/nvmm-stub.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2019 Maxime Villard, All rights reserved. + * + * NetBSD Virtual Machine Monitor (NVMM) accelerator stub. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "sysemu/nvmm.h" + +int nvmm_init_vcpu(CPUState *cpu) +{ + return -1; +} + +int nvmm_vcpu_exec(CPUState *cpu) +{ + return -1; +} + +void nvmm_destroy_vcpu(CPUState *cpu) +{ +} + +void nvmm_cpu_synchronize_state(CPUState *cpu) +{ +} + +void nvmm_cpu_synchronize_post_reset(CPUState *cpu) +{ +} + +void nvmm_cpu_synchronize_post_init(CPUState *cpu) +{ +} + +void nvmm_cpu_synchronize_pre_loadvm(CPUState *cpu) +{ +} diff --git a/include/sysemu/nvmm.h b/include/sysemu/nvmm.h new file mode 100644 index 0000000000..10496f3980 --- /dev/null +++ b/include/sysemu/nvmm.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2019 Maxime Villard, All rights reserved. + * + * NetBSD Virtual Machine Monitor (NVMM) accelerator support. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef QEMU_NVMM_H +#define QEMU_NVMM_H + +#include "config-host.h" +#include "qemu-common.h" + +int nvmm_init_vcpu(CPUState *); +int nvmm_vcpu_exec(CPUState *); +void nvmm_destroy_vcpu(CPUState *); + +void nvmm_cpu_synchronize_state(CPUState *); +void nvmm_cpu_synchronize_post_reset(CPUState *); +void nvmm_cpu_synchronize_post_init(CPUState *); +void nvmm_cpu_synchronize_pre_loadvm(CPUState *); + +#ifdef CONFIG_NVMM + +int nvmm_enabled(void); + +#else /* CONFIG_NVMM */ + +#define nvmm_enabled() (0) + +#endif /* CONFIG_NVMM */ + +#endif /* CONFIG_NVMM */