Skip to contentSkip to conversation

x86 and machine queue, 2016-10-31

GIT PULL Applied Eduardo Habkost 2 participants 4 messages Oct 31, 2016 – Nov 1, 2016

lore
Share & tools
lore
#0 lore raw

The following changes since commit 6bc56d317f7b5004ea2d89d264bddc8b4d081700:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-mttcg' into staging (2016-10-31 15:29:12 +0000)

are available in the git repository at:

git://github.com/ehabkost/qemu.git tags/x86-and-machine-pull-request

for you to fetch changes up to 83a00f6095a36de2024d6cca57470c4dedfb85ee:

target-i386: Print warning when mixing [+-]foo and foo=(on|off) (2016-10-31 16:20:59 -0200)

----------------------------------------------------------------
x86 and machine queue, 2016-10-31

----------------------------------------------------------------

Eduardo Habkost (2):
tests: Remove unneeded "-vnc none" option
target-i386: Print warning when mixing [+-]foo and foo=(on|off)

 target-i386/cpu.c             | 24 ++++++++++++++++++++++++
 tests/ide-test.c              |  1 -
 tests/ipmi-bt-test.c          |  2 +-
 tests/ipmi-kcs-test.c         |  2 +-
 tests/test-x86-cpuid-compat.c | 28 +++++++++++++++++++++++-----
 5 files changed, 49 insertions(+), 8 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

[Qemu-devel] [PULL 1/2] tests: Remove unneeded "-vnc none" option

Some tests use the "-vnc none" option without any clear reason, making those tests break when --disable-vnc is specified on ./configure. Remove the unnecessary option.

---
 tests/ide-test.c      | 1 -
 tests/ipmi-bt-test.c  | 2 +-
 tests/ipmi-kcs-test.c | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
tests/ide-test.c +0 -1
index 67c7df0..fb541f8 100644
@@ -620,7 +620,6 @@ static void test_retry_flush(const char *machine)
     prepare_blkdebug_script(debug_path, "flush_to_disk");
 
     ide_test_start(
-        "-vnc none "
         "-drive file=blkdebug:%s:%s,if=ide,cache=writeback,format=raw,"
         "rerror=stop,werror=stop",
         debug_path, tmp_path);
tests/ipmi-bt-test.c +1 -1
index be9005e..ad1e97e 100644
@@ -415,7 +415,7 @@ int main(int argc, char **argv)
     /* Run the tests */
     g_test_init(&argc, &argv, NULL);
 
