Skip to contentSkip to conversation

x86 and machine queue, 2017-10-05

GIT PULL Eduardo Habkost 5 participants 26 messages Oct 5, 2017 – Nov 29, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

The following changes since commit d8f932cc696250cb740240d668b39df5fbb2d5a0:

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2017-10-05 16:54:29 +0100)

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 7d7e9c4fd6873d9624956cbe0a5cbfae59b7f8af:

x86: Correct translation of some rdgsbase and wrgsbase encodings (2017-10-05 17:30:06 -0300)

----------------------------------------------------------------
x86 and machine queue, 2017-10-05

Includes x86, NUMA, ACPI, QOM, CPU, and option/config parsing patches.

Highlights:
* Deprecation of -nodefconfig option;
* MachineClass::valid_cpu_types field.

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

Alistair Francis (1):
machine: Add a valid_cpu_types property

Dou Liyang (2):
hw/acpi-build: Make assignment statement of next_base easy to read ACPI/unit-test: Add a new testcase for RAM allocation in numa node

Eduardo Habkost (3):
vl: Eliminate defconfig variable
qemu-options: Deprecate -nodefconfig
config: qemu_config_parse() return number of config groups

Igor Mammedov (1):
qom: update doc comment for type_register[_static]()

Philippe Mathieu-Daudé (1):
qom/cpu: move cpu_model null check to cpu_class_by_name()

Todd Eisenberger (1):
x86: Correct translation of some rdgsbase and wrgsbase encodings

 include/hw/boards.h                   |   1 +
 include/qom/object.h                  |   4 ++--
 block/blkdebug.c                      |   1 -
 hw/core/machine.c                     |  32 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c                  |   2 +-
 qom/cpu.c                             |   7 ++++++-
 target/alpha/cpu.c                    |   6 +-----
 target/arm/cpu.c                      |   4 ----
 target/cris/cpu.c                     |   4 ----
 target/i386/translate.c               |   4 ++--
 target/lm32/cpu.c                     |   4 ----
 target/m68k/cpu.c                     |   4 ----
 target/mips/cpu.c                     |   4 ----
 target/moxie/cpu.c                    |   8 +-------
 target/openrisc/cpu.c                 |   4 ----
 target/sh4/cpu.c                      |   3 ---
 target/sparc/cpu.c                    |   4 ----
 target/tricore/cpu.c                  |   4 ----
 target/unicore32/cpu.c                |   4 ----
 target/xtensa/cpu.c                   |   4 ----
 tests/bios-tables-test.c              |  24 ++++++++++++++++++++++++
 util/qemu-config.c                    |  15 +++++++--------
 vl.c                                  |   5 +----
 qemu-doc.texi                         |   4 ++++
 qemu-options.hx                       |  17 ++++-------------
 tests/acpi-test-data/pc/DSDT.numamem  | Bin 0 -> 5104 bytes
 tests/acpi-test-data/pc/SRAT.numamem  | Bin 0 -> 224 bytes
 tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 7788 bytes
 tests/acpi-test-data/q35/SRAT.numamem | Bin 0 -> 224 bytes
 29 files changed, 86 insertions(+), 87 deletions(-)
 create mode 100644 tests/acpi-test-data/pc/DSDT.numamem
 create mode 100644 tests/acpi-test-data/pc/SRAT.numamem
 create mode 100644 tests/acpi-test-data/q35/DSDT.numamem
 create mode 100644 tests/acpi-test-data/q35/SRAT.numamem
Signature · 1 line
2.13.6
#1 lore raw

[Qemu-devel] [PULL 1/9] hw/acpi-build: Make assignment statement of next_base easy to read

From: Dou Liyang <[email protected]>

It may be hard to read the assignment statement of "next_base", so

S/next_base += (1ULL << 32) - pcms->below_4g_mem_size;
/next_base = mem_base + mem_len;

... for readability.

No functionality change.

Message-Id: <[email protected]>

---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 2af37a9129..73e3443bce 100644
@@ -2381,7 +2381,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
             }
             mem_base = 1ULL << 32;
             mem_len = next_base - pcms->below_4g_mem_size;
-            next_base += (1ULL << 32) - pcms->below_4g_mem_size;
+            next_base = mem_base + mem_len;
         }
         numamem = acpi_data_push(table_data, sizeof *numamem);
         build_srat_memory(numamem, mem_base, mem_len, i - 1,
Signature · 1 line
2.13.6
#2 lore raw

Re: [Qemu-devel] [PULL 1/9] hw/acpi-build: Make assignment statement of next_base easy to read

Quoted 7 lines · On Thu, 5 Oct 2017 17:36:30 -0300 Eduardo Habkost <[email protected]> wrote:

From: Dou Liyang <[email protected]>

It may be hard to read the assignment statement of "next_base", so

S/next_base += (1ULL << 32) - pcms->below_4g_mem_size;
/next_base = mem_base + mem_len;

Quoted 7 lines

... for readability.

No functionality change.

Message-Id: <[email protected]>

Pls, retest/respin once 2.12 dev window is open

Quoted 17 lines
---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 2af37a9129..73e3443bce 100644
@@ -2381,7 +2381,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
             }
             mem_base = 1ULL << 32;
             mem_len = next_base - pcms->below_4g_mem_size;
-            next_base += (1ULL << 32) - pcms->below_4g_mem_size;
+            next_base = mem_base + mem_len;
         }
         numamem = acpi_data_push(table_data, sizeof *numamem);
         build_srat_memory(numamem, mem_base, mem_len, i - 1,
#3 lore raw

Re: [Qemu-devel] [PULL 1/9] hw/acpi-build: Make assignment statement of next_base easy to read

Hi, Igor,

Quoted 10 lines · Igor Mammedov
Quoted 7 lines · On Thu, 5 Oct 2017 17:36:30 -0300 Eduardo Habkost <[email protected]> wrote:

From: Dou Liyang <[email protected]>

It may be hard to read the assignment statement of "next_base", so

S/next_base += (1ULL << 32) - pcms->below_4g_mem_size;
/next_base = mem_base + mem_len;

Quoted 9 lines
Quoted 7 lines

... for readability.

No functionality change.

Message-Id: <[email protected]>

Pls, retest/respin once 2.12 dev window is open

Yes, I will.

Thanks,
dou.

Quoted 21 lines
Quoted 17 lines
---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 2af37a9129..73e3443bce 100644
@@ -2381,7 +2381,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
             }
             mem_base = 1ULL << 32;
             mem_len = next_base - pcms->below_4g_mem_size;
-            next_base += (1ULL << 32) - pcms->below_4g_mem_size;
+            next_base = mem_base + mem_len;
         }
         numamem = acpi_data_push(table_data, sizeof *numamem);
         build_srat_memory(numamem, mem_base, mem_len, i - 1,
#4 lore raw

[Qemu-devel] [PULL 2/9] ACPI/unit-test: Add a new testcase for RAM allocation in numa node

In reply to Eduardo Habkost

From: Dou Liyang <[email protected]>

As QEMU supports the memory-less node, it is possible that there is no RAM in the first numa node(also be called as node0). eg:
... \
-m 128,slots=3,maxmem=1G \
-numa node -numa node,mem=128M \

But, this makes it hard for QEMU to build a known-to-work ACPI SRAT table. Only fixing it is not enough.

Add a testcase for this situation to make sure the ACPI table is correct for guest.

Message-Id: <[email protected]>

---
 tests/bios-tables-test.c              |  24 ++++++++++++++++++++++++
 tests/acpi-test-data/pc/DSDT.numamem  | Bin 0 -> 5104 bytes
 tests/acpi-test-data/pc/SRAT.numamem  | Bin 0 -> 224 bytes
 tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 7788 bytes
 tests/acpi-test-data/q35/SRAT.numamem | Bin 0 -> 224 bytes
 5 files changed, 24 insertions(+)
 create mode 100644 tests/acpi-test-data/pc/DSDT.numamem
 create mode 100644 tests/acpi-test-data/pc/SRAT.numamem
 create mode 100644 tests/acpi-test-data/q35/DSDT.numamem
 create mode 100644 tests/acpi-test-data/q35/SRAT.numamem
tests/bios-tables-test.c +24 -0
index 564da45f65..f0923152ff 100644
@@ -808,6 +808,28 @@ static void test_acpi_piix4_tcg_memhp(void)
     free_test_data(&data);
 }
 
+static void test_acpi_q35_tcg_numamem(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_Q35;
+    data.variant = ".numamem";
+    test_acpi_one(" -numa node -numa node,mem=128", &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_piix4_tcg_numamem(void)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = MACHINE_PC;
+    data.variant = ".numamem";
+    test_acpi_one(" -numa node -numa node,mem=128", &data);
+    free_test_data(&data);
+}
+
 int main(int argc, char *argv[])
 {
     const char *arch = qtest_get_arch();
@@ -830,6 +852,8 @@ int main(int argc, char *argv[])
         qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp);
         qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp);
         qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
+        qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
+        qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
tests/acpi-test-data/pc/DSDT.numamem new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..bc703d77ee48720af1b801c518b43511c95c852d
GIT binary patch
tests/acpi-test-data/pc/SRAT.numamem new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..dbc595d9cb85d3fcb5a4243153f42bb431c9de8f
GIT binary patch
tests/acpi-test-data/q35/DSDT.numamem new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..fcb18d947b28c09c8b5a4fa65692efb41ef3a5d9
GIT binary patch
tests/acpi-test-data/q35/SRAT.numamem new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..dbc595d9cb85d3fcb5a4243153f42bb431c9de8f
GIT binary patch
Signature · 1 line
2.13.6
#5 lore raw

Re: [Qemu-devel] [PULL 2/9] ACPI/unit-test: Add a new testcase for RAM allocation in numa node

Quoted 11 lines · On Thu, 5 Oct 2017 17:36:31 -0300 Eduardo Habkost <[email protected]> wrote:

From: Dou Liyang <[email protected]>

As QEMU supports the memory-less node, it is possible that there is no RAM in the first numa node(also be called as node0). eg:
... \
-m 128,slots=3,maxmem=1G \
-numa node -numa node,mem=128M \

But, this makes it hard for QEMU to build a known-to-work ACPI SRAT table. Only fixing it is not enough.

Quoted 7 lines

Add a testcase for this situation to make sure the ACPI table is correct for guest.

Message-Id: <[email protected]>

Pls retest/respin once dev window is open.

#6 lore raw

Re: [Qemu-devel] [PULL 2/9] ACPI/unit-test: Add a new testcase for RAM allocation in numa node

Hi Igor,

Quoted 17 lines · Igor Mammedov
Quoted 14 lines · On Thu, 5 Oct 2017 17:36:31 -0300 Eduardo Habkost <[email protected]> wrote:

From: Dou Liyang <[email protected]>

As QEMU supports the memory-less node, it is possible that there is no RAM in the first numa node(also be called as node0). eg:
... \
-m 128,slots=3,maxmem=1G \
-numa node -numa node,mem=128M \

But, this makes it hard for QEMU to build a known-to-work ACPI SRAT table. Only fixing it is not enough.

Add a testcase for this situation to make sure the ACPI table is correct for guest.

Quoted 7 lines
Quoted 4 lines

Message-Id: <[email protected]>

Pls retest/respin once dev window is open.

Yes, Thanks so much for your reminder. I will do that.

Thanks,
dou.

Quoted 3 lines
#7 lore raw

[Qemu-devel] [PULL 3/9] qom/cpu: move cpu_model null check to cpu_class_by_name()

In reply to Eduardo Habkost

From: Philippe Mathieu-Daudé <[email protected]>

and clean every implementation.

Message-Id: <[email protected]>

---
 qom/cpu.c              | 7 ++++++-
 target/alpha/cpu.c     | 6 +-----
 target/arm/cpu.c       | 4 ----
 target/cris/cpu.c      | 4 ----
 target/lm32/cpu.c      | 4 ----
 target/m68k/cpu.c      | 4 ----
 target/mips/cpu.c      | 4 ----
 target/moxie/cpu.c     | 8 +-------
 target/openrisc/cpu.c  | 4 ----
 target/sh4/cpu.c       | 3 ---
 target/sparc/cpu.c     | 4 ----
 target/tricore/cpu.c   | 4 ----
 target/unicore32/cpu.c | 4 ----
 target/xtensa/cpu.c    | 4 ----
 14 files changed, 8 insertions(+), 56 deletions(-)
qom/cpu.c +6 -1
index 94fa8fe005..54c9452b1c 100644
@@ -316,7 +316,12 @@ static bool cpu_common_has_work(CPUState *cs)
 
 ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model)
 {
-    CPUClass *cc = CPU_CLASS(object_class_by_name(typename));
+    CPUClass *cc;
+
+    if (!cpu_model) {
+        return NULL;
+    }
+    cc = CPU_CLASS(object_class_by_name(typename));
 
     return cc->class_by_name(cpu_model);
 }
target/alpha/cpu.c +1 -5
index e6c6aabdf0..b8a21f4e01 100644
@@ -127,14 +127,10 @@ static const AlphaCPUAlias alpha_cpu_aliases[] = {
 
 static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
 {
-    ObjectClass *oc = NULL;
+    ObjectClass *oc;
     char *typename;
     int i;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     oc = object_class_by_name(cpu_model);
     if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL &&
         !object_class_is_abstract(oc)) {
target/arm/cpu.c +0 -4
index 4300de66e2..4b81d07b9d 100644
@@ -913,10 +913,6 @@ static ObjectClass *arm_cpu_class_by_name(const char *cpu_model)
     char *typename;
     char **cpuname;
 
-    if (!cpu_model) {
-        return NULL;
-    }
-
     cpuname = g_strsplit(cpu_model, ",", 1);
     typename = g_strdup_printf(ARM_CPU_TYPE_NAME("%s"), cpuname[0]);
     oc = object_class_by_name(typename);
target/cris/cpu.c +0 -4
index ceebfed79b..88d93f2d11 100644
@@ -69,10 +69,6 @@ static ObjectClass *cris_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
 #if defined(CONFIG_USER_ONLY)
     if (strcasecmp(cpu_model, "any") == 0) {
         return object_class_by_name("crisv32-" TYPE_CRIS_CPU);
target/lm32/cpu.c +0 -4
index 2b8c36b6d0..bf081f56d2 100644
@@ -246,10 +246,6 @@ static ObjectClass *lm32_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = g_strdup_printf("%s-" TYPE_LM32_CPU, cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/m68k/cpu.c +0 -4
index 55bf24bae6..8c70e0805c 100644
@@ -87,10 +87,6 @@ static ObjectClass *m68k_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = g_strdup_printf("%s-" TYPE_M68K_CPU, cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/mips/cpu.c +0 -4
index 1a9a3ed94d..c15b894362 100644
@@ -166,10 +166,6 @@ static ObjectClass *mips_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = mips_cpu_type_name(cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/moxie/cpu.c +1 -7
index 748d02f29e..30bd44fcad 100644
@@ -89,13 +89,7 @@ static void moxie_cpu_initfn(Object *obj)
 
 static ObjectClass *moxie_cpu_class_by_name(const char *cpu_model)
 {
-    ObjectClass *oc;
-
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
-    oc = object_class_by_name(cpu_model);
+    ObjectClass *oc = object_class_by_name(cpu_model);
     if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_MOXIE_CPU) ||
                        object_class_is_abstract(oc))) {
         return NULL;
target/openrisc/cpu.c +0 -4
index a979f0bf8b..af9cdcc102 100644
@@ -108,10 +108,6 @@ static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/sh4/cpu.c +0 -3
index 6ce7cba5a9..252440e019 100644
@@ -133,9 +133,6 @@ static ObjectClass *superh_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     GSList *list, *item;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
     if (strcasecmp(cpu_model, "any") == 0) {
         return object_class_by_name(TYPE_SH7750R_CPU);
     }
target/sparc/cpu.c +0 -4
index 0806d699e6..beab90f3e6 100644
@@ -730,10 +730,6 @@ static ObjectClass *sparc_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = sparc_cpu_type_name(cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/tricore/cpu.c +0 -4
index 5ab5b56454..871eb35453 100644
@@ -120,10 +120,6 @@ static ObjectClass *tricore_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (!cpu_model) {
-        return NULL;
-    }
-
     typename = g_strdup_printf("%s-" TYPE_TRICORE_CPU, cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/unicore32/cpu.c +0 -4
index c9b78ce68e..138acc9dd8 100644
@@ -44,10 +44,6 @@ static ObjectClass *uc32_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = g_strdup_printf("%s-" TYPE_UNICORE32_CPU, cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
target/xtensa/cpu.c +0 -4
index 85897df0a8..dcdc765a86 100644
@@ -83,10 +83,6 @@ static ObjectClass *xtensa_cpu_class_by_name(const char *cpu_model)
     ObjectClass *oc;
     char *typename;
 
-    if (cpu_model == NULL) {
-        return NULL;
-    }
-
     typename = g_strdup_printf("%s-" TYPE_XTENSA_CPU, cpu_model);
     oc = object_class_by_name(typename);
     g_free(typename);
Signature · 1 line
2.13.6
#8 lore raw

[Qemu-devel] [PULL 4/9] machine: Add a valid_cpu_types property

In reply to Eduardo Habkost

From: Alistair Francis <[email protected]>

This patch add a MachineClass element that can be set in the machine C code to specify a list of supported CPU types. If the supported CPU types are specified the user enter CPU (by -cpu at runtime) is checked against the supported types and QEMU exits if they aren't supported.

Message-Id: <b8474e9d2e0a219d9bac901342f983b13d009301.1507059418.git.alistair.francis@xilinx.com>

[ehabkost: removed assert(), rewrote comment]
---
 include/hw/boards.h |  1 +
 hw/core/machine.c   | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
include/hw/boards.h +1 -0
index 156e0a5701..191a5b3cd8 100644
@@ -191,6 +191,7 @@ struct MachineClass {
     bool has_hotpluggable_cpus;
     bool ignore_memory_transaction_failures;
     int numa_mem_align_shift;
+    const char **valid_cpu_types;
     void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
                                  int nb_nodes, ram_addr_t size);
 
hw/core/machine.c +32 -0
index 80647edc2a..36c2fb069c 100644
@@ -758,6 +758,38 @@ void machine_run_board_init(MachineState *machine)
     if (nb_numa_nodes) {
         machine_numa_finish_init(machine);
     }
+
+    /* If the machine supports the valid_cpu_types check and the user
+     * specified a CPU with -cpu check here that the user CPU is supported.
+     */
+    if (machine_class->valid_cpu_types && machine->cpu_type) {
+        ObjectClass *class = object_class_by_name(machine->cpu_type);
+        int i;
+
+        for (i = 0; machine_class->valid_cpu_types[i]; i++) {
+            if (object_class_dynamic_cast(class,
+                                          machine_class->valid_cpu_types[i])) {
+                /* The user specificed CPU is in the valid field, we are
+                 * good to go.
+                 */
+                break;
+            }
+        }
+
+        if (!machine_class->valid_cpu_types[i]) {
+            /* The user specified CPU is not valid */
+            error_report("Invalid CPU type: %s", machine->cpu_type);
+            error_printf("The valid types are: %s",
+                         machine_class->valid_cpu_types[0]);
+            for (i = 1; machine_class->valid_cpu_types[i]; i++) {
+                error_printf(", %s", machine_class->valid_cpu_types[i]);
+            }
+            error_printf("\n");
+
+            exit(1);
+        }
+    }
+
     machine_class->init(machine);
 }
 
Signature · 1 line
2.13.6
#9 lore raw

[Qemu-devel] [PULL 5/9] vl: Eliminate defconfig variable

In reply to Eduardo Habkost

Both -nodefconfig and -no-user-config options do the same thing today, we only need one variable to keep track of them.

Message-Id: <[email protected]>

---
 vl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
vl.c +1 -4
index 3fed457921..ebea42e0ea 100644
@@ -3111,7 +3111,6 @@ int main(int argc, char **argv, char **envp)
     const char *qtest_log = NULL;
     const char *pid_file = NULL;
     const char *incoming = NULL;
-    bool defconfig = true;
     bool userconfig = true;
     bool nographic = false;
     DisplayType display_type = DT_DEFAULT;
@@ -3213,8 +3212,6 @@ int main(int argc, char **argv, char **envp)
             popt = lookup_opt(argc, argv, &optarg, &optind);
             switch (popt->index) {
             case QEMU_OPTION_nodefconfig:
-                defconfig = false;
-                break;
             case QEMU_OPTION_nouserconfig:
                 userconfig = false;
                 break;
@@ -3222,7 +3219,7 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-    if (defconfig && userconfig) {
+    if (userconfig) {
         if (qemu_read_default_config_file() < 0) {
             exit(1);
         }
Signature · 1 line
2.13.6
#10 lore raw

[Qemu-devel] [PULL 6/9] qemu-options: Deprecate -nodefconfig

In reply to Eduardo Habkost

Since 2012 (commit ba6212d8 "Eliminate cpus-x86_64.conf file") we have no default config files that would be disabled using -nodefconfig. Update documentation and document -nodefconfig as deprecated.

Message-Id: <[email protected]>

---
 qemu-doc.texi   |  4 ++++
 qemu-options.hx | 17 ++++-------------
 2 files changed, 8 insertions(+), 13 deletions(-)
qemu-doc.texi +4 -0
index ecd186a159..d8bb2c664f 100644
@@ -2496,6 +2496,10 @@ would automatically enable USB support on the machine type.
 If using the new syntax, USB support must be explicitly
 enabled via the ``-machine usb=on'' argument.
 
+@subsection -nodefconfig (since 2.11.0)
+
+The ``-nodefconfig`` argument is a synonym for ``-no-user-config``.
+
 @section qemu-img command line arguments
 
 @subsection convert -s (since 2.0.0)
qemu-options.hx +4 -13
index 39225ae6c3..981742d191 100644
@@ -4067,26 +4067,17 @@ Write device configuration to @var{file}. The @var{file} can be either filename
 command line and device configuration into file or dash @code{-}) character to print the
 output to stdout. This can be later used as input file for @code{-readconfig} option.
 ETEXI
-DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
-    "-nodefconfig\n"
-    "                do not load default config files at startup\n",
-    QEMU_ARCH_ALL)
-STEXI
-@item -nodefconfig
-@findex -nodefconfig
-Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
-The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
-ETEXI
+HXCOMM Deprecated, same as -no-user-config
+DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, "", QEMU_ARCH_ALL)
 DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
     "-no-user-config\n"
-    "                do not load user-provided config files at startup\n",
+    "                do not load default user-provided config files at startup\n",
     QEMU_ARCH_ALL)
 STEXI
 @item -no-user-config
 @findex -no-user-config
 The @code{-no-user-config} option makes QEMU not load any of the user-provided
-config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
-files from @var{datadir}.
+config files on @var{sysconfdir}.
 ETEXI
 DEF("trace", HAS_ARG, QEMU_OPTION_trace,
     "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
Signature · 1 line
2.13.6
#11 lore raw

[Qemu-devel] [PULL 7/9] config: qemu_config_parse() return number of config groups

In reply to Eduardo Habkost

Change qemu_config_parse() to return the number of config groups in success and -EINVAL on error. This will allow callers of qemu_config_parse() to check if something was really loaded from the config file.

All existing callers of qemu_config_parse() and qemu_read_config_file() only check if the return value was negative, so the change shouldn't affect them.

Message-Id: <[email protected]>

---
 block/blkdebug.c   |  1 -
 util/qemu-config.c | 15 +++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)
block/blkdebug.c +0 -1
index 46e53f2f09..dfdf9b91aa 100644
@@ -244,7 +244,6 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
         ret = qemu_config_parse(f, config_groups, filename);
         if (ret < 0) {
             error_setg(errp, "Could not parse blkdebug config file");
-            ret = -EINVAL;
             goto fail;
         }
     }
util/qemu-config.c +7 -8
index 405dd1a1d7..99b0e46fa3 100644
@@ -385,6 +385,7 @@ void qemu_config_write(FILE *fp)
     }
 }
 
+/* Returns number of config groups on success, -errno on error */
 int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
 {
     char line[1024], group[64], id[64], arg[64], value[1024];
@@ -392,7 +393,8 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
     QemuOptsList *list = NULL;
     Error *local_err = NULL;
     QemuOpts *opts = NULL;
-    int res = -1, lno = 0;
+    int res = -EINVAL, lno = 0;
+    int count = 0;
 
     loc_push_none(&loc);
     while (fgets(line, sizeof(line), fp) != NULL) {
@@ -413,6 +415,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
                 goto out;
             }
             opts = qemu_opts_create(list, id, 1, NULL);
+            count++;
             continue;
         }
         if (sscanf(line, "[%63[^]]]", group) == 1) {
@@ -423,6 +426,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
                 goto out;
             }
             opts = qemu_opts_create(list, NULL, 0, &error_abort);
+            count++;
             continue;
         }
         value[0] = '\0';
@@ -447,7 +451,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
         error_report("error reading file");
         goto out;
     }
-    res = 0;
+    res = count;
 out:
     loc_pop(&loc);
     return res;
@@ -464,12 +468,7 @@ int qemu_read_config_file(const char *filename)
 
     ret = qemu_config_parse(f, vm_config_groups, filename);
     fclose(f);
-
-    if (ret == 0) {
-        return 0;
-    } else {
-        return -EINVAL;
-    }
+    return ret;
 }
 
 static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
Signature · 1 line
2.13.6
#12 lore raw

[Qemu-devel] [PULL 8/9] qom: update doc comment for type_register[_static]()

In reply to Eduardo Habkost

From: Igor Mammedov <[email protected]>

type_register()/type_register_static() functions in current impl. can't fail returning 0, also none of the users check for error so update doc comment to reflect current behaviour.

Message-Id: <[email protected]>

---
 include/qom/object.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/qom/object.h +2 -2
index e0d9824415..a707b67781 100644
@@ -773,7 +773,7 @@ const char *object_get_typename(const Object *obj);
  * @info and all of the strings it points to should exist for the life time
  * that the type is registered.
  *
- * Returns: 0 on failure, the new #Type on success.
+ * Returns: the new #Type.
  */
 Type type_register_static(const TypeInfo *info);
 
@@ -784,7 +784,7 @@ Type type_register_static(const TypeInfo *info);
  * Unlike type_register_static(), this call does not require @info or its
  * string members to continue to exist after the call returns.
  *
- * Returns: 0 on failure, the new #Type on success.
+ * Returns: the new #Type.
  */
 Type type_register(const TypeInfo *info);
 
Signature · 1 line
2.13.6
#13 lore raw

[Qemu-devel] [PULL 9/9] x86: Correct translation of some rdgsbase and wrgsbase encodings

In reply to Eduardo Habkost

From: Todd Eisenberger <[email protected]>

It looks like there was a transcription error when writing this code initially. The code previously only decoded src or dst of rax. This resolves
https://bugs.launchpad.net/qemu/+bug/1719984.

Message-Id: <CAP26EVRNVb=Mq=O3s51w7fDhGVmf-e3XFFA73MRzc5b4qKBA4g@mail.gmail.com>

---
 target/i386/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/translate.c +2 -2
index a8986f4c1a..7b920115f9 100644
@@ -8155,9 +8155,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
             break;
 
         case 0xc0 ... 0xc7: /* rdfsbase (f3 0f ae /0) */
-        case 0xc8 ... 0xc8: /* rdgsbase (f3 0f ae /1) */
+        case 0xc8 ... 0xcf: /* rdgsbase (f3 0f ae /1) */
         case 0xd0 ... 0xd7: /* wrfsbase (f3 0f ae /2) */
-        case 0xd8 ... 0xd8: /* wrgsbase (f3 0f ae /3) */
+        case 0xd8 ... 0xdf: /* wrgsbase (f3 0f ae /3) */
             if (CODE64(s)
                 && (prefixes & PREFIX_REPZ)
                 && !(prefixes & PREFIX_LOCK)
Signature · 1 line
2.13.6
#14 lore raw
In reply to Eduardo Habkost
Quoted 15 lines · Eduardo Habkost

The following changes since commit d8f932cc696250cb740240d668b39df5fbb2d5a0:

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2017-10-05 16:54:29 +0100)

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 7d7e9c4fd6873d9624956cbe0a5cbfae59b7f8af:

x86: Correct translation of some rdgsbase and wrgsbase encodings (2017-10-05 17:30:06 -0300)

----------------------------------------------------------------
x86 and machine queue, 2017-10-05

Quoted 8 lines

Includes x86, NUMA, ACPI, QOM, CPU, and option/config parsing patches.

Highlights:
* Deprecation of -nodefconfig option;
* MachineClass::valid_cpu_types field.

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

This fails tests, I'm afraid:

TEST: tests/bios-tables-test... (pid=5565)
/i386/acpi/piix4:
Looking for expected file 'tests/acpi-test-data/pc/DSDT'

Using expected file 'tests/acpi-test-data/pc/DSDT'

Looking for expected file 'tests/acpi-test-data/pc/APIC'

Using expected file 'tests/acpi-test-data/pc/APIC'

Looking for expected file 'tests/acpi-test-data/pc/HPET'

Using expected file 'tests/acpi-test-data/pc/HPET' OK
/i386/acpi/q35:
[snip]
/i386/acpi/piix4/memhp:
Looking for expected file 'tests/acpi-test-data/pc/DSDT.memhp'

Using expected file 'tests/acpi-test-data/pc/DSDT.memhp'

Looking for expected file 'tests/acpi-test-data/pc/APIC.memhp'

Looking for expected file 'tests/acpi-test-data/pc/APIC'

Using expected file 'tests/acpi-test-data/pc/APIC'

Looking for expected file 'tests/acpi-test-data/pc/HPET.memhp'

Looking for expected file 'tests/acpi-test-data/pc/HPET'

Using expected file 'tests/acpi-test-data/pc/HPET'

Looking for expected file 'tests/acpi-test-data/pc/SRAT.memhp'

Using expected file 'tests/acpi-test-data/pc/SRAT.memhp'

Looking for expected file 'tests/acpi-test-data/pc/SLIT.memhp'

Using expected file 'tests/acpi-test-data/pc/SLIT.memhp'
acpi-test: Warning! DSDT mismatch. Actual [asl:/tmp/asl-6QYK7Y.dsl, aml:/tmp/aml-E8YK7Y], Expected [asl:/tmp/asl-1H1I7Y.dsl, aml:tests/acpi-test-data/pc/DSDT.memhp].
acpi-test: Warning. not showing difference since no diff utility is specified. Set 'DIFF' environment variable to a preferred diff utility and run 'make V=1 check' again to see ASL difference.OK

and same for /i386/acpi/piix4/numamem and for the
equivalent q35 tests.

Fails on s390, netbsd, freebsd, aarch32, x86-64.

As an aside, these acpi tests are a bit noisy with V=1, especially the extra blank lines.

thanks
-- PMM

