Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2…
Browse files Browse the repository at this point in the history
…020-09-03' into staging

* Cirrus-CI improvements and fixes (compile with -Werror & fix for 1h problem)
* Two build system fixes to fix some failures the CI
* One m68k QOMification patch
* Some trivial qtest patches
* Some small improvements for the Gitlab CI

# gpg: Signature made Thu 03 Sep 2020 12:04:32 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2020-09-03:
  gitlab-ci.yml: Set artifacts expiration time
  gitlab-ci.yml: Run check-qtest and check-unit at the end of the fuzzer job
  gitlab/travis: Rework the disabled features tests
  libqtest: Rename qmp_assert_error_class() to qmp_expect_error_and_unref()
  tests/qtest/ipmi-kcs: Fix assert side-effect
  tests/qtest/tpm: Declare input buffers const and static
  tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS)
  hw/m68k: QOMify the mcf5206 system integration module
  configure: Add system = 'linux' for meson when cross-compiling
  meson: fix keymaps without qemu-keymap
  cirrus.yml: Split FreeBSD job into two parts
  cirrus.yml: Update the macOS jobs to Catalina
  cirrus.yml: Compile macOS with -Werror
  cirrus.yml: Compile FreeBSD with -Werror
  configure: Fix atomic64 test for --enable-werror on macOS

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Sep 3, 2020
2 parents 3dd23a4 + 0a796d6 commit 67a7bfe
Show file tree
Hide file tree
Showing 18 changed files with 183 additions and 89 deletions.
43 changes: 33 additions & 10 deletions .cirrus.yml
@@ -1,42 +1,65 @@
env:
CIRRUS_CLONE_DEPTH: 1

freebsd_12_task:
freebsd_1st_task:
freebsd_instance:
image_family: freebsd-12-1
cpu: 8
memory: 8G
cpu: 4
memory: 4G
install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y
bash curl cyrus-sasl git glib gmake gnutls gsed
nettle perl5 pixman pkgconf png usbredir
script:
- mkdir build
- cd build
- ../configure || { cat config.log; exit 1; }
- gmake -j8
- gmake V=1 check
- ../configure --disable-user --target-list-exclude='alpha-softmmu
ppc64-softmmu ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu
sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu'
--enable-werror || { cat config.log; exit 1; }
- gmake -j$(sysctl -n hw.ncpu)
- gmake -j$(sysctl -n hw.ncpu) check

freebsd_2nd_task:
freebsd_instance:
image_family: freebsd-12-1
cpu: 4
memory: 4G
install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y
bash curl cyrus-sasl git glib gmake gnutls gtk3 gsed libepoxy mesa-libs
nettle perl5 pixman pkgconf png SDL2 usbredir
script:
- ./configure --enable-werror --target-list='alpha-softmmu ppc64-softmmu
ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu
sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu
sparc-bsd-user sparc64-bsd-user x86_64-bsd-user i386-bsd-user'
|| { cat config.log; exit 1; }
- gmake -j$(sysctl -n hw.ncpu)
- gmake -j$(sysctl -n hw.ncpu) check

macos_task:
osx_instance:
image: mojave-base
image: catalina-base
install_script:
- brew install pkg-config python gnu-sed glib pixman make sdl2 bash
script:
- mkdir build
- cd build
- ../configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; }
- ../configure --python=/usr/local/bin/python3 --enable-werror
--extra-cflags='-Wno-error=deprecated-declarations'
|| { cat config.log; exit 1; }
- gmake -j$(sysctl -n hw.ncpu)
- gmake check

macos_xcode_task:
osx_instance:
# this is an alias for the latest Xcode
image: mojave-xcode
image: catalina-xcode
install_script:
- brew install pkg-config gnu-sed glib pixman make sdl2 bash
script:
- mkdir build
- cd build
- ../configure --cc=clang || { cat config.log; exit 1; }
- ../configure --extra-cflags='-Wno-error=deprecated-declarations'
--enable-werror --cc=clang || { cat config.log; exit 1; }
- gmake -j$(sysctl -n hw.ncpu)
- gmake check
36 changes: 27 additions & 9 deletions .gitlab-ci.yml
Expand Up @@ -74,6 +74,7 @@ build-system-ubuntu:
moxie-softmmu microblazeel-softmmu mips64el-softmmu
MAKE_CHECK_ARGS: check-build
artifacts:
expire_in: 2 days
paths:
- build

