From nobody Fri May 10 13:01:29 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162661670376318.73829530378987; Sun, 18 Jul 2021 06:58:23 -0700 (PDT) Received: from localhost ([::1]:49278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m57JG-0001CJ-BM for importer@patchew.org; Sun, 18 Jul 2021 09:58:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m578X-0004D2-MA for qemu-devel@nongnu.org; Sun, 18 Jul 2021 09:47:17 -0400 Received: from 13thmonkey.org ([80.100.255.32]:65364 helo=gorilla.13thmonkey.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m578V-0007fx-IA for qemu-devel@nongnu.org; Sun, 18 Jul 2021 09:47:17 -0400 Received: by gorilla.13thmonkey.org (Postfix, from userid 103) id 6EE012FF0934; Sun, 18 Jul 2021 15:47:11 +0200 (CEST) From: Reinoud Zandijk To: qemu-devel@nongnu.org Subject: [PATCH v1 1/2] Only check CONFIG_NVMM when NEED_CPU_H is defined Date: Sun, 18 Jul 2021 15:46:49 +0200 Message-Id: <20210718134650.1191-2-reinoud@NetBSD.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210718134650.1191-1-reinoud@NetBSD.org> References: <20210718134650.1191-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: Reinoud Zandijk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1626616705485100001 Content-Type: text/plain; charset="utf-8" Userland targers will otherwise use a poisoned CONFIG_NVMM Signed-off-by: Reinoud Zandijk --- include/sysemu/nvmm.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/sysemu/nvmm.h b/include/sysemu/nvmm.h index 6d216599b0..833670fccb 100644 --- a/include/sysemu/nvmm.h +++ b/include/sysemu/nvmm.h @@ -10,8 +10,7 @@ #ifndef QEMU_NVMM_H #define QEMU_NVMM_H =20 -#include "config-host.h" -#include "qemu-common.h" +#ifdef NEED_CPU_H =20 #ifdef CONFIG_NVMM =20 @@ -23,4 +22,6 @@ int nvmm_enabled(void); =20 #endif /* CONFIG_NVMM */ =20 -#endif /* CONFIG_NVMM */ +#endif /* NEED_CPU_H */ + +#endif /* QEMU_NVMM_H */ --=20 2.31.1 From nobody Fri May 10 13:01:29 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162661639285870.93268254861437; Sun, 18 Jul 2021 06:53:12 -0700 (PDT) Received: from localhost ([::1]:45150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m57EF-0006RP-HS for importer@patchew.org; Sun, 18 Jul 2021 09:53:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m578W-0004Ck-Mp for qemu-devel@nongnu.org; Sun, 18 Jul 2021 09:47:16 -0400 Received: from 13thmonkey.org ([80.100.255.32]:65365 helo=gorilla.13thmonkey.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m578V-0007fr-85 for qemu-devel@nongnu.org; Sun, 18 Jul 2021 09:47:16 -0400 Received: by gorilla.13thmonkey.org (Postfix, from userid 103) id 70C6D2FF093B; Sun, 18 Jul 2021 15:47:11 +0200 (CEST) From: Reinoud Zandijk To: qemu-devel@nongnu.org Subject: [PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments Date: Sun, 18 Jul 2021 15:46:50 +0200 Message-Id: <20210718134650.1191-3-reinoud@NetBSD.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210718134650.1191-1-reinoud@NetBSD.org> References: <20210718134650.1191-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: Reinoud Zandijk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1626616394213100003 Content-Type: text/plain; charset="utf-8" A parameter max_size was added to the RAMBlockNotifier ram_block_added function. Use the max_size for pre allocation of hva space. Signed-off-by: Reinoud Zandijk --- target/i386/nvmm/nvmm-all.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index dfa690d65d..fdcd37ed3e 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -1134,13 +1134,14 @@ static MemoryListener nvmm_memory_listener =3D { }; =20 static void -nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size) +nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size, + size_t max_size) { struct nvmm_machine *mach =3D get_nvmm_mach(); uintptr_t hva =3D (uintptr_t)host; int ret; =20 - ret =3D nvmm_hva_map(mach, hva, size); + ret =3D nvmm_hva_map(mach, hva, max_size); =20 if (ret =3D=3D -1) { error_report("NVMM: Failed to map HVA, HostVA:%p " --=20 2.31.1