-    cmdline = g_strdup_printf("-vnc none"
+    cmdline = g_strdup_printf(
           " -chardev socket,id=ipmi0,host=localhost,port=%d,reconnect=10"
           " -device ipmi-bmc-extern,chardev=ipmi0,id=bmc0"
           " -device isa-ipmi-bt,bmc=bmc0", emu_port);
tests/ipmi-kcs-test.c +1 -1
index 3750389..9cf0b34 100644
@@ -276,7 +276,7 @@ int main(int argc, char **argv)
     /* Run the tests */
     g_test_init(&argc, &argv, NULL);
 
-    cmdline = g_strdup_printf("-vnc none -device ipmi-bmc-sim,id=bmc0"
+    cmdline = g_strdup_printf("-device ipmi-bmc-sim,id=bmc0"
                               " -device isa-ipmi-kcs,bmc=bmc0");
     qtest_start(cmdline);
     qtest_irq_intercept_in(global_qtest, "ioapic");
Signature · 1 line
2.7.4
#2 lore raw

[Qemu-devel] [PULL 2/2] target-i386: Print warning when mixing [+-]foo and foo=(on|off)

In reply to Eduardo Habkost

Print a warning when mixing [+-]foo and foo=(on|off) in the -cpu argument in a way that will break in the future.

---
 target-i386/cpu.c             | 24 ++++++++++++++++++++++++
 tests/test-x86-cpuid-compat.c | 28 +++++++++++++++++++++++-----
 2 files changed, 47 insertions(+), 5 deletions(-)
target-i386/cpu.c +24 -0
index 83998a8..0f8a8fb 100644
@@ -1973,6 +1973,11 @@ static const char *x86_cpu_feature_name(FeatureWord w, int bitnr)
  */
 static GList *plus_features, *minus_features;
 
+static gint compare_string(gconstpointer a, gconstpointer b)
+{
+    return g_strcmp0(a, b);
+}
+
 /* Parse "+feature,-feature,feature=foo" CPU feature string
  */
 static void x86_cpu_parse_featurestr(const char *typename, char *features,
@@ -1981,6 +1986,7 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features,
     char *featurestr; /* Single 'key=value" string being parsed */
     Error *local_err = NULL;
     static bool cpu_globals_initialized;
+    bool ambiguous = false;
 
     if (cpu_globals_initialized) {
         return;
@@ -2022,6 +2028,19 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features,
         feat2prop(featurestr);
         name = featurestr;
 
+        if (g_list_find_custom(plus_features, name, compare_string)) {
+            error_report("warning: Ambiguous CPU model string. "
+                         "Don't mix both \"+%s\" and \"%s=%s\"",
+                         name, name, val);
+            ambiguous = true;
+        }
+        if (g_list_find_custom(minus_features, name, compare_string)) {
+            error_report("warning: Ambiguous CPU model string. "
+                         "Don't mix both \"-%s\" and \"%s=%s\"",
+                         name, name, val);
+            ambiguous = true;
+        }
+
         /* Special case: */
         if (!strcmp(name, "tsc-freq")) {
             int64_t tsc_freq;
@@ -2046,6 +2065,11 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features,
         qdev_prop_register_global(prop);
     }
 
+    if (ambiguous) {
+        error_report("warning: Compatibility of ambiguous CPU model "
+                     "strings won't be kept on future QEMU versions");
+    }
+
     if (local_err) {
         error_propagate(errp, local_err);
     }
tests/test-x86-cpuid-compat.c +23 -5
index 260dd27..79a2e69 100644
@@ -35,6 +35,7 @@ static QObject *qom_get(const char *path, const char *prop)
     return ret;
 }
 
+#ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS
 static bool qom_get_bool(const char *path, const char *prop)
 {
     QBool *value = qobject_to_qbool(qom_get(path, prop));
@@ -43,6 +44,7 @@ static bool qom_get_bool(const char *path, const char *prop)
     QDECREF(value);
     return b;
 }
+#endif
 
 typedef struct CpuidTestArgs {
     const char *cmdline;
@@ -76,7 +78,8 @@ static void add_cpuid_test(const char *name, const char *cmdline,
     qtest_add_data_func(name, args, test_cpuid_prop);
 }
 
-static void test_plus_minus(void)
+#ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS
+static void test_plus_minus_subprocess(void)
 {
     char *path;
 
@@ -86,9 +89,8 @@ static void test_plus_minus(void)
      * 3) Old feature names with underscores (e.g. "sse4_2")
      *    should keep working
      *
-     * Note: rules 1 and 2 are planned to be removed soon, but we
-     * need to keep compatibility for a while until we start
-     * warning users about it.
+     * Note: rules 1 and 2 are planned to be removed soon, and
+     * should generate a warning.
      */
     qtest_start("-cpu pentium,-fpu,+fpu,-mce,mce=on,+cx8,cx8=off,+sse4_1,sse4_2=on");
     path = get_cpu0_qom_path();
@@ -108,11 +110,27 @@ static void test_plus_minus(void)
     g_free(path);
 }
 
+static void test_plus_minus(void)
+{
+    g_test_trap_subprocess("/x86/cpuid/parsing-plus-minus/subprocess", 0, 0);
+    g_test_trap_assert_passed();
+    g_test_trap_assert_stderr("*Ambiguous CPU model string. "
+                              "Don't mix both \"-mce\" and \"mce=on\"*");
+    g_test_trap_assert_stderr("*Ambiguous CPU model string. "
+                              "Don't mix both \"+cx8\" and \"cx8=off\"*");
+    g_test_trap_assert_stdout("");
+}
+#endif
+
 int main(int argc, char **argv)
 {
     g_test_init(&argc, &argv, NULL);
 
-    qtest_add_func("x86/cpuid/parsing-plus-minus", test_plus_minus);
+#ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS
+    g_test_add_func("/x86/cpuid/parsing-plus-minus/subprocess",
+                    test_plus_minus_subprocess);
+    g_test_add_func("/x86/cpuid/parsing-plus-minus", test_plus_minus);
+#endif
 
     /* Original level values for CPU models: */
     add_cpuid_test("x86/cpuid/phenom/level",
Signature · 1 line
2.7.4
#3 lore raw
In reply to Eduardo Habkost
Quoted 12 lines · Eduardo Habkost

The following changes since commit 6bc56d317f7b5004ea2d89d264bddc8b4d081700:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-mttcg' into staging (2016-10-31 15:29:12 +0000)

are available in the git repository at:

git://github.com/ehabkost/qemu.git tags/x86-and-machine-pull-request

for you to fetch changes up to 83a00f6095a36de2024d6cca57470c4dedfb85ee:

target-i386: Print warning when mixing [+-]foo and foo=(on|off) (2016-10-31 16:20:59 -0200)

Quoted 8 lines

----------------------------------------------------------------
x86 and machine queue, 2016-10-31

----------------------------------------------------------------

Eduardo Habkost (2):
tests: Remove unneeded "-vnc none" option
target-i386: Print warning when mixing [+-]foo and foo=(on|off)

Applied, thanks.

-- PMM