#16 lore raw
In reply to Peter Maydell
Quoted 26 lines · Peter Maydell
Quoted 15 lines · Eduardo Habkost

The following changes since commit d8f932cc696250cb740240d668b39df5fbb2d5a0:

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2017-10-05 16:54:29 +0100)

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 7d7e9c4fd6873d9624956cbe0a5cbfae59b7f8af:

x86: Correct translation of some rdgsbase and wrgsbase encodings (2017-10-05 17:30:06 -0300)

----------------------------------------------------------------
x86 and machine queue, 2017-10-05

Quoted 8 lines

Includes x86, NUMA, ACPI, QOM, CPU, and option/config parsing patches.

Highlights:
* Deprecation of -nodefconfig option;
* MachineClass::valid_cpu_types field.

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

This fails tests, I'm afraid:

[...]

Quoted 7 lines

acpi-test: Warning! DSDT mismatch. Actual [asl:/tmp/asl-6QYK7Y.dsl, aml:/tmp/aml-E8YK7Y], Expected [asl:/tmp/asl-1H1I7Y.dsl, aml:tests/acpi-test-data/pc/DSDT.memhp].
acpi-test: Warning. not showing difference since no diff utility is specified. Set 'DIFF' environment variable to a preferred diff utility and run 'make V=1 check' again to see ASL difference.OK

Quoted 5 lines

and same for /i386/acpi/piix4/numamem and for the
equivalent q35 tests.

Fails on s390, netbsd, freebsd, aarch32, x86-64.

Oops, sorry!

I need to find out why it didn't fail on travis-ci:
https://travis-ci.org/ehabkost/qemu/builds/283884670

Signature · 1 line
Eduardo
#17 lore raw
Quoted 13 lines · Eduardo Habkost
Quoted 1 line · Peter Maydell

This fails tests, I'm afraid:

[...]

Quoted 10 lines

acpi-test: Warning! DSDT mismatch. Actual [asl:/tmp/asl-6QYK7Y.dsl, aml:/tmp/aml-E8YK7Y], Expected [asl:/tmp/asl-1H1I7Y.dsl, aml:tests/acpi-test-data/pc/DSDT.memhp].
acpi-test: Warning. not showing difference since no diff utility is specified. Set 'DIFF' environment variable to a preferred diff utility and run 'make V=1 check' again to see ASL difference.OK

and same for /i386/acpi/piix4/numamem and for the
equivalent q35 tests.

Quoted 7 lines
Quoted 2 lines

Fails on s390, netbsd, freebsd, aarch32, x86-64.

Oops, sorry!

I need to find out why it didn't fail on travis-ci:
https://travis-ci.org/ehabkost/qemu/builds/283884670

My guess is that one of {iasl installed, iasl not installed} is broken, but the travis environments don't test both.

thanks
-- PMM

#18 lore raw

Hi Eduardo,

I couldn't reproduce the failure too. But, I have some concern below.

Quoted 7 lines · Peter Maydell
Quoted 6 lines · Eduardo Habkost
Quoted 1 line · Peter Maydell

This fails tests, I'm afraid:

[...]

Quoted 3 lines

acpi-test: Warning! DSDT mismatch. Actual [asl:/tmp/asl-6QYK7Y.dsl, aml:/tmp/aml-E8YK7Y], Expected [asl:/tmp/asl-1H1I7Y.dsl, aml:tests/acpi-test-data/pc/DSDT.memhp].

This warning is about memory hot-plug tests. DSDT mismatch is too strange, I hope to see their difference.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

acpi-test: Warning. not showing difference since no diff utility is specified. Set 'DIFF' environment variable to a preferred diff utility and run 'make V=1 check' again to see ASL difference.OK

and same for /i386/acpi/piix4/numamem and for the
equivalent q35 tests.

Fails on s390, netbsd, freebsd, aarch32, x86-64.

Quoted 8 lines
Quoted 4 lines

Oops, sorry!

I need to find out why it didn't fail on travis-ci:
https://travis-ci.org/ehabkost/qemu/builds/283884670

My guess is that one of {iasl installed, iasl not installed} is broken, but the travis environments don't test both.

If we want do the "bios-tables-test", we need iasl support.

otherwise, when I run "make V=1 check" without iasl, the test will report error:

...
TEST: tests/bios-tables-test... (pid=1006)
/i386/acpi/piix4:
Looking for expected file 'tests/acpi-test-data/pc/DSDT'

Using expected file 'tests/acpi-test-data/pc/DSDT'

Looking for expected file 'tests/acpi-test-data/pc/APIC'

Using expected file 'tests/acpi-test-data/pc/APIC'

Looking for expected file 'tests/acpi-test-data/pc/HPET'

Using expected file 'tests/acpi-test-data/pc/HPET'
**
ERROR:tests/bios-tables-test.c:328:load_asl: assertion failed (error == NULL): Failed to execute child process "iasl" (No such file or directory) (g-exec-error-quark, 8) FAIL
...

Thanks,
dou.

Quoted 6 lines

thanks
-- PMM

#19 lore raw
Quoted 4 lines · Dou Liyang

If we want do the "bios-tables-test", we need iasl support.

otherwise, when I run "make V=1 check" without iasl, the test will report error:

This works in master at the moment, I think (whether by skipping the test or by using pre-compiled tables I don't know). We need to keep 'make check' working with and without iasl.

thanks
-- PMM

#20 lore raw

Hi Peter,

Quoted 9 lines · Peter Maydell
Quoted 4 lines · Dou Liyang

If we want do the "bios-tables-test", we need iasl support.

otherwise, when I run "make V=1 check" without iasl, the test will report error:

This works in master at the moment, I think (whether by skipping the test or by using pre-compiled tables I don't know). We need to keep 'make check' working with and without iasl.

Yes, you are right, QEMU uses the macro named CONFIG_IASL to skip the test if there is no ACPICA-tools in our system.

The QEMU has already kept 'make check' working with and without iasl.

The way I tested was wrong.

Thanks,
dou.

Quoted 6 lines

thanks
-- PMM

#21 lore raw
In reply to Dou Liyang
Quoted 50 lines · Dou Liyang

Hi Eduardo,

I couldn't reproduce the failure too. But, I have some concern below.

Quoted 7 lines · Peter Maydell
Quoted 6 lines · Eduardo Habkost
Quoted 1 line · Peter Maydell

This fails tests, I'm afraid:

[...]

Quoted 3 lines

acpi-test: Warning! DSDT mismatch. Actual [asl:/tmp/asl-6QYK7Y.dsl, aml:/tmp/aml-E8YK7Y], Expected [asl:/tmp/asl-1H1I7Y.dsl, aml:tests/acpi-test-data/pc/DSDT.memhp].

This warning is about memory hot-plug tests. DSDT mismatch is too strange, I hope to see their difference.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

acpi-test: Warning. not showing difference since no diff utility is specified. Set 'DIFF' environment variable to a preferred diff utility and run 'make V=1 check' again to see ASL difference.OK

and same for /i386/acpi/piix4/numamem and for the
equivalent q35 tests.

Fails on s390, netbsd, freebsd, aarch32, x86-64.

Quoted 8 lines
Quoted 4 lines

Oops, sorry!

I need to find out why it didn't fail on travis-ci:
https://travis-ci.org/ehabkost/qemu/builds/283884670

My guess is that one of {iasl installed, iasl not installed} is broken, but the travis environments don't test both.

If we want do the "bios-tables-test", we need iasl support.

otherwise, when I run "make V=1 check" without iasl, the test will report error:

...
TEST: tests/bios-tables-test... (pid=1006)
/i386/acpi/piix4:
Looking for expected file 'tests/acpi-test-data/pc/DSDT'

Using expected file 'tests/acpi-test-data/pc/DSDT'

Looking for expected file 'tests/acpi-test-data/pc/APIC'

Using expected file 'tests/acpi-test-data/pc/APIC'

Quoted 8 lines

Looking for expected file 'tests/acpi-test-data/pc/HPET'

Using expected file 'tests/acpi-test-data/pc/HPET'
**
ERROR:tests/bios-tables-test.c:328:load_asl: assertion failed (error == NULL): Failed to execute child process "iasl" (No such file or directory) (g-exec-error-quark, 8)
FAIL

This shouldn't happen if CONFIG_IASL is not defined. Did you run configure again after removing iasl?

Signature · 1 line
Eduardo
#22 lore raw
Quoted 2 lines · Eduardo Habkost

This shouldn't happen if CONFIG_IASL is not defined. Did you run configure again after removing iasl?

I've neither added nor removed iasl from the build systems in question. Pull request tests just apply the pull and run make/make check.

thanks
-- PMM

#23 lore raw

Hi Peter,

Quoted 8 lines · Peter Maydell
Quoted 2 lines · Eduardo Habkost

This shouldn't happen if CONFIG_IASL is not defined. Did you run configure again after removing iasl?

I've neither added nor removed iasl from the build systems in question. Pull request tests just apply the pull and run make/make check.

Yes, Indeed.

now I can be sure that the problem is not related to iasl installed or not. There are both OK in my host.

According to:

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

acpi-test: Warning! DSDT mismatch. Actual [asl:/tmp/asl-6QYK7Y.dsl, aml:/tmp/aml-E8YK7Y], Expected [asl:/tmp/asl-1H1I7Y.dsl, aml:tests/acpi-test-data/pc/DSDT.memhp].

May I resend the patch independently, and could you help me test it in
your machine. then, give me the output files, such as /tmp/asl-6QYK7Y.dsl and /tmp/asl-1H1I7Y.dsl file.

Thanks,
dou.

Quoted 5 lines

thanks
-- PMM

#24 lore raw
In reply to Peter Maydell
Quoted 7 lines · Peter Maydell
Quoted 2 lines · Eduardo Habkost

This shouldn't happen if CONFIG_IASL is not defined. Did you run configure again after removing iasl?

I've neither added nor removed iasl from the build systems in question. Pull request tests just apply the pull and run make/make check.

I understand. The question was about the test failure reported by Dou Liyang.

Signature · 1 line
Eduardo
#25 lore raw
In reply to Eduardo Habkost

Hi Eduardo,

Quoted 2 lines · Eduardo Habkost

This shouldn't happen if CONFIG_IASL is not defined. Did you run configure again after removing iasl?

Oops, Yes, the result above is in CONFIG_IASL = iasl. :-( I have been aware of this problem.

I am waiting the result of the test with './configure --iasl="" '

Thanks,
dou.