Expand Down Expand Up @@ -104,6 +105,7 @@ build-system-debian:
riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
MAKE_CHECK_ARGS: check-build
artifacts:
expire_in: 2 days
paths:
- build

Expand Down Expand Up @@ -134,6 +136,7 @@ build-system-fedora:
xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
MAKE_CHECK_ARGS: check-build
artifacts:
expire_in: 2 days
paths:
- build

Expand Down Expand Up @@ -164,6 +167,7 @@ build-system-centos:
x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
MAKE_CHECK_ARGS: check-build
artifacts:
expire_in: 2 days
paths:
- build

Expand All @@ -190,13 +194,25 @@ build-disabled:
<<: *native_build_job_definition
variables:
IMAGE: fedora
CONFIGURE_ARGS: --disable-rdma --disable-slirp --disable-curl
--disable-capstone --disable-live-block-migration --disable-glusterfs
--disable-replication --disable-coroutine-pool --disable-smartcard
--disable-guest-agent --disable-curses --disable-libxml2 --disable-tpm
--disable-qom-cast-debug --disable-spice --disable-vhost-vsock
--disable-vhost-net --disable-vhost-crypto --disable-vhost-user
TARGETS: i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user
CONFIGURE_ARGS: --disable-attr --disable-avx2 --disable-bochs
--disable-brlapi --disable-bzip2 --disable-cap-ng --disable-capstone
--disable-cloop --disable-coroutine-pool --disable-curl --disable-curses
--disable-dmg --disable-docs --disable-glusterfs --disable-gnutls
--disable-gtk --disable-guest-agent --disable-iconv --disable-kvm
--disable-libiscsi --disable-libpmem --disable-libssh --disable-libusb
--disable-libxml2 --disable-linux-aio --disable-live-block-migration
--disable-lzo --disable-malloc-trim --disable-mpath --disable-nettle
--disable-numa --disable-parallels --disable-pie --disable-qcow1
--disable-qed --disable-qom-cast-debug --disable-rbd --disable-rdma
--disable-replication --disable-sdl --disable-seccomp --disable-sheepdog
--disable-slirp --disable-smartcard --disable-snappy --disable-spice
--disable-strip --disable-tpm --disable-usb-redir --disable-vdi
--disable-vhost-crypto --disable-vhost-net --disable-vhost-scsi
--disable-vhost-user --disable-vhost-vdpa --disable-vhost-vsock
--disable-virglrenderer --disable-vnc --disable-vte --disable-vvfat
--disable-xen --disable-zstd
TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
s390x-softmmu i386-linux-user
MAKE_CHECK_ARGS: check-qtest SPEED=slow

build-tcg-disabled:
Expand Down Expand Up @@ -243,13 +259,15 @@ build-oss-fuzz:
- mkdir build-oss-fuzz
- CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
./scripts/oss-fuzz/build.sh
- export ASAN_OPTIONS="fast_unwind_on_malloc=0"
- for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
| grep -v slirp); do
grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
echo Testing ${fuzzer} ... ;
ASAN_OPTIONS="fast_unwind_on_malloc=0"
"${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
"${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
done
# Unrelated to fuzzer: run some tests with -fsanitize=address
- cd build-oss-fuzz && make check-qtest-i386 check-unit

build-tci:
<<: *native_build_job_definition
Expand Down
6 changes: 0 additions & 6 deletions .travis.yml
Expand Up @@ -159,12 +159,6 @@ jobs:
- CONFIG="--enable-debug-tcg --disable-system"
- CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"


- name: "GCC some libs disabled (main-softmmu)"
env:
- CONFIG="--disable-linux-aio --disable-cap-ng --disable-attr --disable-brlapi --disable-libusb --disable-replication --target-list=${MAIN_SOFTMMU_TARGETS}"


# Module builds are mostly of interest to major distros
- name: "GCC modules (main-softmmu)"
env:
Expand Down
22 changes: 17 additions & 5 deletions configure
Expand Up @@ -5755,11 +5755,11 @@ int main(void)
{
uint64_t x = 0, y = 0;
#ifdef __ATOMIC_RELAXED
y = __atomic_load_8(&x, 0);
__atomic_store_8(&x, y, 0);
__atomic_compare_exchange_8(&x, &y, x, 0, 0, 0);
__atomic_exchange_8(&x, y, 0);
__atomic_fetch_add_8(&x, y, 0);
y = __atomic_load_n(&x, __ATOMIC_RELAXED);
__atomic_store_n(&x, y, __ATOMIC_RELAXED);
__atomic_compare_exchange_n(&x, &y, x, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
__atomic_exchange_n(&x, y, __ATOMIC_RELAXED);
__atomic_fetch_add(&x, y, __ATOMIC_RELAXED);
#else
typedef char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1];
__sync_lock_test_and_set(&x, y);
Expand Down Expand Up @@ -8065,6 +8065,9 @@ fi
# so the build tree will be missing the link back to the new file, and
# tests might fail. Prefer to keep the relevant files in their own
# directory and symlink the directory instead.
# UNLINK is used to remove symlinks from older development versions
# that might get into the way when doing "git update" without doing
# a "make distclean" in between.
DIRS="tests tests/tcg tests/tcg/lm32 tests/qapi-schema tests/qtest/libqos"
DIRS="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph"
DIRS="$DIRS docs docs/interop fsdev scsi"
Expand All @@ -8081,6 +8084,7 @@ LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
LINKS="$LINKS tests/acceptance tests/data"
LINKS="$LINKS tests/qemu-iotests/check"
LINKS="$LINKS python"
UNLINK="pc-bios/keymaps"
for bios_file in \
$source_path/pc-bios/*.bin \
$source_path/pc-bios/*.elf \
Expand All @@ -8101,6 +8105,11 @@ for f in $LINKS ; do
symlink "$source_path/$f" "$f"
fi
done
for f in $UNLINK ; do
if [ -L "$f" ]; then
rm -f "$f"
fi
done

(for i in $cross_cc_vars; do
export $i
Expand Down Expand Up @@ -8163,6 +8172,9 @@ if test -n "$cross_prefix"; then
?:*) pre_prefix=/ ;;
esac
fi
if test "$linux" = "yes" ; then
echo "system = 'linux'" >> $cross
fi
case "$ARCH" in
i386|x86_64)
echo "cpu_family = 'x86'" >> $cross
Expand Down
14 changes: 12 additions & 2 deletions hw/m68k/an5206.c
Expand Up @@ -21,7 +21,17 @@
#define AN5206_MBAR_ADDR 0x10000000
#define AN5206_RAMBAR_ADDR 0x20000000

/* Board init. */
static void mcf5206_init(MemoryRegion *sysmem, uint32_t base)
{
DeviceState *dev;
SysBusDevice *s;

dev = qdev_new(TYPE_MCF5206_MBAR);
s = SYS_BUS_DEVICE(dev);
sysbus_realize_and_unref(s, &error_fatal);

memory_region_add_subregion(sysmem, base, sysbus_mmio_get_region(s, 0));
}

static void an5206_init(MachineState *machine)
{
Expand Down Expand Up @@ -51,7 +61,7 @@ static void an5206_init(MachineState *machine)
memory_region_init_ram(sram, NULL, "an5206.sram", 512, &error_fatal);
memory_region_add_subregion(address_space_mem, AN5206_RAMBAR_ADDR, sram);

mcf5206_init(address_space_mem, AN5206_MBAR_ADDR, cpu);
mcf5206_init(address_space_mem, AN5206_MBAR_ADDR);

/* Load kernel. */
if (!kernel_filename) {
Expand Down
44 changes: 35 additions & 9 deletions hw/m68k/mcf5206.c
Expand Up @@ -15,6 +15,7 @@
#include "qemu/timer.h"
#include "hw/ptimer.h"
#include "sysemu/sysemu.h"
#include "hw/sysbus.h"

/* General purpose timer module. */
typedef struct {
Expand Down Expand Up @@ -159,6 +160,8 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)
/* System Integration Module. */

typedef struct {
SysBusDevice parent_obj;

M68kCPU *cpu;
MemoryRegion iomem;
m5206_timer_state *timer[2];
Expand All @@ -174,6 +177,8 @@ typedef struct {
uint8_t uivr[2];
} m5206_mbar_state;

#define MCF5206_MBAR(obj) OBJECT_CHECK(m5206_mbar_state, (obj), TYPE_MCF5206_MBAR)

/* Interrupt controller. */

static int m5206_find_pending_irq(m5206_mbar_state *s)
Expand Down Expand Up @@ -257,8 +262,10 @@ static void m5206_mbar_set_irq(void *opaque, int irq, int level)

/* System Integration Module. */

static void m5206_mbar_reset(m5206_mbar_state *s)
static void m5206_mbar_reset(DeviceState *dev)
{
m5206_mbar_state *s = MCF5206_MBAR(dev);

s->scr = 0xc0;
s->icr[1] = 0x04;
s->icr[2] = 0x08;
Expand Down Expand Up @@ -578,24 +585,43 @@ static const MemoryRegionOps m5206_mbar_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};

qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
static void mcf5206_mbar_realize(DeviceState *dev, Error **errp)
{
m5206_mbar_state *s;
m5206_mbar_state *s = MCF5206_MBAR(dev);
qemu_irq *pic;

s = g_new0(m5206_mbar_state, 1);

memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s,
"mbar", 0x00001000);
memory_region_add_subregion(sysmem, base, &s->iomem);
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);

pic = qemu_allocate_irqs(m5206_mbar_set_irq, s, 14);
s->timer[0] = m5206_timer_init(pic[9]);
s->timer[1] = m5206_timer_init(pic[10]);
s->uart[0] = mcf_uart_init(pic[12], serial_hd(0));
s->uart[1] = mcf_uart_init(pic[13], serial_hd(1));
s->cpu = cpu;
s->cpu = M68K_CPU(qemu_get_cpu(0));
}

static void mcf5206_mbar_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);

m5206_mbar_reset(s);
return pic;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
dc->desc = "MCF5206 system integration module";
dc->realize = mcf5206_mbar_realize;
dc->reset = m5206_mbar_reset;
}

