qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC] [PATCH 2/3] arm: Introduce skipinvariant command line


From: mjaggi
Subject: [Qemu-devel] [RFC] [PATCH 2/3] arm: Introduce skipinvariant command line option
Date: Thu, 27 Sep 2018 01:13:52 +0000

From: Manish Jaggi <address@hidden>

This option along with the API kvm_arm_is_invariant will
prevent any invariant registers written to KVM.
This option is handy when doing migration between arm hosts
which use -cpu host option, and are similar in CPU family but
only differ in MIDR value or other invariant registers values.

Signed-off-by: Manish Jaggi <address@hidden>

diff --git a/qemu-options.hx b/qemu-options.hx
index 654ef48..d187f6a 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4414,3 +4414,14 @@ HXCOMM This is the last statement. Insert new options 
before this line!
 STEXI
 @end table
 ETEXI
+
+DEF("skipinvariant", HAS_ARG, QEMU_OPTION_skipinvariant,
+    "-skipinvariant enable[=on|off]\n"
+    "                migrated guest should use invariant register values of 
host\n"
+    "                on|off controls migration between arch64 systems using 
-cpu host but with different MIDR values (default:off)\n",
+    QEMU_ARCH_ARM)
+STEXI
address@hidden -skipinvariant enable[=on|off]
address@hidden -skipinvariant
+controls migration between arch64 systems using -cpu host but with different 
MIDR values.(default:off)
+ETEXI
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index a834f60..8a93b01 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -66,6 +66,7 @@ int kvm_arm_init_cpreg_list(ARMCPU *cpu);
  * Returns: true if r is invariant
  */ 
 bool kvm_arm_is_invariant(struct kvm_one_reg *r);
+extern bool skip_invariant;
 
 /**
  * kvm_arm_reg_syncs_via_cpreg_list
diff --git a/vl.c b/vl.c
index 5ba06ad..f24ca6b 100644
--- a/vl.c
+++ b/vl.c
@@ -144,6 +144,7 @@ const char *mem_path = NULL;
 int mem_prealloc = 0; /* force preallocation of physical target memory */
 bool enable_mlock = false;
 bool enable_cpu_pm = false;
+bool skip_invariant = false;
 int nb_nics;
 NICInfo nd_table[MAX_NICS];
 int autostart;
@@ -420,6 +421,18 @@ static QemuOptsList qemu_msg_opts = {
     },
 };
 
+static QemuOptsList qemu_skipinvariant_opts = {
+    .name = "skipinvariant",
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_skipinvariant_opts.head),
+    .desc = {
+        {
+            .name = "enable",
+            .type = QEMU_OPT_BOOL,
+        },
+        { /* end of list */ }
+    },
+};
+
 static QemuOptsList qemu_name_opts = {
     .name = "name",
     .implied_opt_name = "guest",
@@ -2994,6 +3007,7 @@ int main(int argc, char **argv, char **envp)
     qemu_add_opts(&qemu_icount_opts);
     qemu_add_opts(&qemu_semihosting_config_opts);
     qemu_add_opts(&qemu_fw_cfg_opts);
+    qemu_add_opts(&qemu_skipinvariant_opts);
     module_call_init(MODULE_INIT_OPTS);
 
     runstate_init();
@@ -3948,6 +3962,14 @@ int main(int argc, char **argv, char **envp)
                 }
                 configure_msg(opts);
                 break;
+            case QEMU_OPTION_skipinvariant:
+                opts = 
qemu_opts_parse_noisily(qemu_find_opts("skipinvariant"), optarg,
+                                               false);
+                if (!opts) {
+                    exit(1);
+                }
+                skip_invariant = qemu_opt_get_bool(opts, "skipinvariant", 
true);
+                break;
             case QEMU_OPTION_dump_vmstate:
                 if (vmstate_dump_file) {
                     error_report("only one '-dump-vmstate' "
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]