Skip to contentSkip to conversation

various fixes (CI, Xen, warnings)

GIT PULL Applied Alex Bennée 4 participants 15 messages Nov 16, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

The following changes since commit b50ea0d54bbca7d440315c3d0c0f7a4d6537b180:

Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201113-1' into staging (2020-11-14 11:22:07 +0000)

are available in the Git repository at:

https://github.com/stsquad/qemu.git tags/pull-testing-and-misc-161120-1

for you to fetch changes up to 7025111a199b97ae806817788bec50f456c47d85:

.gitlab-ci.d/check-patch: tweak output for CI logs (2020-11-16 11:08:40 +0000)

----------------------------------------------------------------
Various fixes

- fix resource leak in a couple of plugin
- fix build of Xen enabled i386 image on Aarch64
- maybe unitialized warning fix
- disable unstable Spartan-3A acceptance test
- terser output of gitlab checkpatch check

----------------------------------------------------------------
Alex Bennée (5):
meson.build: fix building of Xen support for aarch64 include/hw/xen.h: drop superfluous struct stubs/xen-hw-stub: drop xenstore_store_pv_console_info stub accel/stubs: drop unused cpu.h include .gitlab-ci.d/check-patch: tweak output for CI logs

Alex Chen (2):
plugins: Fix resource leak in connect_socket()
plugins: Fix two resource leaks in setup_socket()

Philippe Mathieu-Daudé (2):
hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off tests/acceptance: Disable Spartan-3A DSP 1800A test

 meson.build                            |  7 +++++-
 include/hw/xen/xen.h                   |  2 +-
 accel/stubs/hax-stub.c                 |  1 -
 contrib/plugins/lockstep.c             |  3 +++
 hw/i386/acpi-build.c                   | 41 ++++++++++++++++------------------
 stubs/xen-hw-stub.c                    |  4 ----
 .gitlab-ci.d/check-patch.py            |  4 ++--
 tests/acceptance/boot_linux_console.py |  2 ++
 tests/acceptance/replay_kernel.py      |  2 ++
 9 files changed, 35 insertions(+), 31 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

[PULL 4/9] include/hw/xen.h: drop superfluous struct

Chardev is already a typedef'ed struct.

Message-Id: <[email protected]>

include/hw/xen/xen.h +1 -1
index 1406648ca5..0f9962b1c1 100644
@@ -28,7 +28,7 @@ int xen_is_pirq_msi(uint32_t msi_data);
 
 qemu_irq *xen_interrupt_controller_init(void);
 
-void xenstore_store_pv_console_info(int i, struct Chardev *chr);
+void xenstore_store_pv_console_info(int i, Chardev *chr);
 
 void xen_register_framebuffer(struct MemoryRegion *mr);
 
Signature · 1 line
2.20.1
#2 lore raw

[PULL 5/9] stubs/xen-hw-stub: drop xenstore_store_pv_console_info stub

In reply to Alex Bennée

We should never build something that calls this without having it.

Message-Id: <[email protected]>

stubs/xen-hw-stub.c +0 -4
index 2ea8190921..15f3921a76 100644
@@ -10,10 +10,6 @@
 #include "hw/xen/xen.h"
 #include "hw/xen/xen-x86.h"
 
-void xenstore_store_pv_console_info(int i, Chardev *chr)
-{
-}
-
 int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
 {
     return -1;
Signature · 1 line
2.20.1
#3 lore raw

[PULL 1/9] plugins: Fix resource leak in connect_socket()

In reply to Alex Bennée

From: Alex Chen <[email protected]>

Close the fd when the connect() fails.

Message-Id: <[email protected]>
Message-Id: <[email protected]>

contrib/plugins/lockstep.c +1 -0
index a696673dff..319bd44b83 100644
@@ -292,6 +292,7 @@ static bool connect_socket(const char *path)
 
     if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
         perror("failed to connect");
+        close(fd);
         return false;
     }
 
Signature · 1 line
2.20.1
#4 lore raw

[PULL 3/9] meson.build: fix building of Xen support for aarch64

In reply to Alex Bennée

Xen is supported on ARM although weirdly using the i386-softmmu model. Checking based on the host CPU meant we never enabled Xen support. It would be nice to enable CONFIG_XEN for aarch64-softmmu to make it not seem weird but that will require further build surgery.

Fixes 8a19980e3f ("configure: move accelerator logic to meson")
Cc Masami Hiramatsu <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>
Cc Paul Durrant <[email protected]>

Message-Id: <[email protected]>

meson.build +6 -1
index 61d883bc07..132bc49782 100644
@@ -74,10 +74,15 @@ else
 endif
 
 accelerator_targets = { 'CONFIG_KVM': kvm_targets }