static const TypeInfo mcf5206_mbar_info = {
.name = TYPE_MCF5206_MBAR,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(m5206_mbar_state),
.class_init = mcf5206_mbar_class_init,
};

static void mcf5206_mbar_register_types(void)
{
type_register_static(&mcf5206_mbar_info);
}

type_init(mcf5206_mbar_register_types)
3 changes: 1 addition & 2 deletions include/hw/m68k/mcf.h
Expand Up @@ -18,7 +18,6 @@ qemu_irq *mcf_intc_init(struct MemoryRegion *sysmem,
M68kCPU *cpu);

/* mcf5206.c */
qemu_irq *mcf5206_init(struct MemoryRegion *sysmem,
uint32_t base, M68kCPU *cpu);
#define TYPE_MCF5206_MBAR "mcf5206-mbar"

#endif
28 changes: 19 additions & 9 deletions pc-bios/keymaps/meson.build
Expand Up @@ -38,19 +38,29 @@ if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in config_host
else
native_qemu_keymap = qemu_keymap
endif

t = []
foreach km, args: keymaps
t += custom_target(km,
build_by_default: true,
output: km,
command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
install_dir: qemu_datadir / 'keymaps')
if native_qemu_keymap.found()
# generate with qemu-kvm
t += custom_target(km,
build_by_default: true,
output: km,
command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
install_dir: qemu_datadir / 'keymaps')
else
# copy from source tree
t += custom_target(km,
build_by_default: true,
input: km,
output: km,
command: ['cp', '@INPUT@', '@OUTPUT@'],
install_dir: qemu_datadir / 'keymaps')
endif
endforeach
if t.length() > 0

if native_qemu_keymap.found()
alias_target('update-keymaps', t)
else
# install from the source tree
install_data(keymaps.keys(), install_dir: qemu_datadir / 'keymaps')
endif

install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps')

0 comments on commit 67a7bfe

Please sign in to comment.