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
…021-01-20' into staging

* Fixes for compiling QEMU on Alpine Linux
* Add Alpine Linux to the gitlab-CI
* Some small fixes for qtests
* Updates to the MAINTAINERS file

# gpg: Signature made Wed 20 Jan 2021 12:56:14 GMT
# 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-2021-01-20:
  MAINTAINERS: Make status spellings consistent
  MAINTAINERS: Remove Ben Warren
  tests: Fix memory leak in tpm-util.c
  qtest/npcm7xx_pwm-test: Fix memleak in pwm_qom_get
  gitlab-ci: Add alpine to pipeline
  tests/check-block.sh: Refuse to run the iotests with BusyBox' sed
  tests/docker: Add dockerfile for Alpine Linux
  accel/kvm: avoid using predefined PAGE_SIZE
  tests: Rename PAGE_SIZE definitions
  elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
  hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
  libvhost-user: Include poll.h instead of sys/poll.h
  configure: Add sys/timex.h to probe clock_adjtime
  osdep.h: Remove <sys/signal.h> include

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Jan 20, 2021
2 parents 48202c7 + 4251dfb commit 954b83f
Show file tree
Hide file tree
Showing 22 changed files with 224 additions and 123 deletions.
5 changes: 5 additions & 0 deletions .gitlab-ci.d/containers.yml
Expand Up @@ -28,6 +28,11 @@
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_REF_NAME == "testing/next"'

amd64-alpine-container:
<<: *container_job_definition
variables:
NAME: alpine

amd64-centos7-container:
<<: *container_job_definition
variables:
Expand Down
33 changes: 33 additions & 0 deletions .gitlab-ci.yml
Expand Up @@ -72,6 +72,39 @@ include:
- cd build
- du -chs ${CI_PROJECT_DIR}/avocado-cache

build-system-alpine:
<<: *native_build_job_definition
variables:
IMAGE: alpine
TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
moxie-softmmu microblazeel-softmmu mips64el-softmmu
MAKE_CHECK_ARGS: check-build
CONFIGURE_ARGS: --enable-docs
artifacts:
expire_in: 2 days
paths:
- .git-submodule-status
- build

check-system-alpine:
<<: *native_test_job_definition
needs:
- job: build-system-alpine
artifacts: true
variables:
IMAGE: alpine
MAKE_CHECK_ARGS: check

acceptance-system-alpine:
<<: *native_test_job_definition
needs:
- job: build-system-alpine
artifacts: true
variables:
IMAGE: alpine
MAKE_CHECK_ARGS: check-acceptance
<<: *acceptance_definition

build-system-ubuntu:
<<: *native_build_job_definition
variables:
Expand Down
13 changes: 6 additions & 7 deletions MAINTAINERS
Expand Up @@ -1142,7 +1142,7 @@ F: tests/acceptance/machine_mips_malta.py

Mipssim
R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
S: Orphaned
S: Orphan
F: hw/mips/mipssim.c
F: hw/net/mipsnet.c

Expand Down Expand Up @@ -1999,8 +1999,7 @@ F: include/hw/nvram/chrp_nvram.h
F: tests/qtest/prom-env-test.c

VM Generation ID
M: Ben Warren <ben@skyportsystems.com>
S: Maintained
S: Orphan
F: hw/acpi/vmgenid.c
F: include/hw/acpi/vmgenid.h
F: docs/specs/vmgenid.txt
Expand Down Expand Up @@ -2444,7 +2443,7 @@ T: git https://gitlab.com/jsnow/qemu.git python
Python scripts
M: Eduardo Habkost <ehabkost@redhat.com>
M: Cleber Rosa <crosa@redhat.com>
S: Odd fixes
S: Odd Fixes
F: scripts/*.py
F: tests/*.py

Expand Down Expand Up @@ -2681,7 +2680,7 @@ F: tests/test-coroutine.c

Buffers
M: Daniel P. Berrange <berrange@redhat.com>
S: Odd fixes
S: Odd Fixes
F: util/buffer.c
F: include/qemu/buffer.h

Expand Down Expand Up @@ -2710,7 +2709,7 @@ F: qapi/sockets.json

File monitor
M: Daniel P. Berrange <berrange@redhat.com>
S: Odd fixes
S: Odd Fixes
F: util/filemonitor*.c
F: include/qemu/filemonitor.h
F: tests/test-util-filemonitor.c
Expand Down Expand Up @@ -3264,7 +3263,7 @@ S: Odd Fixes
F: scripts/git-submodule.sh

UI translations
S: Orphaned
S: Orphan
F: po/*.po

Sphinx documentation configuration and build machinery
Expand Down
3 changes: 3 additions & 0 deletions accel/kvm/kvm-all.c
Expand Up @@ -58,6 +58,9 @@
/* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We
* need to use the real host PAGE_SIZE, as that's what KVM will use.
*/
#ifdef PAGE_SIZE
#undef PAGE_SIZE
#endif
#define PAGE_SIZE qemu_real_host_page_size

//#define DEBUG_KVM
Expand Down
1 change: 1 addition & 0 deletions configure
Expand Up @@ -4039,6 +4039,7 @@ fi
clock_adjtime=no
cat > $TMPC <<EOF
#include <time.h>
#include <sys/timex.h>
int main(void)
{
Expand Down
4 changes: 2 additions & 2 deletions contrib/elf2dmp/addrspace.c
Expand Up @@ -207,8 +207,8 @@ int va_space_rw(struct va_space *vs, uint64_t addr,
void *buf, size_t size, int is_write)
{
while (size) {
uint64_t page = addr & PFN_MASK;
size_t s = (page + PAGE_SIZE) - addr;
uint64_t page = addr & ELF2DMP_PFN_MASK;
size_t s = (page + ELF2DMP_PAGE_SIZE) - addr;
void *ptr;

s = (s > size) ? size : s;
Expand Down
6 changes: 3 additions & 3 deletions contrib/elf2dmp/addrspace.h
Expand Up @@ -10,9 +10,9 @@

#include "qemu_elf.h"

#define PAGE_BITS 12
#define PAGE_SIZE (1ULL << PAGE_BITS)
#define PFN_MASK (~(PAGE_SIZE - 1))
#define ELF2DMP_PAGE_BITS 12
#define ELF2DMP_PAGE_SIZE (1ULL << ELF2DMP_PAGE_BITS)
#define ELF2DMP_PFN_MASK (~(ELF2DMP_PAGE_SIZE - 1))

#define INVALID_PA UINT64_MAX

Expand Down
18 changes: 9 additions & 9 deletions contrib/elf2dmp/main.c
Expand Up @@ -244,8 +244,8 @@ static int fill_header(WinDumpHeader64 *hdr, struct pa_space *ps,
WinDumpHeader64 h;
size_t i;

QEMU_BUILD_BUG_ON(KUSD_OFFSET_SUITE_MASK >= PAGE_SIZE);
QEMU_BUILD_BUG_ON(KUSD_OFFSET_PRODUCT_TYPE >= PAGE_SIZE);
QEMU_BUILD_BUG_ON(KUSD_OFFSET_SUITE_MASK >= ELF2DMP_PAGE_SIZE);
QEMU_BUILD_BUG_ON(KUSD_OFFSET_PRODUCT_TYPE >= ELF2DMP_PAGE_SIZE);

if (!suite_mask || !product_type) {
return 1;
Expand Down Expand Up @@ -281,14 +281,14 @@ static int fill_header(WinDumpHeader64 *hdr, struct pa_space *ps,
};

for (i = 0; i < ps->block_nr; i++) {
h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / PAGE_SIZE;
h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / ELF2DMP_PAGE_SIZE;
h.PhysicalMemoryBlock.Run[i] = (WinDumpPhyMemRun64) {
.BasePage = ps->block[i].paddr / PAGE_SIZE,
.PageCount = ps->block[i].size / PAGE_SIZE,
.BasePage = ps->block[i].paddr / ELF2DMP_PAGE_SIZE,
.PageCount = ps->block[i].size / ELF2DMP_PAGE_SIZE,
};
}

h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << PAGE_BITS;
h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << ELF2DMP_PAGE_BITS;

*hdr = h;

Expand Down Expand Up @@ -379,7 +379,7 @@ static int pe_get_pdb_symstore_hash(uint64_t base, void *start_addr,
size_t pdb_name_sz;
size_t i;

QEMU_BUILD_BUG_ON(sizeof(*dos_hdr) >= PAGE_SIZE);
QEMU_BUILD_BUG_ON(sizeof(*dos_hdr) >= ELF2DMP_PAGE_SIZE);

if (memcmp(&dos_hdr->e_magic, e_magic, sizeof(e_magic))) {
return 1;
Expand Down Expand Up @@ -509,10 +509,10 @@ int main(int argc, char *argv[])
}
printf("CPU #0 IDT[0] -> 0x%016"PRIx64"\n", idt_desc_addr(first_idt_desc));

KernBase = idt_desc_addr(first_idt_desc) & ~(PAGE_SIZE - 1);
KernBase = idt_desc_addr(first_idt_desc) & ~(ELF2DMP_PAGE_SIZE - 1);
printf("Searching kernel downwards from 0x%016"PRIx64"...\n", KernBase);

for (; KernBase >= 0xfffff78000000000; KernBase -= PAGE_SIZE) {
for (; KernBase >= 0xfffff78000000000; KernBase -= ELF2DMP_PAGE_SIZE) {
nt_start_addr = va_space_resolve(&vs, KernBase);
if (!nt_start_addr) {
continue;
Expand Down
40 changes: 20 additions & 20 deletions hw/block/nand.c
Expand Up @@ -115,24 +115,24 @@ static void mem_and(uint8_t *dest, const uint8_t *src, size_t n)
# define NAND_IO

# define PAGE(addr) ((addr) >> ADDR_SHIFT)
# define PAGE_START(page) (PAGE(page) * (PAGE_SIZE + OOB_SIZE))
# define PAGE_START(page) (PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))
# define PAGE_MASK ((1 << ADDR_SHIFT) - 1)
# define OOB_SHIFT (PAGE_SHIFT - 5)
# define OOB_SIZE (1 << OOB_SHIFT)
# define SECTOR(addr) ((addr) >> (9 + ADDR_SHIFT - PAGE_SHIFT))
# define SECTOR_OFFSET(addr) ((addr) & ((511 >> PAGE_SHIFT) << 8))

# define PAGE_SIZE 256
# define NAND_PAGE_SIZE 256
# define PAGE_SHIFT 8
# define PAGE_SECTORS 1
# define ADDR_SHIFT 8
# include "nand.c"
# define PAGE_SIZE 512
# define NAND_PAGE_SIZE 512
# define PAGE_SHIFT 9
# define PAGE_SECTORS 1
# define ADDR_SHIFT 8
# include "nand.c"
# define PAGE_SIZE 2048
# define NAND_PAGE_SIZE 2048
# define PAGE_SHIFT 11
# define PAGE_SECTORS 4
# define ADDR_SHIFT 16
Expand Down Expand Up @@ -652,7 +652,7 @@ type_init(nand_register_types)
#else

/* Program a single page */
static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s)
static void glue(nand_blk_write_, NAND_PAGE_SIZE)(NANDFlashState *s)
{
uint64_t off, page, sector, soff;
uint8_t iobuf[(PAGE_SECTORS + 2) * 0x200];
Expand All @@ -672,11 +672,11 @@ static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s)
return;
}

mem_and(iobuf + (soff | off), s->io, MIN(s->iolen, PAGE_SIZE - off));
if (off + s->iolen > PAGE_SIZE) {
mem_and(iobuf + (soff | off), s->io, MIN(s->iolen, NAND_PAGE_SIZE - off));
if (off + s->iolen > NAND_PAGE_SIZE) {
page = PAGE(s->addr);
mem_and(s->storage + (page << OOB_SHIFT), s->io + PAGE_SIZE - off,
MIN(OOB_SIZE, off + s->iolen - PAGE_SIZE));
mem_and(s->storage + (page << OOB_SHIFT), s->io + NAND_PAGE_SIZE - off,
MIN(OOB_SIZE, off + s->iolen - NAND_PAGE_SIZE));
}

if (blk_pwrite(s->blk, sector << BDRV_SECTOR_BITS, iobuf,
Expand Down Expand Up @@ -704,7 +704,7 @@ static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s)
}

/* Erase a single block */
static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
static void glue(nand_blk_erase_, NAND_PAGE_SIZE)(NANDFlashState *s)
{
uint64_t i, page, addr;
uint8_t iobuf[0x200] = { [0 ... 0x1ff] = 0xff, };
Expand All @@ -716,7 +716,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)

if (!s->blk) {
memset(s->storage + PAGE_START(addr),
0xff, (PAGE_SIZE + OOB_SIZE) << s->erase_shift);
0xff, (NAND_PAGE_SIZE + OOB_SIZE) << s->erase_shift);
} else if (s->mem_oob) {
memset(s->storage + (PAGE(addr) << OOB_SHIFT),
0xff, OOB_SIZE << s->erase_shift);
Expand All @@ -742,7 +742,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)

memset(iobuf, 0xff, 0x200);
i = (addr & ~0x1ff) + 0x200;
for (addr += ((PAGE_SIZE + OOB_SIZE) << s->erase_shift) - 0x200;
for (addr += ((NAND_PAGE_SIZE + OOB_SIZE) << s->erase_shift) - 0x200;
i < addr; i += 0x200) {
if (blk_pwrite(s->blk, i, iobuf, BDRV_SECTOR_SIZE, 0) < 0) {
printf("%s: write error in sector %" PRIu64 "\n",
Expand All @@ -763,7 +763,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
}
}

static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s,
static void glue(nand_blk_load_, NAND_PAGE_SIZE)(NANDFlashState *s,
uint64_t addr, int offset)
{
if (PAGE(addr) >= s->pages) {
Expand All @@ -777,7 +777,7 @@ static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s,
printf("%s: read error in sector %" PRIu64 "\n",
__func__, SECTOR(addr));
}
memcpy(s->io + SECTOR_OFFSET(s->addr) + PAGE_SIZE,
memcpy(s->io + SECTOR_OFFSET(s->addr) + NAND_PAGE_SIZE,
s->storage + (PAGE(s->addr) << OOB_SHIFT),
OOB_SIZE);
s->ioaddr = s->io + SECTOR_OFFSET(s->addr) + offset;
Expand All @@ -791,23 +791,23 @@ static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s,
}
} else {
memcpy(s->io, s->storage + PAGE_START(s->addr) +
offset, PAGE_SIZE + OOB_SIZE - offset);
offset, NAND_PAGE_SIZE + OOB_SIZE - offset);
s->ioaddr = s->io;
}
}

static void glue(nand_init_, PAGE_SIZE)(NANDFlashState *s)
static void glue(nand_init_, NAND_PAGE_SIZE)(NANDFlashState *s)
{
s->oob_shift = PAGE_SHIFT - 5;
s->pages = s->size >> PAGE_SHIFT;
s->addr_shift = ADDR_SHIFT;

s->blk_erase = glue(nand_blk_erase_, PAGE_SIZE);
s->blk_write = glue(nand_blk_write_, PAGE_SIZE);
s->blk_load = glue(nand_blk_load_, PAGE_SIZE);
s->blk_erase = glue(nand_blk_erase_, NAND_PAGE_SIZE);
s->blk_write = glue(nand_blk_write_, NAND_PAGE_SIZE);
s->blk_load = glue(nand_blk_load_, NAND_PAGE_SIZE);
}

# undef PAGE_SIZE
# undef NAND_PAGE_SIZE
# undef PAGE_SHIFT
# undef PAGE_SECTORS
# undef ADDR_SHIFT
Expand Down
4 changes: 0 additions & 4 deletions include/qemu/osdep.h
Expand Up @@ -104,10 +104,6 @@ extern int daemon(int, int);
#include <setjmp.h>
#include <signal.h>

#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif

#ifndef _WIN32
#include <sys/wait.h>
#else
Expand Down
1 change: 0 additions & 1 deletion meson.build
Expand Up @@ -1113,7 +1113,6 @@ config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h'))
config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h'))
config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h'))
config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))

ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
Expand Down
2 changes: 1 addition & 1 deletion subprojects/libvhost-user/libvhost-user.h
Expand Up @@ -17,7 +17,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <sys/poll.h>
#include <poll.h>
#include <linux/vhost.h>
#include <pthread.h>
#include "standard-headers/linux/virtio_ring.h"
Expand Down
7 changes: 7 additions & 0 deletions tests/check-block.sh
Expand Up @@ -60,6 +60,13 @@ if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
echo "GNU sed not available ==> Not running the qemu-iotests."
exit 0
fi
else
# Double-check that we're not using BusyBox' sed which says
# that "This is not GNU sed version 4.0" ...
if sed --version | grep -q 'not GNU sed' ; then
echo "BusyBox sed not supported ==> Not running the qemu-iotests."
exit 0
fi
fi

cd tests/qemu-iotests
Expand Down

0 comments on commit 954b83f

Please sign in to comment.