+if cpu in ['x86', 'x86_64', 'arm', 'aarch64']
+  # i368 emulator provides xenpv machine type for multiple architectures
+  accelerator_targets += {
+    'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'],
+  }
+endif
 if cpu in ['x86', 'x86_64']
   accelerator_targets += {
     'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'],
-    'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'],
     'CONFIG_HVF': ['x86_64-softmmu'],
     'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
   }
Signature · 1 line
2.20.1
#5 lore raw

[PULL 2/9] plugins: Fix two resource leaks in setup_socket()

In reply to Alex Bennée

From: Alex Chen <[email protected]>

Either accept() fails or exits normally, we need to close the fd.

Message-Id: <[email protected]>
Message-Id: <[email protected]>

contrib/plugins/lockstep.c +2 -0
index 319bd44b83..5aad50869d 100644
@@ -268,11 +268,13 @@ static bool setup_socket(const char *path)
     socket_fd = accept(fd, NULL, NULL);
     if (socket_fd < 0 && errno != EINTR) {
         perror("accept socket");
+        close(fd);
         return false;
     }
 
     qemu_plugin_outs("setup_socket::ready\n");
 
+    close(fd);
     return true;
 }
 
Signature · 1 line
2.20.1
#7 lore raw

[PULL 7/9] hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off

In reply to Alex Bennée

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

GCC 9.3.0 thinks that 'method' can be left uninitialized. This code is already in the "if (bsel || pcihp_bridge_en)" block statement, but it isn't smart enough to figure it out.

Restrict the code to be used only in the "if (bsel || pcihp_bridge_en)" block statement to fix (on Ubuntu):

../hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
../hw/i386/acpi-build.c:496:9: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    496 |         aml_append(parent_scope, method);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Fixes df4008c9c59 ("piix4: don't reserve hw resources when hotplug is off globally")

Message-Id: <[email protected]>
Message-Id: <[email protected]>

hw/i386/acpi-build.c +19 -22
index 4f66642d88..1f5c211245 100644
@@ -465,34 +465,31 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
      */
     if (bsel || pcihp_bridge_en) {
         method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
-    }
-    /* If bus supports hotplug select it and notify about local events */
-    if (bsel) {
-        uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
 
-        aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
-        aml_append(method,
-            aml_call2("DVNT", aml_name("PCIU"), aml_int(1) /* Device Check */)
-        );
-        aml_append(method,
-            aml_call2("DVNT", aml_name("PCID"), aml_int(3)/* Eject Request */)
-        );
-    }
+        /* If bus supports hotplug select it and notify about local events */
+        if (bsel) {
+            uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
 
-    /* Notify about child bus events in any case */
-    if (pcihp_bridge_en) {
-        QLIST_FOREACH(sec, &bus->child, sibling) {
-            int32_t devfn = sec->parent_dev->devfn;
+            aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
+            aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
+                                         aml_int(1))); /* Device Check */
+            aml_append(method, aml_call2("DVNT", aml_name("PCID"),
+                                         aml_int(3))); /* Eject Request */
+        }
 
-            if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) {
-                continue;
-            }
+        /* Notify about child bus events in any case */
+        if (pcihp_bridge_en) {
+            QLIST_FOREACH(sec, &bus->child, sibling) {
+                int32_t devfn = sec->parent_dev->devfn;
+
+                if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) {
+                    continue;
+                }
 
-            aml_append(method, aml_name("^S%.02X.PCNT", devfn));
+                aml_append(method, aml_name("^S%.02X.PCNT", devfn));
+            }
         }
-    }
 
-    if (bsel || pcihp_bridge_en) {
         aml_append(parent_scope, method);
     }
     qobject_unref(bsel);
Signature · 1 line
2.20.1
#8 lore raw

Re: [PULL 7/9] hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off

Quoted 14 lines · Alex Bennée

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

GCC 9.3.0 thinks that 'method' can be left uninitialized. This code is already in the "if (bsel || pcihp_bridge_en)" block statement, but it isn't smart enough to figure it out.

Restrict the code to be used only in the "if (bsel || pcihp_bridge_en)" block statement to fix (on Ubuntu):

../hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
../hw/i386/acpi-build.c:496:9: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    496 |         aml_append(parent_scope, method);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

cc1: all warnings being treated as errors

Fixes df4008c9c59 ("piix4: don't reserve hw resources when hotplug is off globally")

Message-Id: <[email protected]>
Message-Id: <[email protected]>

BTW it's in my pull request alredy.
Not sure why you are merging it too ...

