From nobody Mon May 6 22:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495037506463896.5041447264207; Wed, 17 May 2017 09:11:46 -0700 (PDT) Received: from localhost ([::1]:49856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB1Y8-0001Yx-2n for importer@patchew.org; Wed, 17 May 2017 12:11:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB1Uj-00073T-8m for qemu-devel@nongnu.org; Wed, 17 May 2017 12:08:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB1Uh-000074-Qs for qemu-devel@nongnu.org; Wed, 17 May 2017 12:08:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54782) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dB1Uh-00006y-Hv for qemu-devel@nongnu.org; Wed, 17 May 2017 12:08:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DABDC23E6D0 for ; Wed, 17 May 2017 16:08:09 +0000 (UTC) Received: from secure.mitica (ovpn-117-44.ams2.redhat.com [10.36.117.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1230C18393; Wed, 17 May 2017 16:08:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DABDC23E6D0 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DABDC23E6D0 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 17 May 2017 18:08:03 +0200 Message-Id: <20170517160804.22245-2-quintela@redhat.com> In-Reply-To: <20170517160804.22245-1-quintela@redhat.com> References: <20170517160804.22245-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 17 May 2017 16:08:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] exec: Create include for target_page_size() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" That is the only function that we need from exec.c, and having to include the whole sysemu.h for this. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- exec.c | 1 + include/exec/target_page.h | 20 ++++++++++++++++++++ include/sysemu/sysemu.h | 1 - migration/migration.c | 1 + migration/postcopy-ram.c | 1 + migration/savevm.c | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 include/exec/target_page.h diff --git a/exec.c b/exec.c index eac6085..e9a201a 100644 --- a/exec.c +++ b/exec.c @@ -24,6 +24,7 @@ #include "qemu/cutils.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "tcg.h" #include "hw/qdev-core.h" #if !defined(CONFIG_USER_ONLY) diff --git a/include/exec/target_page.h b/include/exec/target_page.h new file mode 100644 index 0000000..0961591 --- /dev/null +++ b/include/exec/target_page.h @@ -0,0 +1,20 @@ + + /* + * QEMU exec target page sizes + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef EXEC_TARGET_PAGE_H +#define EXEC_TARGET_PAGE_H + +size_t qemu_target_page_size(void); + +#endif diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 765358e..ed8fe3b 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -67,7 +67,6 @@ int qemu_reset_requested_get(void); void qemu_system_killed(int signal, pid_t pid); void qemu_system_reset(bool report); void qemu_system_guest_panicked(GuestPanicInformation *info); -size_t qemu_target_page_size(void); =20 void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); diff --git a/migration/migration.c b/migration/migration.c index 75a728a..4429a8c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -37,6 +37,7 @@ #include "qom/cpu.h" #include "exec/memory.h" #include "exec/address-spaces.h" +#include "exec/target_page.h" #include "io/channel-buffer.h" #include "io/channel-tls.h" #include "migration/colo.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 64f09e1..82f719a 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" =20 #include "qemu-common.h" +#include "exec/target_page.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "postcopy-ram.h" diff --git a/migration/savevm.c b/migration/savevm.c index 8565103..8763700 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -43,6 +43,7 @@ #include "qemu/queue.h" #include "sysemu/cpus.h" #include "exec/memory.h" +#include "exec/target_page.h" #include "qmp-commands.h" #include "trace.h" #include "qemu/bitops.h" --=20 2.9.3 From nobody Mon May 6 22:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495037592067772.09604264477; Wed, 17 May 2017 09:13:12 -0700 (PDT) Received: from localhost ([::1]:49864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB1ZU-0002Ys-6A for importer@patchew.org; Wed, 17 May 2017 12:13:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB1Uk-00074p-TD for qemu-devel@nongnu.org; Wed, 17 May 2017 12:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB1Uj-00007r-MK for qemu-devel@nongnu.org; Wed, 17 May 2017 12:08:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49330) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dB1Uj-00007I-Do for qemu-devel@nongnu.org; Wed, 17 May 2017 12:08:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14E0E7F7DE for ; Wed, 17 May 2017 16:08:12 +0000 (UTC) Received: from secure.mitica (ovpn-117-44.ams2.redhat.com [10.36.117.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37E2852FD5; Wed, 17 May 2017 16:08:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 14E0E7F7DE Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 14E0E7F7DE From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 17 May 2017 18:08:04 +0200 Message-Id: <20170517160804.22245-3-quintela@redhat.com> In-Reply-To: <20170517160804.22245-1-quintela@redhat.com> References: <20170517160804.22245-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 17 May 2017 16:08:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] migration: Make savevm.c target independent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It only needed TARGET_PAGE_SIZE/BITS/BITS_MIN values, so just export them from exec.h Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- Makefile.target | 2 +- exec.c | 9 +++++++++ include/exec/target_page.h | 2 ++ migration/Makefile.objs | 2 +- migration/savevm.c | 14 +++++++------- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Makefile.target b/Makefile.target index 465a633..ce8dfe4 100644 --- a/Makefile.target +++ b/Makefile.target @@ -146,7 +146,7 @@ obj-$(CONFIG_KVM) +=3D kvm-all.o obj-y +=3D memory.o cputlb.o obj-y +=3D memory_mapping.o obj-y +=3D dump.o -obj-y +=3D migration/ram.o migration/savevm.o +obj-y +=3D migration/ram.o LIBS :=3D $(libs_softmmu) $(LIBS) =20 # Hardware support diff --git a/exec.c b/exec.c index e9a201a..447ac63 100644 --- a/exec.c +++ b/exec.c @@ -3387,6 +3387,15 @@ size_t qemu_target_page_size(void) return TARGET_PAGE_SIZE; } =20 +int qemu_target_page_bits(void) +{ + return TARGET_PAGE_BITS; +} + +int qemu_target_page_bits_min(void) +{ + return TARGET_PAGE_BITS_MIN; +} #endif =20 /* diff --git a/include/exec/target_page.h b/include/exec/target_page.h index 0961591..e3a19cc 100644 --- a/include/exec/target_page.h +++ b/include/exec/target_page.h @@ -16,5 +16,7 @@ #define EXEC_TARGET_PAGE_H =20 size_t qemu_target_page_size(void); +int qemu_target_page_bits(void); +int qemu_target_page_bits_min(void); =20 #endif diff --git a/migration/Makefile.objs b/migration/Makefile.objs index 3272415..90f8c1f 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -1,5 +1,5 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o -common-obj-y +=3D tls.o channel.o +common-obj-y +=3D tls.o channel.o savevm.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o common-obj-y +=3D vmstate.o vmstate-types.o page_cache.o common-obj-y +=3D qemu-file.o diff --git a/migration/savevm.c b/migration/savevm.c index 8763700..d971e5e 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -27,7 +27,6 @@ */ =20 #include "qemu/osdep.h" -#include "cpu.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/qdev.h" @@ -288,7 +287,7 @@ static void configuration_pre_save(void *opaque) =20 state->len =3D strlen(current_name); state->name =3D current_name; - state->target_page_bits =3D TARGET_PAGE_BITS; + state->target_page_bits =3D qemu_target_page_bits(); } =20 static int configuration_pre_load(void *opaque) @@ -299,7 +298,7 @@ static int configuration_pre_load(void *opaque) * predates the variable-target-page-bits support and is using the * minimum possible value for this CPU. */ - state->target_page_bits =3D TARGET_PAGE_BITS_MIN; + state->target_page_bits =3D qemu_target_page_bits_min(); return 0; } =20 @@ -314,9 +313,9 @@ static int configuration_post_load(void *opaque, int ve= rsion_id) return -EINVAL; } =20 - if (state->target_page_bits !=3D TARGET_PAGE_BITS) { + if (state->target_page_bits !=3D qemu_target_page_bits()) { error_report("Received TARGET_PAGE_BITS is %d but local is %d", - state->target_page_bits, TARGET_PAGE_BITS); + state->target_page_bits, qemu_target_page_bits()); return -EINVAL; } =20 @@ -332,7 +331,8 @@ static int configuration_post_load(void *opaque, int ve= rsion_id) */ static bool vmstate_target_page_bits_needed(void *opaque) { - return TARGET_PAGE_BITS > TARGET_PAGE_BITS_MIN; + return qemu_target_page_bits() + > qemu_target_page_bits_min(); } =20 static const VMStateDescription vmstate_target_page_bits =3D { @@ -1138,7 +1138,7 @@ void qemu_savevm_state_complete_precopy(QEMUFile *f, = bool iterable_only) } =20 vmdesc =3D qjson_new(); - json_prop_int(vmdesc, "page_size", TARGET_PAGE_SIZE); + json_prop_int(vmdesc, "page_size", qemu_target_page_size()); json_start_array(vmdesc, "devices"); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { =20 --=20 2.9.3