From nobody Thu Nov 13 07:36:15 2025 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=1617812673; cv=none; d=zohomail.com; s=zohoarc; b=VQ+ikMS62j0WsonvRcsR5TcKN8yczxkA18tFjczXE4DXNN6UWKtdFdBAFVW+C3BS3EQAON0qjfHKOGrjw1yfal4/juUT6hJXUcFlzFj5NhFWH97Q3MmqaGFpkc5wT7TqgGX2Du1tGrcjGlahpc348T0ChiYcSdUQEO/UT9KBxak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617812673; 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=Op6lqAIByUEBVxFdthfeXp6xMjgs0p96+CdYemOAbYM=; b=dI9plp9CZdpkBUSQrqeJAlbaWCm+8Y9uu0CmX9+qLiwkukHsCOuj0oNn2utXB3kpC5iO+GzxGXLgEULN9UDK6VDK8lXTyZ2kzHmzhH3kcg84QUZBHWDIu9oR13SAO3K9WeiBgXpfmGIWbcxCFnjcNPNHJiPdM+ReQ8c8iR+0ewM= 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 1617812673558130.2486623750283; Wed, 7 Apr 2021 09:24:33 -0700 (PDT) Received: from localhost ([::1]:37588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUAym-0000jd-E7 for importer@patchew.org; Wed, 07 Apr 2021 12:24:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUArP-0004AQ-HL for qemu-devel@nongnu.org; Wed, 07 Apr 2021 12:16:56 -0400 Received: from 13thmonkey.org ([80.100.255.32]:65423 helo=gorilla.13thmonkey.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUArL-0000oN-M2 for qemu-devel@nongnu.org; Wed, 07 Apr 2021 12:16:54 -0400 Received: by gorilla.13thmonkey.org (Postfix, from userid 103) id A13A82FF0795; Wed, 7 Apr 2021 16:16:45 +0000 (UTC) From: Reinoud Zandijk To: qemu-devel@nongnu.org Subject: [PATCH v8 3/4] Add NVMM accelerator: acceleration enlightenments Date: Wed, 7 Apr 2021 16:16:30 +0000 Message-Id: <20210407161631.1780-4-reinoud@NetBSD.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407161631.1780-1-reinoud@NetBSD.org> References: <20210407161631.1780-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@gorilla.13thmonkey.org; helo=gorilla.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: Kamil Rytarowski Signed-off-by: Reinoud Zandijk --- 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.31.1