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
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAl+yXkkACgkQ+9DbCVqe
 KkSMfAf+JQ61fi5IJjLupVE80aMoFOJFdAeIZdeeQvVscvQbFIHYiZbjvtF2oQus
 +pzV5Ua0BFuaUrUaABHUwpMvEi+nLqxoUk5OjkUYyhXEYGZ2UY5kFKJiRBU4ktru
 a4rB3J+37dTuoEcEHp7DSlewZrFC48qMKCfZJdcapvMgVd5O5WkY5HmwN+WMgAfO
 Ivs4RnMHMIwYDiPmP4sVyCx00M721KEJBCn2tezRlHwuzyhmKmiCi7C6mXfcnWhT
 weGbSREji5gD7f+TR/tF7JECN1vNxvZmLiRuSV6J7QfdP3UC5dZ1jViaLMC48JJi
 rlMKEpNxJn4wdErHx5pZpeqiM1Vz5Q==
 =KIi3
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-misc-161120-1' into staging

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

# gpg: Signature made Mon 16 Nov 2020 11:11:05 GMT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-testing-and-misc-161120-1:
  .gitlab-ci.d/check-patch: tweak output for CI logs
  tests/acceptance: Disable Spartan-3A DSP 1800A test
  hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off
  accel/stubs: drop unused cpu.h include
  stubs/xen-hw-stub: drop xenstore_store_pv_console_info stub
  include/hw/xen.h: drop superfluous struct
  meson.build: fix building of Xen support for aarch64
  plugins: Fix two resource leaks in setup_socket()
  plugins: Fix resource leak in connect_socket()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-11-16 15:33:05 +00:00
commit f41ae328ba
9 changed files with 37 additions and 33 deletions

View File

@ -45,9 +45,9 @@ if log == "":
errors = False 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: if ret.returncode != 0:
print(" ❌ FAIL one or more commits failed scripts/checkpatch.pl") print(" ❌ FAIL one or more commits failed scripts/checkpatch.pl")

View File

@ -14,7 +14,6 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "cpu.h"
#include "sysemu/hax.h" #include "sysemu/hax.h"
int hax_sync_vcpus(void) int hax_sync_vcpus(void)

View File

@ -268,11 +268,13 @@ static bool setup_socket(const char *path)
socket_fd = accept(fd, NULL, NULL); socket_fd = accept(fd, NULL, NULL);
if (socket_fd < 0 && errno != EINTR) { if (socket_fd < 0 && errno != EINTR) {
perror("accept socket"); perror("accept socket");
close(fd);
return false; return false;
} }
qemu_plugin_outs("setup_socket::ready\n"); qemu_plugin_outs("setup_socket::ready\n");
close(fd);
return true; return true;
} }
@ -292,6 +294,7 @@ static bool connect_socket(const char *path)
if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
perror("failed to connect"); perror("failed to connect");
close(fd);
return false; return false;
} }

View File

@ -465,34 +465,31 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
*/ */
if (bsel || pcihp_bridge_en) { if (bsel || pcihp_bridge_en) {
method = aml_method("PCNT", 0, AML_NOTSERIALIZED); 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"))); /* If bus supports hotplug select it and notify about local events */
aml_append(method, if (bsel) {
aml_call2("DVNT", aml_name("PCIU"), aml_int(1) /* Device Check */) uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
);
aml_append(method,
aml_call2("DVNT", aml_name("PCID"), aml_int(3)/* Eject Request */)
);
}
/* Notify about child bus events in any case */ aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
if (pcihp_bridge_en) { aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
QLIST_FOREACH(sec, &bus->child, sibling) { aml_int(1))); /* Device Check */
int32_t devfn = sec->parent_dev->devfn; 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) {
aml_append(method, aml_name("^S%.02X.PCNT", devfn)); 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));
}
} }
}
if (bsel || pcihp_bridge_en) {
aml_append(parent_scope, method); aml_append(parent_scope, method);
} }
qobject_unref(bsel); qobject_unref(bsel);

View File

@ -28,7 +28,7 @@ int xen_is_pirq_msi(uint32_t msi_data);
qemu_irq *xen_interrupt_controller_init(void); 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); void xen_register_framebuffer(struct MemoryRegion *mr);

View File

@ -74,10 +74,15 @@ else
endif endif
accelerator_targets = { 'CONFIG_KVM': kvm_targets } 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'] if cpu in ['x86', 'x86_64']
accelerator_targets += { accelerator_targets += {
'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'],
'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'],
'CONFIG_HVF': ['x86_64-softmmu'], 'CONFIG_HVF': ['x86_64-softmmu'],
'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
} }

View File

@ -10,10 +10,6 @@
#include "hw/xen/xen.h" #include "hw/xen/xen.h"
#include "hw/xen/xen-x86.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) int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
{ {
return -1; return -1;

View File

@ -13,6 +13,7 @@ import lzma
import gzip import gzip
import shutil import shutil
from avocado import skip
from avocado import skipUnless from avocado import skipUnless
from avocado_qemu import Test from avocado_qemu import Test
from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import exec_command_and_wait_for_pattern
@ -1025,6 +1026,7 @@ class BootLinuxConsole(LinuxKernelTest):
tar_hash = 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c' tar_hash = 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c'
self.do_test_advcal_2018('07', tar_hash, 'sanity-clause.elf') 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): def test_microblaze_s3adsp1800(self):
""" """
:avocado: tags=arch:microblaze :avocado: tags=arch:microblaze

View File

@ -14,6 +14,7 @@ import shutil
import logging import logging
import time import time
from avocado import skip
from avocado import skipIf from avocado import skipIf
from avocado import skipUnless from avocado import skipUnless
from avocado_qemu import wait_for_console_pattern 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) file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
self.do_test_advcal_2018(file_path, 'sanity-clause.elf') 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): def test_microblaze_s3adsp1800(self):
""" """
:avocado: tags=arch:microblaze :avocado: tags=arch:microblaze