Quoted 60 lines
hw/i386/acpi-build.c +19 -22
index 4f66642d88..1f5c211245 100644
@@ -465,34 +465,31 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
      */
     if (bsel || pcihp_bridge_en) {
         method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
-    }
-    /* If bus supports hotplug select it and notify about local events */
-    if (bsel) {
-        uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
 
-        aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
-        aml_append(method,
-            aml_call2("DVNT", aml_name("PCIU"), aml_int(1) /* Device Check */)
-        );
-        aml_append(method,
-            aml_call2("DVNT", aml_name("PCID"), aml_int(3)/* Eject Request */)
-        );
-    }
+        /* If bus supports hotplug select it and notify about local events */
+        if (bsel) {
+            uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
 
-    /* Notify about child bus events in any case */
-    if (pcihp_bridge_en) {
-        QLIST_FOREACH(sec, &bus->child, sibling) {
-            int32_t devfn = sec->parent_dev->devfn;
+            aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
+            aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
+                                         aml_int(1))); /* Device Check */
+            aml_append(method, aml_call2("DVNT", aml_name("PCID"),
+                                         aml_int(3))); /* Eject Request */
+        }
 
-            if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) {
-                continue;
-            }
+        /* Notify about child bus events in any case */
+        if (pcihp_bridge_en) {
+            QLIST_FOREACH(sec, &bus->child, sibling) {
+                int32_t devfn = sec->parent_dev->devfn;
+
+                if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) {
+                    continue;
+                }
 
-            aml_append(method, aml_name("^S%.02X.PCNT", devfn));
+                aml_append(method, aml_name("^S%.02X.PCNT", devfn));
+            }
         }
-    }
 
-    if (bsel || pcihp_bridge_en) {
         aml_append(parent_scope, method);
     }
     qobject_unref(bsel);
Signature · 1 line
2.20.1
#9 lore raw

Re: [PULL 7/9] hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off

Quoted 24 lines · Michael S. Tsirkin
Quoted 14 lines · Alex Bennée

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

GCC 9.3.0 thinks that 'method' can be left uninitialized. This code is already in the "if (bsel || pcihp_bridge_en)" block statement, but it isn't smart enough to figure it out.

Restrict the code to be used only in the "if (bsel || pcihp_bridge_en)" block statement to fix (on Ubuntu):

../hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
../hw/i386/acpi-build.c:496:9: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    496 |         aml_append(parent_scope, method);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

cc1: all warnings being treated as errors

Fixes df4008c9c59 ("piix4: don't reserve hw resources when hotplug is off globally")

Message-Id: <[email protected]>
Message-Id: <[email protected]>

Quoted 2 lines

BTW it's in my pull request alredy.
Not sure why you are merging it too ...

I suppose to unbreak Gitlab-CI...

There is no policy w.r.t. CI so maintainer don't have to use it, but this breaking it delay the workflow of others subsystems.

I'm not asking you to use it, just explaining why this patch is in Alex's queue.

Regards,

Phil.

#10 lore raw

Re: [PULL 7/9] hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off

Quoted 33 lines · Philippe Mathieu-Daudé
Quoted 24 lines · Michael S. Tsirkin
Quoted 14 lines · Alex Bennée

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

GCC 9.3.0 thinks that 'method' can be left uninitialized. This code is already in the "if (bsel || pcihp_bridge_en)" block statement, but it isn't smart enough to figure it out.

Restrict the code to be used only in the "if (bsel || pcihp_bridge_en)" block statement to fix (on Ubuntu):

../hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
../hw/i386/acpi-build.c:496:9: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    496 |         aml_append(parent_scope, method);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

cc1: all warnings being treated as errors

Fixes df4008c9c59 ("piix4: don't reserve hw resources when hotplug is off globally")

Message-Id: <[email protected]>
Message-Id: <[email protected]>

Quoted 2 lines

BTW it's in my pull request alredy.
Not sure why you are merging it too ...

I suppose to unbreak Gitlab-CI...

There is no policy w.r.t. CI so maintainer don't have to use it, but this breaking it delay the workflow of others subsystems.

Quoted 6 lines

I'm not asking you to use it, just explaining why this patch is in Alex's queue.

Regards,

Phil.

Not sure I understand.
It's in my pull request from Nov 15. I'm not sure how does it help anyone to also have it in another request from Nov 16...

Signature · 1 line
MST
#11 lore raw

Re: [PULL 7/9] hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off

Quoted 37 lines · Michael S. Tsirkin
Quoted 36 lines · Philippe Mathieu-Daudé
Quoted 24 lines · Michael S. Tsirkin
Quoted 14 lines · Alex Bennée

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

GCC 9.3.0 thinks that 'method' can be left uninitialized. This code is already in the "if (bsel || pcihp_bridge_en)" block statement, but it isn't smart enough to figure it out.

Restrict the code to be used only in the "if (bsel || pcihp_bridge_en)" block statement to fix (on Ubuntu):

../hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
../hw/i386/acpi-build.c:496:9: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    496 |         aml_append(parent_scope, method);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

cc1: all warnings being treated as errors

Fixes df4008c9c59 ("piix4: don't reserve hw resources when hotplug is off globally")

