From nobody Mon Feb 9 20:10:10 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1617221764; cv=none; d=zohomail.com; s=zohoarc; b=UHSo8kZk8LxxtI3rEe+a1rGwOOE+/gJQjuqFJs9BOh7tusJdZjq6ZQRzPC2GFLhUxDEM4KcGPUdbWTjpO1VVUg10tHxyT4RD4rC0RQkBKEBEZcuvnfqvmmUiIJSkr2GfrAqrzyJiBbEN7ueut5asoEi1T76ValvOr+qWJdqmZK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617221764; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AAMmwNkyuN9+qhvgoOUqMkEPACKNEqlqFoGtWoFCCRU=; b=fNz9YjcpTSoUyMO/y/vbcGC3O6novEm2x1exgiEtdAAJou8jYKMzzb0Xy1jHYbJQBYYHfoCuEKsG8wFIpZ4oOFfMVPFUnfXclc67Z6CJinxk//iopmhhAGVta1Q+twpsl0F9dLfBYVvF0uU0sogFmnpERhBW7LcnpXhRXjusJ/k= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617221764912306.2694638164521; Wed, 31 Mar 2021 13:16:04 -0700 (PDT) Received: from localhost ([::1]:52982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRhFy-0000HR-QY for importer@patchew.org; Wed, 31 Mar 2021 16:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRh8m-0006qy-To for qemu-devel@nongnu.org; Wed, 31 Mar 2021 16:08:38 -0400 Received: from 13thmonkey.org ([80.100.255.32]:60957 helo=diablo.13thmonkey.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRh8k-0002xV-7o for qemu-devel@nongnu.org; Wed, 31 Mar 2021 16:08:36 -0400 Received: by diablo.13thmonkey.org (Postfix, from userid 103) id 195FBC139C5; Wed, 31 Mar 2021 22:08:31 +0200 (CEST) From: Reinoud Zandijk To: qemu-devel@nongnu.org Subject: [PATCH v6 3/4] Add NVMM accelerator: acceleration enlightenments Date: Wed, 31 Mar 2021 22:07:59 +0200 Message-Id: <20210331200800.24168-4-reinoud@NetBSD.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210331200800.24168-1-reinoud@NetBSD.org> References: <20210331200800.24168-1-reinoud@NetBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=80.100.255.32; envelope-from=reinoud@diablo.13thmonkey.org; helo=diablo.13thmonkey.org X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Eduardo Habkost , Richard Henderson , Kamil Rytarowski , Reinoud Zandijk , Paolo Bonzini , Ryo ONODERA Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Reinoud Zandijk Signed-off-by: Kamil Rytarowski --- include/sysemu/hw_accel.h | 1 + include/sysemu/nvmm.h | 26 ++++++++++++++++++++++++++ target/i386/helper.c | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 include/sysemu/nvmm.h diff --git a/include/sysemu/hw_accel.h b/include/sysemu/hw_accel.h index 61672f9b32..01b5ebf442 100644 --- a/include/sysemu/hw_accel.h +++ b/include/sysemu/hw_accel.h @@ -16,6 +16,7 @@ #include "sysemu/kvm.h" #include "sysemu/hvf.h" #include "sysemu/whpx.h" +#include "sysemu/nvmm.h" =20 void cpu_synchronize_state(CPUState *cpu); void cpu_synchronize_post_reset(CPUState *cpu); diff --git a/include/sysemu/nvmm.h b/include/sysemu/nvmm.h new file mode 100644 index 0000000000..6d216599b0 --- /dev/null +++ b/include/sysemu/nvmm.h @@ -0,0 +1,26 @@ +/* + * 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 late= r. + * 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" + +#ifdef CONFIG_NVMM + +int nvmm_enabled(void); + +#else /* CONFIG_NVMM */ + +#define nvmm_enabled() (0) + +#endif /* CONFIG_NVMM */ + +#endif /* CONFIG_NVMM */ diff --git a/target/i386/helper.c b/target/i386/helper.c index 618ad1c409..8c180b5b2b 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -495,7 +495,7 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAccess = access) X86CPU *cpu =3D env_archcpu(env); CPUState *cs =3D env_cpu(env); =20 - if (kvm_enabled() || whpx_enabled()) { + if (kvm_enabled() || whpx_enabled() || nvmm_enabled()) { env->tpr_access_type =3D access; =20 cpu_interrupt(cs, CPU_INTERRUPT_TPR); --=20 2.29.2