Message-Id: <[email protected]>
Message-Id: <[email protected]>

Quoted 2 lines

BTW it's in my pull request alredy.
Not sure why you are merging it too ...

I suppose to unbreak Gitlab-CI...

There is no policy w.r.t. CI so maintainer don't have to use it, but this breaking it delay the workflow of others subsystems.

I'm not asking you to use it, just explaining why this patch is in Alex's queue.

Quoted 7 lines
Quoted 3 lines

Regards,

Phil.

Not sure I understand.
It's in my pull request from Nov 15. I'm not sure how does it help anyone to also have it in another request from Nov 16...

I didn't see your PR had gone in, it shouldn't matter though because git should be smart enough to deal with it being in two places at once.

Signature · 1 line
Alex Bennée
#12 lore raw

[PULL 8/9] tests/acceptance: Disable Spartan-3A DSP 1800A test

In reply to Alex Bennée

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

This test is regularly failing on CI:

(05/34) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_microblaze_s3adsp1800:
Linux version 4.11.3 ([email protected]) (gcc version 6.4.0 (Buildroot 2018.05.2) ) #5 Tue Dec 11 11:56:23 CET 2018
...
Freeing unused kernel memory: 1444K
This architecture does not have kernel memory protection.
[nothing happens here]
Runner error occurred: Timeout reached (90.91 s)

This is a regression. Until someone figure out the problem, disable the test to keep CI pipeline useful.

Message-Id: <[email protected]>
Message-Id: <[email protected]>

tests/acceptance/boot_linux_console.py +2 -0
index 8f433a67f8..cc6ec0f8c1 100644
@@ -13,6 +13,7 @@ import lzma
 import gzip
 import shutil
 
+from avocado import skip
 from avocado import skipUnless
 from avocado_qemu import Test
 from avocado_qemu import exec_command_and_wait_for_pattern
@@ -1025,6 +1026,7 @@ class BootLinuxConsole(LinuxKernelTest):
         tar_hash = 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c'
         self.do_test_advcal_2018('07', tar_hash, 'sanity-clause.elf')
 
+    @skip("Test currently broken") # Console stuck as of 5.2-rc1
     def test_microblaze_s3adsp1800(self):
         """
         :avocado: tags=arch:microblaze
tests/acceptance/replay_kernel.py +2 -0
index 00c228382b..772633b01d 100644
@@ -14,6 +14,7 @@ import shutil
 import logging
 import time
 
+from avocado import skip
 from avocado import skipIf
 from avocado import skipUnless
 from avocado_qemu import wait_for_console_pattern
@@ -280,6 +281,7 @@ class ReplayKernelNormal(ReplayKernelBase):
         file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
         self.do_test_advcal_2018(file_path, 'sanity-clause.elf')
 
+    @skip("Test currently broken") # Console stuck as of 5.2-rc1
     def test_microblaze_s3adsp1800(self):
         """
         :avocado: tags=arch:microblaze
Signature · 1 line
2.20.1
#13 lore raw

[PULL 9/9] .gitlab-ci.d/check-patch: tweak output for CI logs

In reply to Alex Bennée

We don't need running commentary for the CI logs and by keeping it short we might just see the problem on the first page. While we are at it flush the previous line so order is maintained between script and sub process.

Message-Id: <[email protected]>

.gitlab-ci.d/check-patch.py +2 -2
index 0ff30ee077..39e2b403c9 100755
@@ -45,9 +45,9 @@ if log == "":
 
 errors = False
 
-print("\nChecking all commits since %s...\n" % ancestor)
+print("\nChecking all commits since %s...\n" % ancestor, flush=True)
 
-ret = subprocess.run(["scripts/checkpatch.pl", ancestor + "..."])
+ret = subprocess.run(["scripts/checkpatch.pl", "--terse", ancestor + "..."])
 
 if ret.returncode != 0:
     print("    ❌ FAIL one or more commits failed scripts/checkpatch.pl")
Signature · 1 line
2.20.1
#14 lore raw
In reply to Alex Bennée
Quoted 13 lines · Alex Bennée

The following changes since commit b50ea0d54bbca7d440315c3d0c0f7a4d6537b180:

Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201113-1' into staging (2020-11-14 11:22:07 +0000)

are available in the Git repository at:

https://github.com/stsquad/qemu.git tags/pull-testing-and-misc-161120-1

for you to fetch changes up to 7025111a199b97ae806817788bec50f456c47d85:

.gitlab-ci.d/check-patch: tweak output for CI logs (2020-11-16 11:08:40 +0000)

Quoted 8 lines

----------------------------------------------------------------
Various fixes

- fix resource leak in a couple of plugin
- fix build of Xen enabled i386 image on Aarch64
- maybe unitialized warning fix
- disable unstable Spartan-3A acceptance test
- terser output of gitlab checkpatch check

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM