kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] Alpine Linux build fix and CI pipeline
@ 2020-12-21  0:53 Jiaxun Yang
  2020-12-21  0:53 ` [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux Jiaxun Yang
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

Alpine Linux[1] is a security-oriented, lightweight Linux distribution
based on musl libc and busybox.

It it popular among Docker guests and embedded applications.

Adding it to test against different libc.

[1]: https://alpinelinux.org/

Tree avilable at: https://gitlab.com/FlyGoat/qemu/-/tree/alpine_linux_v1

Jiaxun Yang (9):
  tests/docker: Add dockerfile for Alpine Linux
  configure: Add sys/timex.h to probe clk_adjtime
  configure/meson: Only check sys/signal.h on non-Linux
  libvhost-user: Include poll.h instead of sys/poll.h
  elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
  hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
  accel/kvm: avoid using predefined
  tests: Rename PAGE_SIZE definitions
  gitlab-ci: Add alpine to pipeline

 .gitlab-ci.d/containers.yml               |  5 ++
 .gitlab-ci.yml                            | 23 ++++++++
 accel/kvm/kvm-all.c                       |  3 +
 configure                                 |  1 +
 contrib/elf2dmp/addrspace.c               |  4 +-
 contrib/elf2dmp/addrspace.h               |  6 +-
 contrib/elf2dmp/main.c                    | 18 +++---
 hw/block/nand.c                           | 40 ++++++-------
 meson.build                               |  5 +-
 subprojects/libvhost-user/libvhost-user.h |  2 +-
 tests/docker/dockerfiles/alpine.docker    | 56 ++++++++++++++++++
 tests/migration/stress.c                  | 10 ++--
 tests/qtest/libqos/malloc-pc.c            |  4 +-
 tests/qtest/libqos/malloc-spapr.c         |  4 +-
 tests/qtest/m25p80-test.c                 | 54 ++++++++---------
 tests/tcg/multiarch/system/memory.c       |  6 +-
 tests/test-xbzrle.c                       | 70 +++++++++++------------
 17 files changed, 201 insertions(+), 110 deletions(-)
 create mode 100644 tests/docker/dockerfiles/alpine.docker

-- 
2.29.2


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2020-12-22 18:37   ` Wainer dos Santos Moschetta
  2020-12-21  0:53 ` [PATCH 2/9] configure: Add sys/timex.h to probe clk_adjtime Jiaxun Yang
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

Alpine Linux[1] is a security-oriented, lightweight Linux distribution
based on musl libc and busybox.

It it popular among Docker guests and embedded applications.

Adding it to test against different libc.

[1]: https://alpinelinux.org/

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 tests/docker/dockerfiles/alpine.docker | 56 ++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 tests/docker/dockerfiles/alpine.docker

diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
new file mode 100644
index 0000000000..a1b80f08d2
--- /dev/null
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -0,0 +1,56 @@
+
+FROM alpine:edge
+
+RUN apk update
+RUN apk upgrade
+
+# Please keep this list sorted alphabetically
+ENV PACKAGES \
+	alsa-lib-dev \
+	bash \
+	bison \
+	build-base \
+	coreutils \
+	curl-dev \
+	flex \
+	git \
+	glib-dev \
+	glib-static \
+	gnutls-dev \
+	gtk+3.0-dev \
+	libaio-dev \
+	libcap-dev \
+	libcap-ng-dev \
+	libjpeg-turbo-dev \
+	libnfs-dev \
+	libpng-dev \
+	libseccomp-dev \
+	libssh-dev \
+	libusb-dev \
+	libxml2-dev \
+	linux-headers \
+	lzo-dev \
+	mesa-dev \
+	mesa-egl \
+	mesa-gbm \
+	meson \
+	ncurses-dev \
+	ninja \
+	paxmark \
+	perl \
+	pulseaudio-dev \
+	python3 \
+	py3-sphinx \
+	snappy-dev \
+	spice-dev \
+	texinfo \
+	usbredir-dev \
+	util-linux-dev \
+	vde2-dev \
+	virglrenderer-dev \
+	vte3-dev \
+	xfsprogs-dev \
+	zlib-dev \
+	zlib-static
+
+RUN apk add $PACKAGES
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/9] configure: Add sys/timex.h to probe clk_adjtime
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
  2020-12-21  0:53 ` [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  6:59   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux Jiaxun Yang
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

It is not a part of standard time.h. Glibc put it under
time.h however musl treat it as a sys timex extension.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index c228f7c21e..990f37e123 100755
--- a/configure
+++ b/configure
@@ -4374,6 +4374,7 @@ fi
 clock_adjtime=no
 cat > $TMPC <<EOF
 #include <time.h>
+#include <sys/timex.h>
 
 int main(void)
 {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
  2020-12-21  0:53 ` [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux Jiaxun Yang
  2020-12-21  0:53 ` [PATCH 2/9] configure: Add sys/timex.h to probe clk_adjtime Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  7:05   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 4/9] libvhost-user: Include poll.h instead of sys/poll.h Jiaxun Yang
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

signal.h is equlevant of sys/signal.h on Linux, musl would complain
wrong usage of sys/signal.h.

In file included from /builds/FlyGoat/qemu/include/qemu/osdep.h:108,
                 from ../tests/qemu-iotests/socket_scm_helper.c:13:
/usr/include/sys/signal.h:1:2: error: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/signal.h> to <signal.h>
      |  ^~~~~~~

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 372576f82c..1ef8722b3a 100644
--- a/meson.build
+++ b/meson.build
@@ -841,7 +841,10 @@ 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'))
+if targetos != 'linux'
+  # signal.h is equlevant of sys/signal.h on Linux
+  config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
+endif
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
 arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/9] libvhost-user: Include poll.h instead of sys/poll.h
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (2 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  7:08   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE Jiaxun Yang
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

Musl libc complains about it's wrong usage.

In file included from ../subprojects/libvhost-user/libvhost-user.h:20,
                 from ../subprojects/libvhost-user/libvhost-user-glib.h:19,
                 from ../subprojects/libvhost-user/libvhost-user-glib.c:15:
/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 subprojects/libvhost-user/libvhost-user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h
index 7d47f1364a..3d13dfadde 100644
--- a/subprojects/libvhost-user/libvhost-user.h
+++ b/subprojects/libvhost-user/libvhost-user.h
@@ -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"
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (3 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 4/9] libvhost-user: Include poll.h instead of sys/poll.h Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  7:14   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 6/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE Jiaxun Yang
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

To prevent collosion of definition, we rename PAGE_SIZE here.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 contrib/elf2dmp/addrspace.c |  4 ++--
 contrib/elf2dmp/addrspace.h |  6 +++---
 contrib/elf2dmp/main.c      | 18 +++++++++---------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/contrib/elf2dmp/addrspace.c b/contrib/elf2dmp/addrspace.c
index 8a76069cb5..53ded17061 100644
--- a/contrib/elf2dmp/addrspace.c
+++ b/contrib/elf2dmp/addrspace.c
@@ -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;
diff --git a/contrib/elf2dmp/addrspace.h b/contrib/elf2dmp/addrspace.h
index d87f6a18c6..00b44c1218 100644
--- a/contrib/elf2dmp/addrspace.h
+++ b/contrib/elf2dmp/addrspace.h
@@ -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
 
diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
index ac746e49e0..20b477d582 100644
--- a/contrib/elf2dmp/main.c
+++ b/contrib/elf2dmp/main.c
@@ -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;
@@ -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;
 
@@ -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;
@@ -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;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 6/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (4 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  7:16   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE Jiaxun Yang
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

To prevent collosion of definition, we rename PAGE_SIZE here.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/block/nand.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/hw/block/nand.c b/hw/block/nand.c
index 1d7a48a2ec..17645667d8 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -114,24 +114,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
@@ -661,7 +661,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];
@@ -681,11 +681,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,
@@ -713,7 +713,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, };
@@ -725,7 +725,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);
@@ -751,7 +751,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",
@@ -772,7 +772,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) {
@@ -786,7 +786,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;
@@ -800,23 +800,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
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (5 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 6/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  7:19   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 8/9] tests: Rename PAGE_SIZE definitions Jiaxun Yang
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

To prevent collosion of definition, we discard PAGE_SIZE from
defined by libc and take QEMU's variable.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 accel/kvm/kvm-all.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 389eaace72..3feb17d965 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -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
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 8/9] tests: Rename PAGE_SIZE definitions
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (6 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2021-01-13  7:21   ` Thomas Huth
  2020-12-21  0:53 ` [PATCH 9/9] gitlab-ci: Add alpine to pipeline Jiaxun Yang
  2020-12-21  1:06 ` [PATCH 0/9] Alpine Linux build fix and CI pipeline no-reply
  9 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

Self defined PAGE_SIZE is frequently used in tests, to prevent
collosion of definition, we give PAGE_SIZE definitons reasonable
prefixs.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 tests/migration/stress.c            | 10 ++---
 tests/qtest/libqos/malloc-pc.c      |  4 +-
 tests/qtest/libqos/malloc-spapr.c   |  4 +-
 tests/qtest/m25p80-test.c           | 54 +++++++++++-----------
 tests/tcg/multiarch/system/memory.c |  6 +--
 tests/test-xbzrle.c                 | 70 ++++++++++++++---------------
 6 files changed, 74 insertions(+), 74 deletions(-)

diff --git a/tests/migration/stress.c b/tests/migration/stress.c
index de45e8e490..b7240a15c8 100644
--- a/tests/migration/stress.c
+++ b/tests/migration/stress.c
@@ -27,7 +27,7 @@
 
 const char *argv0;
 
-#define PAGE_SIZE 4096
+#define RAM_PAGE_SIZE 4096
 
 #ifndef CONFIG_GETTID
 static int gettid(void)
@@ -158,11 +158,11 @@ static unsigned long long now(void)
 
 static void stressone(unsigned long long ramsizeMB)
 {
-    size_t pagesPerMB = 1024 * 1024 / PAGE_SIZE;
+    size_t pagesPerMB = 1024 * 1024 / RAM_PAGE_SIZE;
     g_autofree char *ram = g_malloc(ramsizeMB * 1024 * 1024);
     char *ramptr;
     size_t i, j, k;
-    g_autofree char *data = g_malloc(PAGE_SIZE);
+    g_autofree char *data = g_malloc(RAM_PAGE_SIZE);
     char *dataptr;
     size_t nMB = 0;
     unsigned long long before, after;
@@ -174,7 +174,7 @@ static void stressone(unsigned long long ramsizeMB)
      * calloc instead :-) */
     memset(ram, 0xfe, ramsizeMB * 1024 * 1024);
 
-    if (random_bytes(data, PAGE_SIZE) < 0) {
+    if (random_bytes(data, RAM_PAGE_SIZE) < 0) {
         return;
     }
 
@@ -186,7 +186,7 @@ static void stressone(unsigned long long ramsizeMB)
         for (i = 0; i < ramsizeMB; i++, nMB++) {
             for (j = 0; j < pagesPerMB; j++) {
                 dataptr = data;
-                for (k = 0; k < PAGE_SIZE; k += sizeof(long long)) {
+                for (k = 0; k < RAM_PAGE_SIZE; k += sizeof(long long)) {
                     ramptr += sizeof(long long);
                     dataptr += sizeof(long long);
                     *(unsigned long long *)ramptr ^= *(unsigned long long *)dataptr;
diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c
index 16ff9609cc..f1e3b392a5 100644
--- a/tests/qtest/libqos/malloc-pc.c
+++ b/tests/qtest/libqos/malloc-pc.c
@@ -18,7 +18,7 @@
 
 #include "qemu-common.h"
 
-#define PAGE_SIZE (4096)
+#define ALLOC_PAGE_SIZE (4096)
 
 void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
 {
@@ -26,7 +26,7 @@ void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
     QFWCFG *fw_cfg = pc_fw_cfg_init(qts);
 
     ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE);
-    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), PAGE_SIZE);
+    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), ALLOC_PAGE_SIZE);
 
     /* clean-up */
     pc_fw_cfg_uninit(fw_cfg);
diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c
index 84862e4876..05b306c191 100644
--- a/tests/qtest/libqos/malloc-spapr.c
+++ b/tests/qtest/libqos/malloc-spapr.c
@@ -10,7 +10,7 @@
 
 #include "qemu-common.h"
 
-#define PAGE_SIZE 4096
+#define SPAPR_PAGE_SIZE 4096
 
 /* Memory must be a multiple of 256 MB,
  * so we have at least 256MB
@@ -19,5 +19,5 @@
 
 void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
 {
-    alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, PAGE_SIZE);
+    alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, SPAPR_PAGE_SIZE);
 }
diff --git a/tests/qtest/m25p80-test.c b/tests/qtest/m25p80-test.c
index 50c6b79fb3..f860cef5f0 100644
--- a/tests/qtest/m25p80-test.c
+++ b/tests/qtest/m25p80-test.c
@@ -62,7 +62,7 @@ enum {
 #define FLASH_JEDEC         0x20ba19  /* n25q256a */
 #define FLASH_SIZE          (32 * 1024 * 1024)
 
-#define PAGE_SIZE           256
+#define FLASH_PAGE_SIZE           256
 
 /*
  * Use an explicit bswap for the values read/wrote to the flash region
@@ -165,7 +165,7 @@ static void read_page(uint32_t addr, uint32_t *page)
     writel(ASPEED_FLASH_BASE, make_be32(addr));
 
     /* Continuous read are supported */
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         page[i] = make_be32(readl(ASPEED_FLASH_BASE));
     }
     spi_ctrl_stop_user();
@@ -178,15 +178,15 @@ static void read_page_mem(uint32_t addr, uint32_t *page)
     /* move out USER mode to use direct reads from the AHB bus */
     spi_ctrl_setmode(CTRL_READMODE, READ);
 
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         page[i] = make_be32(readl(ASPEED_FLASH_BASE + addr + i * 4));
     }
 }
 
 static void test_erase_sector(void)
 {
-    uint32_t some_page_addr = 0x600 * PAGE_SIZE;
-    uint32_t page[PAGE_SIZE / 4];
+    uint32_t some_page_addr = 0x600 * FLASH_PAGE_SIZE;
+    uint32_t page[FLASH_PAGE_SIZE / 4];
     int i;
 
     spi_conf(CONF_ENABLE_W0);
@@ -200,14 +200,14 @@ static void test_erase_sector(void)
 
     /* Previous page should be full of zeroes as backend is not
      * initialized */
-    read_page(some_page_addr - PAGE_SIZE, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    read_page(some_page_addr - FLASH_PAGE_SIZE, page);
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, 0x0);
     }
 
     /* But this one was erased */
     read_page(some_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, 0xffffffff);
     }
 
@@ -216,8 +216,8 @@ static void test_erase_sector(void)
 
 static void test_erase_all(void)
 {
-    uint32_t some_page_addr = 0x15000 * PAGE_SIZE;
-    uint32_t page[PAGE_SIZE / 4];
+    uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+    uint32_t page[FLASH_PAGE_SIZE / 4];
     int i;
 
     spi_conf(CONF_ENABLE_W0);
@@ -225,7 +225,7 @@ static void test_erase_all(void)
     /* Check some random page. Should be full of zeroes as backend is
      * not initialized */
     read_page(some_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, 0x0);
     }
 
@@ -236,7 +236,7 @@ static void test_erase_all(void)
 
     /* Recheck that some random page */
     read_page(some_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, 0xffffffff);
     }
 
@@ -245,9 +245,9 @@ static void test_erase_all(void)
 
 static void test_write_page(void)
 {
-    uint32_t my_page_addr = 0x14000 * PAGE_SIZE; /* beyond 16MB */
-    uint32_t some_page_addr = 0x15000 * PAGE_SIZE;
-    uint32_t page[PAGE_SIZE / 4];
+    uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */
+    uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+    uint32_t page[FLASH_PAGE_SIZE / 4];
     int i;
 
     spi_conf(CONF_ENABLE_W0);
@@ -259,20 +259,20 @@ static void test_write_page(void)
     writel(ASPEED_FLASH_BASE, make_be32(my_page_addr));
 
     /* Fill the page with its own addresses */
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         writel(ASPEED_FLASH_BASE, make_be32(my_page_addr + i * 4));
     }
     spi_ctrl_stop_user();
 
     /* Check what was written */
     read_page(my_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, my_page_addr + i * 4);
     }
 
     /* Check some other page. It should be full of 0xff */
     read_page(some_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, 0xffffffff);
     }
 
@@ -281,9 +281,9 @@ static void test_write_page(void)
 
 static void test_read_page_mem(void)
 {
-    uint32_t my_page_addr = 0x14000 * PAGE_SIZE; /* beyond 16MB */
-    uint32_t some_page_addr = 0x15000 * PAGE_SIZE;
-    uint32_t page[PAGE_SIZE / 4];
+    uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */
+    uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+    uint32_t page[FLASH_PAGE_SIZE / 4];
     int i;
 
     /* Enable 4BYTE mode for controller. This is should be strapped by
@@ -300,13 +300,13 @@ static void test_read_page_mem(void)
 
     /* Check what was written */
     read_page_mem(my_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, my_page_addr + i * 4);
     }
 
     /* Check some other page. It should be full of 0xff */
     read_page_mem(some_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, 0xffffffff);
     }
 
@@ -315,8 +315,8 @@ static void test_read_page_mem(void)
 
 static void test_write_page_mem(void)
 {
-    uint32_t my_page_addr = 0x15000 * PAGE_SIZE;
-    uint32_t page[PAGE_SIZE / 4];
+    uint32_t my_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+    uint32_t page[FLASH_PAGE_SIZE / 4];
     int i;
 
     /* Enable 4BYTE mode for controller. This is should be strapped by
@@ -334,14 +334,14 @@ static void test_write_page_mem(void)
     /* move out USER mode to use direct writes to the AHB bus */
     spi_ctrl_setmode(CTRL_WRITEMODE, PP);
 
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         writel(ASPEED_FLASH_BASE + my_page_addr + i * 4,
                make_be32(my_page_addr + i * 4));
     }
 
     /* Check what was written */
     read_page_mem(my_page_addr, page);
-    for (i = 0; i < PAGE_SIZE / 4; i++) {
+    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
         g_assert_cmphex(page[i], ==, my_page_addr + i * 4);
     }
 
diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c
index d124502d73..eb0ec6f8eb 100644
--- a/tests/tcg/multiarch/system/memory.c
+++ b/tests/tcg/multiarch/system/memory.c
@@ -20,12 +20,12 @@
 # error "Target does not specify CHECK_UNALIGNED"
 #endif
 
-#define PAGE_SIZE 4096             /* nominal 4k "pages" */
-#define TEST_SIZE (PAGE_SIZE * 4)  /* 4 pages */
+#define MEM_PAGE_SIZE 4096             /* nominal 4k "pages" */
+#define TEST_SIZE (MEM_PAGE_SIZE * 4)  /* 4 pages */
 
 #define ARRAY_SIZE(x) ((sizeof(x) / sizeof((x)[0])))
 
-__attribute__((aligned(PAGE_SIZE)))
+__attribute__((aligned(MEM_PAGE_SIZE)))
 static uint8_t test_data[TEST_SIZE];
 
 typedef void (*init_ufn) (int offset);
diff --git a/tests/test-xbzrle.c b/tests/test-xbzrle.c
index f5e08de91e..795d6f1cba 100644
--- a/tests/test-xbzrle.c
+++ b/tests/test-xbzrle.c
@@ -15,7 +15,7 @@
 #include "qemu/cutils.h"
 #include "../migration/xbzrle.h"
 
-#define PAGE_SIZE 4096
+#define XBZRLE_PAGE_SIZE 4096
 
 static void test_uleb(void)
 {
@@ -41,11 +41,11 @@ static void test_uleb(void)
 
 static void test_encode_decode_zero(void)
 {
-    uint8_t *buffer = g_malloc0(PAGE_SIZE);
-    uint8_t *compressed = g_malloc0(PAGE_SIZE);
+    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE);
     int i = 0;
     int dlen = 0;
-    int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006);
+    int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006);
 
     for (i = diff_len; i > 0; i--) {
         buffer[1000 + i] = i;
@@ -55,8 +55,8 @@ static void test_encode_decode_zero(void)
     buffer[1000 + diff_len + 5] = 105;
 
     /* encode zero page */
-    dlen = xbzrle_encode_buffer(buffer, buffer, PAGE_SIZE, compressed,
-                       PAGE_SIZE);
+    dlen = xbzrle_encode_buffer(buffer, buffer, XBZRLE_PAGE_SIZE, compressed,
+                       XBZRLE_PAGE_SIZE);
     g_assert(dlen == 0);
 
     g_free(buffer);
@@ -65,11 +65,11 @@ static void test_encode_decode_zero(void)
 
 static void test_encode_decode_unchanged(void)
 {
-    uint8_t *compressed = g_malloc0(PAGE_SIZE);
-    uint8_t *test = g_malloc0(PAGE_SIZE);
+    uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
     int i = 0;
     int dlen = 0;
-    int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006);
+    int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006);
 
     for (i = diff_len; i > 0; i--) {
         test[1000 + i] = i + 4;
@@ -79,8 +79,8 @@ static void test_encode_decode_unchanged(void)
     test[1000 + diff_len + 5] = 109;
 
     /* test unchanged buffer */
-    dlen = xbzrle_encode_buffer(test, test, PAGE_SIZE, compressed,
-                                PAGE_SIZE);
+    dlen = xbzrle_encode_buffer(test, test, XBZRLE_PAGE_SIZE, compressed,
+                                XBZRLE_PAGE_SIZE);
     g_assert(dlen == 0);
 
     g_free(test);
@@ -89,21 +89,21 @@ static void test_encode_decode_unchanged(void)
 
 static void test_encode_decode_1_byte(void)
 {
-    uint8_t *buffer = g_malloc0(PAGE_SIZE);
-    uint8_t *test = g_malloc0(PAGE_SIZE);
-    uint8_t *compressed = g_malloc(PAGE_SIZE);
+    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *compressed = g_malloc(XBZRLE_PAGE_SIZE);
     int dlen = 0, rc = 0;
     uint8_t buf[2];
 
-    test[PAGE_SIZE - 1] = 1;
+    test[XBZRLE_PAGE_SIZE - 1] = 1;
 
-    dlen = xbzrle_encode_buffer(buffer, test, PAGE_SIZE, compressed,
-                       PAGE_SIZE);
+    dlen = xbzrle_encode_buffer(buffer, test, XBZRLE_PAGE_SIZE, compressed,
+                       XBZRLE_PAGE_SIZE);
     g_assert(dlen == (uleb128_encode_small(&buf[0], 4095) + 2));
 
-    rc = xbzrle_decode_buffer(compressed, dlen, buffer, PAGE_SIZE);
-    g_assert(rc == PAGE_SIZE);
-    g_assert(memcmp(test, buffer, PAGE_SIZE) == 0);
+    rc = xbzrle_decode_buffer(compressed, dlen, buffer, XBZRLE_PAGE_SIZE);
+    g_assert(rc == XBZRLE_PAGE_SIZE);
+    g_assert(memcmp(test, buffer, XBZRLE_PAGE_SIZE) == 0);
 
     g_free(buffer);
     g_free(compressed);
@@ -112,18 +112,18 @@ static void test_encode_decode_1_byte(void)
 
 static void test_encode_decode_overflow(void)
 {
-    uint8_t *compressed = g_malloc0(PAGE_SIZE);
-    uint8_t *test = g_malloc0(PAGE_SIZE);
-    uint8_t *buffer = g_malloc0(PAGE_SIZE);
+    uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
     int i = 0, rc = 0;
 
-    for (i = 0; i < PAGE_SIZE / 2 - 1; i++) {
+    for (i = 0; i < XBZRLE_PAGE_SIZE / 2 - 1; i++) {
         test[i * 2] = 1;
     }
 
     /* encode overflow */
-    rc = xbzrle_encode_buffer(buffer, test, PAGE_SIZE, compressed,
-                              PAGE_SIZE);
+    rc = xbzrle_encode_buffer(buffer, test, XBZRLE_PAGE_SIZE, compressed,
+                              XBZRLE_PAGE_SIZE);
     g_assert(rc == -1);
 
     g_free(buffer);
@@ -133,13 +133,13 @@ static void test_encode_decode_overflow(void)
 
 static void encode_decode_range(void)
 {
-    uint8_t *buffer = g_malloc0(PAGE_SIZE);
-    uint8_t *compressed = g_malloc(PAGE_SIZE);
-    uint8_t *test = g_malloc0(PAGE_SIZE);
+    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
+    uint8_t *compressed = g_malloc(XBZRLE_PAGE_SIZE);
+    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
     int i = 0, rc = 0;
     int dlen = 0;
 
-    int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006);
+    int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006);
 
     for (i = diff_len; i > 0; i--) {
         buffer[1000 + i] = i;
@@ -153,12 +153,12 @@ static void encode_decode_range(void)
     test[1000 + diff_len + 5] = 109;
 
     /* test encode/decode */
-    dlen = xbzrle_encode_buffer(test, buffer, PAGE_SIZE, compressed,
-                                PAGE_SIZE);
+    dlen = xbzrle_encode_buffer(test, buffer, XBZRLE_PAGE_SIZE, compressed,
+                                XBZRLE_PAGE_SIZE);
 
-    rc = xbzrle_decode_buffer(compressed, dlen, test, PAGE_SIZE);
-    g_assert(rc < PAGE_SIZE);
-    g_assert(memcmp(test, buffer, PAGE_SIZE) == 0);
+    rc = xbzrle_decode_buffer(compressed, dlen, test, XBZRLE_PAGE_SIZE);
+    g_assert(rc < XBZRLE_PAGE_SIZE);
+    g_assert(memcmp(test, buffer, XBZRLE_PAGE_SIZE) == 0);
 
     g_free(buffer);
     g_free(compressed);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 9/9] gitlab-ci: Add alpine to pipeline
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (7 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 8/9] tests: Rename PAGE_SIZE definitions Jiaxun Yang
@ 2020-12-21  0:53 ` Jiaxun Yang
  2020-12-21  1:06 ` [PATCH 0/9] Alpine Linux build fix and CI pipeline no-reply
  9 siblings, 0 replies; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  0:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jiaxun Yang, Thomas Huth, Philippe Mathieu-Daudé,
	Alex Bennée, Wainer dos Santos Moschetta, Paolo Bonzini,
	Viktor Prutyanov, Kevin Wolf, Max Reitz, Fam Zheng,
	Laurent Vivier, David Gibson, Greg Kurz, Alistair Francis, kvm,
	qemu-block, qemu-ppc

We only run build test and check-acceptance as their are too many
failures in checks due to minor string mismatch.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 .gitlab-ci.d/containers.yml |  5 +++++
 .gitlab-ci.yml              | 23 +++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
index 892ca8d838..cc4390911d 100644
--- a/.gitlab-ci.d/containers.yml
+++ b/.gitlab-ci.d/containers.yml
@@ -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:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 98bff03b47..4794fa6289 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -67,6 +67,29 @@ include:
     - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP", "CANCEL")]' | xargs cat
     - 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:
+      - build
+
+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:
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/9] Alpine Linux build fix and CI pipeline
  2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
                   ` (8 preceding siblings ...)
  2020-12-21  0:53 ` [PATCH 9/9] gitlab-ci: Add alpine to pipeline Jiaxun Yang
@ 2020-12-21  1:06 ` no-reply
  2020-12-21  8:25   ` Jiaxun Yang
  9 siblings, 1 reply; 24+ messages in thread
From: no-reply @ 2020-12-21  1:06 UTC (permalink / raw)
  To: jiaxun.yang
  Cc: qemu-devel, kwolf, fam, thuth, kvm, viktor.prutyanov, lvivier,
	philmd, alistair, groug, wainersm, mreitz, qemu-ppc, pbonzini,
	qemu-block, alex.bennee, david

Patchew URL: https://patchew.org/QEMU/20201221005318.11866-1-jiaxun.yang@flygoat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20201221005318.11866-1-jiaxun.yang@flygoat.com
Subject: [PATCH 0/9] Alpine Linux build fix and CI pipeline

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com -> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com
Switched to a new branch 'test'
10095a9 gitlab-ci: Add alpine to pipeline
a177af3 tests: Rename PAGE_SIZE definitions
5fcb0ed accel/kvm: avoid using predefined PAGE_SIZE
e7febdf hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
ba307d5 elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
0ccf92b libvhost-user: Include poll.h instead of sys/poll.h
41a10db configure/meson: Only check sys/signal.h on non-Linux
0bcd2f2 configure: Add sys/timex.h to probe clk_adjtime
a16c7ff tests/docker: Add dockerfile for Alpine Linux

=== OUTPUT BEGIN ===
1/9 Checking commit a16c7ff7d859 (tests/docker: Add dockerfile for Alpine Linux)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#20: 
new file mode 100644

total: 0 errors, 1 warnings, 56 lines checked

Patch 1/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/9 Checking commit 0bcd2f2eae84 (configure: Add sys/timex.h to probe clk_adjtime)
3/9 Checking commit 41a10dbdc8da (configure/meson: Only check sys/signal.h on non-Linux)
4/9 Checking commit 0ccf92b8ec37 (libvhost-user: Include poll.h instead of sys/poll.h)
5/9 Checking commit ba307d5a51aa (elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE)
WARNING: line over 80 characters
#69: FILE: contrib/elf2dmp/main.c:284:
+        h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / ELF2DMP_PAGE_SIZE;

WARNING: line over 80 characters
#79: FILE: contrib/elf2dmp/main.c:291:
+    h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << ELF2DMP_PAGE_BITS;

total: 0 errors, 2 warnings, 70 lines checked

Patch 5/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/9 Checking commit e7febdf0b056 (hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE)
ERROR: code indent should never use tabs
#26: FILE: hw/block/nand.c:117:
+# define PAGE_START(page)^I(PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))$

ERROR: code indent should never use tabs
#46: FILE: hw/block/nand.c:134:
+# define NAND_PAGE_SIZE^I^I2048$

WARNING: line over 80 characters
#65: FILE: hw/block/nand.c:684:
+        mem_and(iobuf + (soff | off), s->io, MIN(s->iolen, NAND_PAGE_SIZE - off));

WARNING: line over 80 characters
#70: FILE: hw/block/nand.c:687:
+            mem_and(s->storage + (page << OOB_SHIFT), s->io + NAND_PAGE_SIZE - off,

total: 2 errors, 2 warnings, 120 lines checked

Patch 6/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/9 Checking commit 5fcb0ed1331a (accel/kvm: avoid using predefined PAGE_SIZE)
8/9 Checking commit a177af33938d (tests: Rename PAGE_SIZE definitions)
9/9 Checking commit 10095a92643d (gitlab-ci: Add alpine to pipeline)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201221005318.11866-1-jiaxun.yang@flygoat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/9] Alpine Linux build fix and CI pipeline
  2020-12-21  1:06 ` [PATCH 0/9] Alpine Linux build fix and CI pipeline no-reply
@ 2020-12-21  8:25   ` Jiaxun Yang
  2020-12-22 18:41     ` Wainer dos Santos Moschetta
  0 siblings, 1 reply; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-21  8:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, fam, thuth, kvm, viktor.prutyanov, lvivier, philmd,
	alistair, groug, wainersm, mreitz, qemu-ppc, pbonzini,
	qemu-block, alex.bennee, david



On Mon, Dec 21, 2020, at 9:06 AM, no-reply@patchew.org wrote:
> Patchew URL: 
> https://patchew.org/QEMU/20201221005318.11866-1-jiaxun.yang@flygoat.com/
> 
> 
> 
> Hi,
> 
> This series seems to have some coding style problems. See output below for
> more information:
> 
> Type: series
> Message-id: 20201221005318.11866-1-jiaxun.yang@flygoat.com
> Subject: [PATCH 0/9] Alpine Linux build fix and CI pipeline
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> git rev-parse base > /dev/null || exit 0
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> git config --local diff.algorithm histogram
> ./scripts/checkpatch.pl --mailback base..
> === TEST SCRIPT END ===
> 
> Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
> From https://github.com/patchew-project/qemu
>  * [new tag]         
> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com -> 
> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com
> Switched to a new branch 'test'
> 10095a9 gitlab-ci: Add alpine to pipeline
> a177af3 tests: Rename PAGE_SIZE definitions
> 5fcb0ed accel/kvm: avoid using predefined PAGE_SIZE
> e7febdf hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
> ba307d5 elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
> 0ccf92b libvhost-user: Include poll.h instead of sys/poll.h
> 41a10db configure/meson: Only check sys/signal.h on non-Linux
> 0bcd2f2 configure: Add sys/timex.h to probe clk_adjtime
> a16c7ff tests/docker: Add dockerfile for Alpine Linux
> 
> === OUTPUT BEGIN ===
> 1/9 Checking commit a16c7ff7d859 (tests/docker: Add dockerfile for Alpine Linux)
> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
> #20: 
> new file mode 100644
> 
> total: 0 errors, 1 warnings, 56 lines checked
> 
> Patch 1/9 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 2/9 Checking commit 0bcd2f2eae84 (configure: Add sys/timex.h to probe 
> clk_adjtime)
> 3/9 Checking commit 41a10dbdc8da (configure/meson: Only check 
> sys/signal.h on non-Linux)
> 4/9 Checking commit 0ccf92b8ec37 (libvhost-user: Include poll.h instead 
> of sys/poll.h)
> 5/9 Checking commit ba307d5a51aa (elf2dmp: Rename PAGE_SIZE to 
> ELF2DMP_PAGE_SIZE)
> WARNING: line over 80 characters
> #69: FILE: contrib/elf2dmp/main.c:284:
> +        h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / 
> ELF2DMP_PAGE_SIZE;
> 
> WARNING: line over 80 characters
> #79: FILE: contrib/elf2dmp/main.c:291:
> +    h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << 
> ELF2DMP_PAGE_BITS;
> 
> total: 0 errors, 2 warnings, 70 lines checked
> 
> Patch 5/9 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 6/9 Checking commit e7febdf0b056 (hw/block/nand: Rename PAGE_SIZE to 
> NAND_PAGE_SIZE)
> ERROR: code indent should never use tabs
> #26: FILE: hw/block/nand.c:117:
> +# define PAGE_START(page)^I(PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))$
> 
> ERROR: code indent should never use tabs
> #46: FILE: hw/block/nand.c:134:
> +# define NAND_PAGE_SIZE^I^I2048$
> 
> WARNING: line over 80 characters
> #65: FILE: hw/block/nand.c:684:
> +        mem_and(iobuf + (soff | off), s->io, MIN(s->iolen, 
> NAND_PAGE_SIZE - off));
> 
> WARNING: line over 80 characters
> #70: FILE: hw/block/nand.c:687:
> +            mem_and(s->storage + (page << OOB_SHIFT), s->io + 
> NAND_PAGE_SIZE - off,
> 
> total: 2 errors, 2 warnings, 120 lines checked
> 
> Patch 6/9 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 
> 7/9 Checking commit 5fcb0ed1331a (accel/kvm: avoid using predefined PAGE_SIZE)
> 8/9 Checking commit a177af33938d (tests: Rename PAGE_SIZE definitions)
> 9/9 Checking commit 10095a92643d (gitlab-ci: Add alpine to pipeline)
> === OUTPUT END ===
> 
> Test command exited with code: 1

All pre-existing errors.

> 
> 
> The full log is available at
> http://patchew.org/logs/20201221005318.11866-1-jiaxun.yang@flygoat.com/testing.checkpatch/?type=message.
> ---
> Email generated automatically by Patchew [https://patchew.org/].
> Please send your feedback to patchew-devel@redhat.com

-- 
- Jiaxun

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux
  2020-12-21  0:53 ` [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux Jiaxun Yang
@ 2020-12-22 18:37   ` Wainer dos Santos Moschetta
  0 siblings, 0 replies; 24+ messages in thread
From: Wainer dos Santos Moschetta @ 2020-12-22 18:37 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Thomas Huth, kvm, Viktor Prutyanov,
	Laurent Vivier, Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Max Reitz, qemu-ppc, Paolo Bonzini,
	qemu-block, Alex Bennée, David Gibson

Hi,

On 12/20/20 9:53 PM, Jiaxun Yang wrote:
> Alpine Linux[1] is a security-oriented, lightweight Linux distribution
> based on musl libc and busybox.
>
> It it popular among Docker guests and embedded applications.
>
> Adding it to test against different libc.
>
> [1]: https://alpinelinux.org/
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   tests/docker/dockerfiles/alpine.docker | 56 ++++++++++++++++++++++++++
>   1 file changed, 56 insertions(+)
>   create mode 100644 tests/docker/dockerfiles/alpine.docker

Unless one passes `NOUSER=1` as an argument (e.g. `make NOUSER=1 
docker-image-alpine`) then the image build is going to fail due to the 
lack of useradd command on the base Alpine image. See the error below. 
As a result do build inside the container will fail (e.g. `make 
docker-test-build@alpine`). Apparently this issue can be solved by 
installing the "shadow" package in the image.

Without applying the patches 02-08 the build will fail on Alpine (tested 
with `make docker-test-build@alpine`). Actually patch 08 did not apply 
on master tree (error: patch failed: tests/migration/stress.c:174) so I 
could not successfully build it in the container.

I suggest that you move the patch 01 later on this series, just after 
all build issues are fixed so that it can be built inside the container.

---

$ make docker-image-alpine
   BUILD   alpine
Trying to pull registry.gitlab.com/qemu-project/qemu/qemu/alpine...
   manifest unknown: manifest unknown
Error: unable to pull registry.gitlab.com/qemu-project/qemu/qemu/alpine: 
Error initializing source 
docker://registry.gitlab.com/qemu-project/qemu/qemu/alpine:latest: Error 
reading manifest latest in 
registry.gitlab.com/qemu-project/qemu/qemu/alpine: manifest unknown: 
manifest unknown
/bin/sh: useradd: not found
Error: error building at STEP "RUN id wmoschet 2>/dev/null || useradd -u 
1000 -U wmoschet": error while running runtime: exit status 127
Traceback (most recent call last):
   File "/home/wmoschet/src/qemu/tests/docker/docker.py", line 709, in 
<module>
     sys.exit(main())
   File "/home/wmoschet/src/qemu/tests/docker/docker.py", line 705, in main
     return args.cmdobj.run(args, argv)
   File "/home/wmoschet/src/qemu/tests/docker/docker.py", line 498, in run
     dkr.build_image(tag, docker_dir, dockerfile,
   File "/home/wmoschet/src/qemu/tests/docker/docker.py", line 353, in 
build_image
     self._do_check(build_args,
   File "/home/wmoschet/src/qemu/tests/docker/docker.py", line 244, in 
_do_check
     return subprocess.check_call(self._command + cmd, **kwargs)
   File "/usr/lib64/python3.9/subprocess.py", line 373, in check_call
     raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['podman', 'build', '-t', 
'qemu/alpine', '-f', '/tmp/docker_build063jqidd/tmpn9zbbxzu.docker', 
'--cache-from', 'registry.gitlab.com/qemu-project/qemu/qemu/alpine', 
'/tmp/docker_build063jqidd']' returned non-zero exit status 125.
make: *** [/home/wmoschet/src/qemu/tests/docker/Makefile.include:62: 
docker-image-alpine] Error 1
---

>
> diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
> new file mode 100644
> index 0000000000..a1b80f08d2
> --- /dev/null
> +++ b/tests/docker/dockerfiles/alpine.docker
> @@ -0,0 +1,56 @@
> +
> +FROM alpine:edge
> +
> +RUN apk update
> +RUN apk upgrade
> +
> +# Please keep this list sorted alphabetically
> +ENV PACKAGES \
> +	alsa-lib-dev \
> +	bash \
> +	bison \
> +	build-base \
> +	coreutils \
> +	curl-dev \
> +	flex \
> +	git \
> +	glib-dev \
> +	glib-static \
> +	gnutls-dev \
> +	gtk+3.0-dev \
> +	libaio-dev \
> +	libcap-dev \
> +	libcap-ng-dev \
> +	libjpeg-turbo-dev \
> +	libnfs-dev \
> +	libpng-dev \
> +	libseccomp-dev \
> +	libssh-dev \
> +	libusb-dev \
> +	libxml2-dev \
> +	linux-headers \
> +	lzo-dev \
> +	mesa-dev \
> +	mesa-egl \
> +	mesa-gbm \
> +	meson \
> +	ncurses-dev \
> +	ninja \
> +	paxmark \
> +	perl \
> +	pulseaudio-dev \
> +	python3 \
> +	py3-sphinx \
> +	snappy-dev \

To solve the problem I mentioned above:

diff --git a/tests/docker/dockerfiles/alpine.docker 
b/tests/docker/dockerfiles/alpine.docker
index a1b80f08d2..5be5198d00 100644
--- a/tests/docker/dockerfiles/alpine.docker
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -41,6 +41,7 @@ ENV PACKAGES \
         pulseaudio-dev \
         python3 \
         py3-sphinx \
+       shadow \
         snappy-dev \
         spice-dev \
         texinfo \

> +	spice-dev \
> +	texinfo \
> +	usbredir-dev \
> +	util-linux-dev \
> +	vde2-dev \
> +	virglrenderer-dev \
> +	vte3-dev \
> +	xfsprogs-dev \
> +	zlib-dev \
> +	zlib-static
> +
> +RUN apk add $PACKAGES


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/9] Alpine Linux build fix and CI pipeline
  2020-12-21  8:25   ` Jiaxun Yang
@ 2020-12-22 18:41     ` Wainer dos Santos Moschetta
  2020-12-23  0:54       ` Jiaxun Yang
  0 siblings, 1 reply; 24+ messages in thread
From: Wainer dos Santos Moschetta @ 2020-12-22 18:41 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel
  Cc: kwolf, fam, thuth, kvm, viktor.prutyanov, lvivier, alex.bennee,
	alistair, groug, mreitz, qemu-ppc, pbonzini, qemu-block, philmd,
	david

Hi,

On 12/21/20 5:25 AM, Jiaxun Yang wrote:
>
> On Mon, Dec 21, 2020, at 9:06 AM, no-reply@patchew.org wrote:
>> Patchew URL:
>> https://patchew.org/QEMU/20201221005318.11866-1-jiaxun.yang@flygoat.com/
>>
>>
>>
>> Hi,
>>
>> This series seems to have some coding style problems. See output below for
>> more information:
>>
>> Type: series
>> Message-id: 20201221005318.11866-1-jiaxun.yang@flygoat.com
>> Subject: [PATCH 0/9] Alpine Linux build fix and CI pipeline
>>
>> === TEST SCRIPT BEGIN ===
>> #!/bin/bash
>> git rev-parse base > /dev/null || exit 0
>> git config --local diff.renamelimit 0
>> git config --local diff.renames True
>> git config --local diff.algorithm histogram
>> ./scripts/checkpatch.pl --mailback base..
>> === TEST SCRIPT END ===
>>
>> Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
>>  From https://github.com/patchew-project/qemu
>>   * [new tag]
>> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com ->
>> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com
>> Switched to a new branch 'test'
>> 10095a9 gitlab-ci: Add alpine to pipeline
>> a177af3 tests: Rename PAGE_SIZE definitions
>> 5fcb0ed accel/kvm: avoid using predefined PAGE_SIZE
>> e7febdf hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
>> ba307d5 elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
>> 0ccf92b libvhost-user: Include poll.h instead of sys/poll.h
>> 41a10db configure/meson: Only check sys/signal.h on non-Linux
>> 0bcd2f2 configure: Add sys/timex.h to probe clk_adjtime
>> a16c7ff tests/docker: Add dockerfile for Alpine Linux
>>
>> === OUTPUT BEGIN ===
>> 1/9 Checking commit a16c7ff7d859 (tests/docker: Add dockerfile for Alpine Linux)
>> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
>> #20:
>> new file mode 100644
>>
>> total: 0 errors, 1 warnings, 56 lines checked
>>
>> Patch 1/9 has style problems, please review.  If any of these errors
>> are false positives report them to the maintainer, see
>> CHECKPATCH in MAINTAINERS.
>> 2/9 Checking commit 0bcd2f2eae84 (configure: Add sys/timex.h to probe
>> clk_adjtime)
>> 3/9 Checking commit 41a10dbdc8da (configure/meson: Only check
>> sys/signal.h on non-Linux)
>> 4/9 Checking commit 0ccf92b8ec37 (libvhost-user: Include poll.h instead
>> of sys/poll.h)
>> 5/9 Checking commit ba307d5a51aa (elf2dmp: Rename PAGE_SIZE to
>> ELF2DMP_PAGE_SIZE)
>> WARNING: line over 80 characters
>> #69: FILE: contrib/elf2dmp/main.c:284:
>> +        h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size /
>> ELF2DMP_PAGE_SIZE;
>>
>> WARNING: line over 80 characters
>> #79: FILE: contrib/elf2dmp/main.c:291:
>> +    h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages <<
>> ELF2DMP_PAGE_BITS;
>>
>> total: 0 errors, 2 warnings, 70 lines checked
>>
>> Patch 5/9 has style problems, please review.  If any of these errors
>> are false positives report them to the maintainer, see
>> CHECKPATCH in MAINTAINERS.
>> 6/9 Checking commit e7febdf0b056 (hw/block/nand: Rename PAGE_SIZE to
>> NAND_PAGE_SIZE)
>> ERROR: code indent should never use tabs
>> #26: FILE: hw/block/nand.c:117:
>> +# define PAGE_START(page)^I(PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))$
>>
>> ERROR: code indent should never use tabs
>> #46: FILE: hw/block/nand.c:134:
>> +# define NAND_PAGE_SIZE^I^I2048$
>>
>> WARNING: line over 80 characters
>> #65: FILE: hw/block/nand.c:684:
>> +        mem_and(iobuf + (soff | off), s->io, MIN(s->iolen,
>> NAND_PAGE_SIZE - off));
>>
>> WARNING: line over 80 characters
>> #70: FILE: hw/block/nand.c:687:
>> +            mem_and(s->storage + (page << OOB_SHIFT), s->io +
>> NAND_PAGE_SIZE - off,
>>
>> total: 2 errors, 2 warnings, 120 lines checked
>>
>> Patch 6/9 has style problems, please review.  If any of these errors
>> are false positives report them to the maintainer, see
>> CHECKPATCH in MAINTAINERS.
>>
>> 7/9 Checking commit 5fcb0ed1331a (accel/kvm: avoid using predefined PAGE_SIZE)
>> 8/9 Checking commit a177af33938d (tests: Rename PAGE_SIZE definitions)
>> 9/9 Checking commit 10095a92643d (gitlab-ci: Add alpine to pipeline)
>> === OUTPUT END ===
>>
>> Test command exited with code: 1
> All pre-existing errors.

Apparently some style errors were introduced by the patches 05 and 06.

- Wainer

>
>>
>> The full log is available at
>> http://patchew.org/logs/20201221005318.11866-1-jiaxun.yang@flygoat.com/testing.checkpatch/?type=message.
>> ---
>> Email generated automatically by Patchew [https://patchew.org/].
>> Please send your feedback to patchew-devel@redhat.com


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 0/9] Alpine Linux build fix and CI pipeline
  2020-12-22 18:41     ` Wainer dos Santos Moschetta
@ 2020-12-23  0:54       ` Jiaxun Yang
  0 siblings, 0 replies; 24+ messages in thread
From: Jiaxun Yang @ 2020-12-23  0:54 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta, qemu-devel
  Cc: kwolf, fam, thuth, kvm, viktor.prutyanov, lvivier, alex.bennee,
	alistair, groug, mreitz, qemu-ppc, Paolo Bonzini, qemu-block,
	Philippe Mathieu-Daudé,
	david



On Wed, Dec 23, 2020, at 2:41 AM, Wainer dos Santos Moschetta wrote:
> Hi,
> 
> On 12/21/20 5:25 AM, Jiaxun Yang wrote:
> >
> > On Mon, Dec 21, 2020, at 9:06 AM, no-reply@patchew.org wrote:
> >> Patchew URL:
> >> https://patchew.org/QEMU/20201221005318.11866-1-jiaxun.yang@flygoat.com/
> >>
> >>
> >>
> >> Hi,
> >>
> >> This series seems to have some coding style problems. See output below for
> >> more information:
> >>
> >> Type: series
> >> Message-id: 20201221005318.11866-1-jiaxun.yang@flygoat.com
> >> Subject: [PATCH 0/9] Alpine Linux build fix and CI pipeline
> >>
> >> === TEST SCRIPT BEGIN ===
> >> #!/bin/bash
> >> git rev-parse base > /dev/null || exit 0
> >> git config --local diff.renamelimit 0
> >> git config --local diff.renames True
> >> git config --local diff.algorithm histogram
> >> ./scripts/checkpatch.pl --mailback base..
> >> === TEST SCRIPT END ===
> >>
> >> Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
> >>  From https://github.com/patchew-project/qemu
> >>   * [new tag]
> >> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com ->
> >> patchew/20201221005318.11866-1-jiaxun.yang@flygoat.com
> >> Switched to a new branch 'test'
> >> 10095a9 gitlab-ci: Add alpine to pipeline
> >> a177af3 tests: Rename PAGE_SIZE definitions
> >> 5fcb0ed accel/kvm: avoid using predefined PAGE_SIZE
> >> e7febdf hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
> >> ba307d5 elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
> >> 0ccf92b libvhost-user: Include poll.h instead of sys/poll.h
> >> 41a10db configure/meson: Only check sys/signal.h on non-Linux
> >> 0bcd2f2 configure: Add sys/timex.h to probe clk_adjtime
> >> a16c7ff tests/docker: Add dockerfile for Alpine Linux
> >>
> >> === OUTPUT BEGIN ===
> >> 1/9 Checking commit a16c7ff7d859 (tests/docker: Add dockerfile for Alpine Linux)
> >> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
> >> #20:
> >> new file mode 100644
> >>
> >> total: 0 errors, 1 warnings, 56 lines checked
> >>
> >> Patch 1/9 has style problems, please review.  If any of these errors
> >> are false positives report them to the maintainer, see
> >> CHECKPATCH in MAINTAINERS.
> >> 2/9 Checking commit 0bcd2f2eae84 (configure: Add sys/timex.h to probe
> >> clk_adjtime)
> >> 3/9 Checking commit 41a10dbdc8da (configure/meson: Only check
> >> sys/signal.h on non-Linux)
> >> 4/9 Checking commit 0ccf92b8ec37 (libvhost-user: Include poll.h instead
> >> of sys/poll.h)
> >> 5/9 Checking commit ba307d5a51aa (elf2dmp: Rename PAGE_SIZE to
> >> ELF2DMP_PAGE_SIZE)
> >> WARNING: line over 80 characters
> >> #69: FILE: contrib/elf2dmp/main.c:284:
> >> +        h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size /
> >> ELF2DMP_PAGE_SIZE;
> >>
> >> WARNING: line over 80 characters
> >> #79: FILE: contrib/elf2dmp/main.c:291:
> >> +    h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages <<
> >> ELF2DMP_PAGE_BITS;
> >>
> >> total: 0 errors, 2 warnings, 70 lines checked
> >>
> >> Patch 5/9 has style problems, please review.  If any of these errors
> >> are false positives report them to the maintainer, see
> >> CHECKPATCH in MAINTAINERS.
> >> 6/9 Checking commit e7febdf0b056 (hw/block/nand: Rename PAGE_SIZE to
> >> NAND_PAGE_SIZE)
> >> ERROR: code indent should never use tabs
> >> #26: FILE: hw/block/nand.c:117:
> >> +# define PAGE_START(page)^I(PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE))$
> >>
> >> ERROR: code indent should never use tabs
> >> #46: FILE: hw/block/nand.c:134:
> >> +# define NAND_PAGE_SIZE^I^I2048$
> >>
> >> WARNING: line over 80 characters
> >> #65: FILE: hw/block/nand.c:684:
> >> +        mem_and(iobuf + (soff | off), s->io, MIN(s->iolen,
> >> NAND_PAGE_SIZE - off));
> >>
> >> WARNING: line over 80 characters
> >> #70: FILE: hw/block/nand.c:687:
> >> +            mem_and(s->storage + (page << OOB_SHIFT), s->io +
> >> NAND_PAGE_SIZE - off,
> >>
> >> total: 2 errors, 2 warnings, 120 lines checked
> >>
> >> Patch 6/9 has style problems, please review.  If any of these errors
> >> are false positives report them to the maintainer, see
> >> CHECKPATCH in MAINTAINERS.
> >>
> >> 7/9 Checking commit 5fcb0ed1331a (accel/kvm: avoid using predefined PAGE_SIZE)
> >> 8/9 Checking commit a177af33938d (tests: Rename PAGE_SIZE definitions)
> >> 9/9 Checking commit 10095a92643d (gitlab-ci: Add alpine to pipeline)
> >> === OUTPUT END ===
> >>
> >> Test command exited with code: 1
> > All pre-existing errors.
> 
> Apparently some style errors were introduced by the patches 05 and 06.

I'm just doing string replacement, should I add a patch separately to fix existing issues than replace the string?

Thanks.

> 
> - Wainer
> 
> >
> >>
> >> The full log is available at
> >> http://patchew.org/logs/20201221005318.11866-1-jiaxun.yang@flygoat.com/testing.checkpatch/?type=message.
> >> ---
> >> Email generated automatically by Patchew [https://patchew.org/].
> >> Please send your feedback to patchew-devel@redhat.com
> 
>

-- 
- Jiaxun

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/9] configure: Add sys/timex.h to probe clk_adjtime
  2020-12-21  0:53 ` [PATCH 2/9] configure: Add sys/timex.h to probe clk_adjtime Jiaxun Yang
@ 2021-01-13  6:59   ` Thomas Huth
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  6:59 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel, QEMU Trivial
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson, John Snow


In the subject:

s/clk_adjtime/clock_adjtime/

On 21/12/2020 01.53, Jiaxun Yang wrote:
> It is not a part of standard time.h. Glibc put it under
> time.h however musl treat it as a sys timex extension.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   configure | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index c228f7c21e..990f37e123 100755
> --- a/configure
> +++ b/configure
> @@ -4374,6 +4374,7 @@ fi
>   clock_adjtime=no
>   cat > $TMPC <<EOF
>   #include <time.h>
> +#include <sys/timex.h>
>   
>   int main(void)
>   {
> 

According to the man page:

  http://www.tin.org/bin/man.cgi?section=2&topic=clock_adjtime

sys/timex.h is indeed the right header here.

Reviewed-by: Thomas Huth <thuth@redhat.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux
  2020-12-21  0:53 ` [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux Jiaxun Yang
@ 2021-01-13  7:05   ` Thomas Huth
  2021-01-13 11:36     ` Peter Maydell
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  7:05 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel, QEMU Trivial
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson

On 21/12/2020 01.53, Jiaxun Yang wrote:
> signal.h is equlevant of sys/signal.h on Linux, musl would complain
> wrong usage of sys/signal.h.
> 
> In file included from /builds/FlyGoat/qemu/include/qemu/osdep.h:108,
>                   from ../tests/qemu-iotests/socket_scm_helper.c:13:
> /usr/include/sys/signal.h:1:2: error: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Werror=cpp]
>      1 | #warning redirecting incorrect #include <sys/signal.h> to <signal.h>
>        |  ^~~~~~~
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   meson.build | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 372576f82c..1ef8722b3a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -841,7 +841,10 @@ 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'))
> +if targetos != 'linux'
> +  # signal.h is equlevant of sys/signal.h on Linux
> +  config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
> +endif

Seems like it sys/signal.h was introduced for OpenBSD once (see commit 
128ab2ff50a), so this new check should be fine.

Reviewed-by: Thomas Huth <thuth@redhat.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/9] libvhost-user: Include poll.h instead of sys/poll.h
  2020-12-21  0:53 ` [PATCH 4/9] libvhost-user: Include poll.h instead of sys/poll.h Jiaxun Yang
@ 2021-01-13  7:08   ` Thomas Huth
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  7:08 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel, QEMU Trivial
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson, Marc-André Lureau, Stefan Hajnoczi

On 21/12/2020 01.53, Jiaxun Yang wrote:
> Musl libc complains about it's wrong usage.
> 
> In file included from ../subprojects/libvhost-user/libvhost-user.h:20,
>                   from ../subprojects/libvhost-user/libvhost-user-glib.h:19,
>                   from ../subprojects/libvhost-user/libvhost-user-glib.c:15:
> /usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
>      1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
>        |  ^~~~~~~
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   subprojects/libvhost-user/libvhost-user.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h
> index 7d47f1364a..3d13dfadde 100644
> --- a/subprojects/libvhost-user/libvhost-user.h
> +++ b/subprojects/libvhost-user/libvhost-user.h
> @@ -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"
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
  2020-12-21  0:53 ` [PATCH 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE Jiaxun Yang
@ 2021-01-13  7:14   ` Thomas Huth
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  7:14 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel, QEMU Trivial
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson, Viktor Prutyanov

On 21/12/2020 01.53, Jiaxun Yang wrote:
> As per POSIX specification of limits.h [1], OS libc may define
> PAGE_SIZE in limits.h.
> 
> To prevent collosion of definition, we rename PAGE_SIZE here.
> 
> [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   contrib/elf2dmp/addrspace.c |  4 ++--
>   contrib/elf2dmp/addrspace.h |  6 +++---
>   contrib/elf2dmp/main.c      | 18 +++++++++---------
>   3 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/contrib/elf2dmp/addrspace.c b/contrib/elf2dmp/addrspace.c
> index 8a76069cb5..53ded17061 100644
> --- a/contrib/elf2dmp/addrspace.c
> +++ b/contrib/elf2dmp/addrspace.c
> @@ -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;
> diff --git a/contrib/elf2dmp/addrspace.h b/contrib/elf2dmp/addrspace.h
> index d87f6a18c6..00b44c1218 100644
> --- a/contrib/elf2dmp/addrspace.h
> +++ b/contrib/elf2dmp/addrspace.h
> @@ -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
>   
> diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
> index ac746e49e0..20b477d582 100644
> --- a/contrib/elf2dmp/main.c
> +++ b/contrib/elf2dmp/main.c
> @@ -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;
> @@ -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;
>   
> @@ -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;
> @@ -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;
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 6/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE
  2020-12-21  0:53 ` [PATCH 6/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE Jiaxun Yang
@ 2021-01-13  7:16   ` Thomas Huth
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  7:16 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel, QEMU Trivial
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson

On 21/12/2020 01.53, Jiaxun Yang wrote:
> As per POSIX specification of limits.h [1], OS libc may define
> PAGE_SIZE in limits.h.
> 
> To prevent collosion of definition, we rename PAGE_SIZE here.
> 
> [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   hw/block/nand.c | 40 ++++++++++++++++++++--------------------
>   1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/hw/block/nand.c b/hw/block/nand.c
> index 1d7a48a2ec..17645667d8 100644
> --- a/hw/block/nand.c
> +++ b/hw/block/nand.c
> @@ -114,24 +114,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
> @@ -661,7 +661,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];
> @@ -681,11 +681,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,
> @@ -713,7 +713,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, };
> @@ -725,7 +725,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);
> @@ -751,7 +751,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",
> @@ -772,7 +772,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) {
> @@ -786,7 +786,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;
> @@ -800,23 +800,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
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE
  2020-12-21  0:53 ` [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE Jiaxun Yang
@ 2021-01-13  7:19   ` Thomas Huth
  2021-01-13  9:07     ` Jiaxun Yang
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  7:19 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson

On 21/12/2020 01.53, Jiaxun Yang wrote:
> As per POSIX specification of limits.h [1], OS libc may define
> PAGE_SIZE in limits.h.
> 
> To prevent collosion of definition, we discard PAGE_SIZE from
> defined by libc and take QEMU's variable.
> 
> [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   accel/kvm/kvm-all.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 389eaace72..3feb17d965 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -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

If I get that right, the PAGE_SIZE macro is only used one time in this 
file... so it's maybe easier to get rid of the macro completely and replace 
the single occurance with qemu_real_host_page_size directly?

  Thomas


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 8/9] tests: Rename PAGE_SIZE definitions
  2020-12-21  0:53 ` [PATCH 8/9] tests: Rename PAGE_SIZE definitions Jiaxun Yang
@ 2021-01-13  7:21   ` Thomas Huth
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2021-01-13  7:21 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson

On 21/12/2020 01.53, Jiaxun Yang wrote:
> As per POSIX specification of limits.h [1], OS libc may define
> PAGE_SIZE in limits.h.
> 
> Self defined PAGE_SIZE is frequently used in tests, to prevent
> collosion of definition, we give PAGE_SIZE definitons reasonable
> prefixs.
> 
> [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   tests/migration/stress.c            | 10 ++---
>   tests/qtest/libqos/malloc-pc.c      |  4 +-
>   tests/qtest/libqos/malloc-spapr.c   |  4 +-
>   tests/qtest/m25p80-test.c           | 54 +++++++++++-----------
>   tests/tcg/multiarch/system/memory.c |  6 +--
>   tests/test-xbzrle.c                 | 70 ++++++++++++++---------------
>   6 files changed, 74 insertions(+), 74 deletions(-)
> 
> diff --git a/tests/migration/stress.c b/tests/migration/stress.c
> index de45e8e490..b7240a15c8 100644
> --- a/tests/migration/stress.c
> +++ b/tests/migration/stress.c
> @@ -27,7 +27,7 @@
>   
>   const char *argv0;
>   
> -#define PAGE_SIZE 4096
> +#define RAM_PAGE_SIZE 4096
>   
>   #ifndef CONFIG_GETTID
>   static int gettid(void)
> @@ -158,11 +158,11 @@ static unsigned long long now(void)
>   
>   static void stressone(unsigned long long ramsizeMB)
>   {
> -    size_t pagesPerMB = 1024 * 1024 / PAGE_SIZE;
> +    size_t pagesPerMB = 1024 * 1024 / RAM_PAGE_SIZE;
>       g_autofree char *ram = g_malloc(ramsizeMB * 1024 * 1024);
>       char *ramptr;
>       size_t i, j, k;
> -    g_autofree char *data = g_malloc(PAGE_SIZE);
> +    g_autofree char *data = g_malloc(RAM_PAGE_SIZE);
>       char *dataptr;
>       size_t nMB = 0;
>       unsigned long long before, after;
> @@ -174,7 +174,7 @@ static void stressone(unsigned long long ramsizeMB)
>        * calloc instead :-) */
>       memset(ram, 0xfe, ramsizeMB * 1024 * 1024);
>   
> -    if (random_bytes(data, PAGE_SIZE) < 0) {
> +    if (random_bytes(data, RAM_PAGE_SIZE) < 0) {
>           return;
>       }
>   
> @@ -186,7 +186,7 @@ static void stressone(unsigned long long ramsizeMB)
>           for (i = 0; i < ramsizeMB; i++, nMB++) {
>               for (j = 0; j < pagesPerMB; j++) {
>                   dataptr = data;
> -                for (k = 0; k < PAGE_SIZE; k += sizeof(long long)) {
> +                for (k = 0; k < RAM_PAGE_SIZE; k += sizeof(long long)) {
>                       ramptr += sizeof(long long);
>                       dataptr += sizeof(long long);
>                       *(unsigned long long *)ramptr ^= *(unsigned long long *)dataptr;
> diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c
> index 16ff9609cc..f1e3b392a5 100644
> --- a/tests/qtest/libqos/malloc-pc.c
> +++ b/tests/qtest/libqos/malloc-pc.c
> @@ -18,7 +18,7 @@
>   
>   #include "qemu-common.h"
>   
> -#define PAGE_SIZE (4096)
> +#define ALLOC_PAGE_SIZE (4096)
>   
>   void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
>   {
> @@ -26,7 +26,7 @@ void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
>       QFWCFG *fw_cfg = pc_fw_cfg_init(qts);
>   
>       ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE);
> -    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), PAGE_SIZE);
> +    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), ALLOC_PAGE_SIZE);
>   
>       /* clean-up */
>       pc_fw_cfg_uninit(fw_cfg);
> diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c
> index 84862e4876..05b306c191 100644
> --- a/tests/qtest/libqos/malloc-spapr.c
> +++ b/tests/qtest/libqos/malloc-spapr.c
> @@ -10,7 +10,7 @@
>   
>   #include "qemu-common.h"
>   
> -#define PAGE_SIZE 4096
> +#define SPAPR_PAGE_SIZE 4096
>   
>   /* Memory must be a multiple of 256 MB,
>    * so we have at least 256MB
> @@ -19,5 +19,5 @@
>   
>   void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
>   {
> -    alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, PAGE_SIZE);
> +    alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, SPAPR_PAGE_SIZE);
>   }
> diff --git a/tests/qtest/m25p80-test.c b/tests/qtest/m25p80-test.c
> index 50c6b79fb3..f860cef5f0 100644
> --- a/tests/qtest/m25p80-test.c
> +++ b/tests/qtest/m25p80-test.c
> @@ -62,7 +62,7 @@ enum {
>   #define FLASH_JEDEC         0x20ba19  /* n25q256a */
>   #define FLASH_SIZE          (32 * 1024 * 1024)
>   
> -#define PAGE_SIZE           256
> +#define FLASH_PAGE_SIZE           256
>   
>   /*
>    * Use an explicit bswap for the values read/wrote to the flash region
> @@ -165,7 +165,7 @@ static void read_page(uint32_t addr, uint32_t *page)
>       writel(ASPEED_FLASH_BASE, make_be32(addr));
>   
>       /* Continuous read are supported */
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           page[i] = make_be32(readl(ASPEED_FLASH_BASE));
>       }
>       spi_ctrl_stop_user();
> @@ -178,15 +178,15 @@ static void read_page_mem(uint32_t addr, uint32_t *page)
>       /* move out USER mode to use direct reads from the AHB bus */
>       spi_ctrl_setmode(CTRL_READMODE, READ);
>   
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           page[i] = make_be32(readl(ASPEED_FLASH_BASE + addr + i * 4));
>       }
>   }
>   
>   static void test_erase_sector(void)
>   {
> -    uint32_t some_page_addr = 0x600 * PAGE_SIZE;
> -    uint32_t page[PAGE_SIZE / 4];
> +    uint32_t some_page_addr = 0x600 * FLASH_PAGE_SIZE;
> +    uint32_t page[FLASH_PAGE_SIZE / 4];
>       int i;
>   
>       spi_conf(CONF_ENABLE_W0);
> @@ -200,14 +200,14 @@ static void test_erase_sector(void)
>   
>       /* Previous page should be full of zeroes as backend is not
>        * initialized */
> -    read_page(some_page_addr - PAGE_SIZE, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    read_page(some_page_addr - FLASH_PAGE_SIZE, page);
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, 0x0);
>       }
>   
>       /* But this one was erased */
>       read_page(some_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, 0xffffffff);
>       }
>   
> @@ -216,8 +216,8 @@ static void test_erase_sector(void)
>   
>   static void test_erase_all(void)
>   {
> -    uint32_t some_page_addr = 0x15000 * PAGE_SIZE;
> -    uint32_t page[PAGE_SIZE / 4];
> +    uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
> +    uint32_t page[FLASH_PAGE_SIZE / 4];
>       int i;
>   
>       spi_conf(CONF_ENABLE_W0);
> @@ -225,7 +225,7 @@ static void test_erase_all(void)
>       /* Check some random page. Should be full of zeroes as backend is
>        * not initialized */
>       read_page(some_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, 0x0);
>       }
>   
> @@ -236,7 +236,7 @@ static void test_erase_all(void)
>   
>       /* Recheck that some random page */
>       read_page(some_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, 0xffffffff);
>       }
>   
> @@ -245,9 +245,9 @@ static void test_erase_all(void)
>   
>   static void test_write_page(void)
>   {
> -    uint32_t my_page_addr = 0x14000 * PAGE_SIZE; /* beyond 16MB */
> -    uint32_t some_page_addr = 0x15000 * PAGE_SIZE;
> -    uint32_t page[PAGE_SIZE / 4];
> +    uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */
> +    uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
> +    uint32_t page[FLASH_PAGE_SIZE / 4];
>       int i;
>   
>       spi_conf(CONF_ENABLE_W0);
> @@ -259,20 +259,20 @@ static void test_write_page(void)
>       writel(ASPEED_FLASH_BASE, make_be32(my_page_addr));
>   
>       /* Fill the page with its own addresses */
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           writel(ASPEED_FLASH_BASE, make_be32(my_page_addr + i * 4));
>       }
>       spi_ctrl_stop_user();
>   
>       /* Check what was written */
>       read_page(my_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, my_page_addr + i * 4);
>       }
>   
>       /* Check some other page. It should be full of 0xff */
>       read_page(some_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, 0xffffffff);
>       }
>   
> @@ -281,9 +281,9 @@ static void test_write_page(void)
>   
>   static void test_read_page_mem(void)
>   {
> -    uint32_t my_page_addr = 0x14000 * PAGE_SIZE; /* beyond 16MB */
> -    uint32_t some_page_addr = 0x15000 * PAGE_SIZE;
> -    uint32_t page[PAGE_SIZE / 4];
> +    uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */
> +    uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
> +    uint32_t page[FLASH_PAGE_SIZE / 4];
>       int i;
>   
>       /* Enable 4BYTE mode for controller. This is should be strapped by
> @@ -300,13 +300,13 @@ static void test_read_page_mem(void)
>   
>       /* Check what was written */
>       read_page_mem(my_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, my_page_addr + i * 4);
>       }
>   
>       /* Check some other page. It should be full of 0xff */
>       read_page_mem(some_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, 0xffffffff);
>       }
>   
> @@ -315,8 +315,8 @@ static void test_read_page_mem(void)
>   
>   static void test_write_page_mem(void)
>   {
> -    uint32_t my_page_addr = 0x15000 * PAGE_SIZE;
> -    uint32_t page[PAGE_SIZE / 4];
> +    uint32_t my_page_addr = 0x15000 * FLASH_PAGE_SIZE;
> +    uint32_t page[FLASH_PAGE_SIZE / 4];
>       int i;
>   
>       /* Enable 4BYTE mode for controller. This is should be strapped by
> @@ -334,14 +334,14 @@ static void test_write_page_mem(void)
>       /* move out USER mode to use direct writes to the AHB bus */
>       spi_ctrl_setmode(CTRL_WRITEMODE, PP);
>   
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           writel(ASPEED_FLASH_BASE + my_page_addr + i * 4,
>                  make_be32(my_page_addr + i * 4));
>       }
>   
>       /* Check what was written */
>       read_page_mem(my_page_addr, page);
> -    for (i = 0; i < PAGE_SIZE / 4; i++) {
> +    for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) {
>           g_assert_cmphex(page[i], ==, my_page_addr + i * 4);
>       }
>   
> diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c
> index d124502d73..eb0ec6f8eb 100644
> --- a/tests/tcg/multiarch/system/memory.c
> +++ b/tests/tcg/multiarch/system/memory.c
> @@ -20,12 +20,12 @@
>   # error "Target does not specify CHECK_UNALIGNED"
>   #endif
>   
> -#define PAGE_SIZE 4096             /* nominal 4k "pages" */
> -#define TEST_SIZE (PAGE_SIZE * 4)  /* 4 pages */
> +#define MEM_PAGE_SIZE 4096             /* nominal 4k "pages" */
> +#define TEST_SIZE (MEM_PAGE_SIZE * 4)  /* 4 pages */
>   
>   #define ARRAY_SIZE(x) ((sizeof(x) / sizeof((x)[0])))
>   
> -__attribute__((aligned(PAGE_SIZE)))
> +__attribute__((aligned(MEM_PAGE_SIZE)))
>   static uint8_t test_data[TEST_SIZE];
>   
>   typedef void (*init_ufn) (int offset);
> diff --git a/tests/test-xbzrle.c b/tests/test-xbzrle.c
> index f5e08de91e..795d6f1cba 100644
> --- a/tests/test-xbzrle.c
> +++ b/tests/test-xbzrle.c
> @@ -15,7 +15,7 @@
>   #include "qemu/cutils.h"
>   #include "../migration/xbzrle.h"
>   
> -#define PAGE_SIZE 4096
> +#define XBZRLE_PAGE_SIZE 4096
>   
>   static void test_uleb(void)
>   {
> @@ -41,11 +41,11 @@ static void test_uleb(void)
>   
>   static void test_encode_decode_zero(void)
>   {
> -    uint8_t *buffer = g_malloc0(PAGE_SIZE);
> -    uint8_t *compressed = g_malloc0(PAGE_SIZE);
> +    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE);
>       int i = 0;
>       int dlen = 0;
> -    int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006);
> +    int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006);
>   
>       for (i = diff_len; i > 0; i--) {
>           buffer[1000 + i] = i;
> @@ -55,8 +55,8 @@ static void test_encode_decode_zero(void)
>       buffer[1000 + diff_len + 5] = 105;
>   
>       /* encode zero page */
> -    dlen = xbzrle_encode_buffer(buffer, buffer, PAGE_SIZE, compressed,
> -                       PAGE_SIZE);
> +    dlen = xbzrle_encode_buffer(buffer, buffer, XBZRLE_PAGE_SIZE, compressed,
> +                       XBZRLE_PAGE_SIZE);
>       g_assert(dlen == 0);
>   
>       g_free(buffer);
> @@ -65,11 +65,11 @@ static void test_encode_decode_zero(void)
>   
>   static void test_encode_decode_unchanged(void)
>   {
> -    uint8_t *compressed = g_malloc0(PAGE_SIZE);
> -    uint8_t *test = g_malloc0(PAGE_SIZE);
> +    uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
>       int i = 0;
>       int dlen = 0;
> -    int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006);
> +    int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006);
>   
>       for (i = diff_len; i > 0; i--) {
>           test[1000 + i] = i + 4;
> @@ -79,8 +79,8 @@ static void test_encode_decode_unchanged(void)
>       test[1000 + diff_len + 5] = 109;
>   
>       /* test unchanged buffer */
> -    dlen = xbzrle_encode_buffer(test, test, PAGE_SIZE, compressed,
> -                                PAGE_SIZE);
> +    dlen = xbzrle_encode_buffer(test, test, XBZRLE_PAGE_SIZE, compressed,
> +                                XBZRLE_PAGE_SIZE);
>       g_assert(dlen == 0);
>   
>       g_free(test);
> @@ -89,21 +89,21 @@ static void test_encode_decode_unchanged(void)
>   
>   static void test_encode_decode_1_byte(void)
>   {
> -    uint8_t *buffer = g_malloc0(PAGE_SIZE);
> -    uint8_t *test = g_malloc0(PAGE_SIZE);
> -    uint8_t *compressed = g_malloc(PAGE_SIZE);
> +    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *compressed = g_malloc(XBZRLE_PAGE_SIZE);
>       int dlen = 0, rc = 0;
>       uint8_t buf[2];
>   
> -    test[PAGE_SIZE - 1] = 1;
> +    test[XBZRLE_PAGE_SIZE - 1] = 1;
>   
> -    dlen = xbzrle_encode_buffer(buffer, test, PAGE_SIZE, compressed,
> -                       PAGE_SIZE);
> +    dlen = xbzrle_encode_buffer(buffer, test, XBZRLE_PAGE_SIZE, compressed,
> +                       XBZRLE_PAGE_SIZE);
>       g_assert(dlen == (uleb128_encode_small(&buf[0], 4095) + 2));
>   
> -    rc = xbzrle_decode_buffer(compressed, dlen, buffer, PAGE_SIZE);
> -    g_assert(rc == PAGE_SIZE);
> -    g_assert(memcmp(test, buffer, PAGE_SIZE) == 0);
> +    rc = xbzrle_decode_buffer(compressed, dlen, buffer, XBZRLE_PAGE_SIZE);
> +    g_assert(rc == XBZRLE_PAGE_SIZE);
> +    g_assert(memcmp(test, buffer, XBZRLE_PAGE_SIZE) == 0);
>   
>       g_free(buffer);
>       g_free(compressed);
> @@ -112,18 +112,18 @@ static void test_encode_decode_1_byte(void)
>   
>   static void test_encode_decode_overflow(void)
>   {
> -    uint8_t *compressed = g_malloc0(PAGE_SIZE);
> -    uint8_t *test = g_malloc0(PAGE_SIZE);
> -    uint8_t *buffer = g_malloc0(PAGE_SIZE);
> +    uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
>       int i = 0, rc = 0;
>   
> -    for (i = 0; i < PAGE_SIZE / 2 - 1; i++) {
> +    for (i = 0; i < XBZRLE_PAGE_SIZE / 2 - 1; i++) {
>           test[i * 2] = 1;
>       }
>   
>       /* encode overflow */
> -    rc = xbzrle_encode_buffer(buffer, test, PAGE_SIZE, compressed,
> -                              PAGE_SIZE);
> +    rc = xbzrle_encode_buffer(buffer, test, XBZRLE_PAGE_SIZE, compressed,
> +                              XBZRLE_PAGE_SIZE);
>       g_assert(rc == -1);
>   
>       g_free(buffer);
> @@ -133,13 +133,13 @@ static void test_encode_decode_overflow(void)
>   
>   static void encode_decode_range(void)
>   {
> -    uint8_t *buffer = g_malloc0(PAGE_SIZE);
> -    uint8_t *compressed = g_malloc(PAGE_SIZE);
> -    uint8_t *test = g_malloc0(PAGE_SIZE);
> +    uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE);
> +    uint8_t *compressed = g_malloc(XBZRLE_PAGE_SIZE);
> +    uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE);
>       int i = 0, rc = 0;
>       int dlen = 0;
>   
> -    int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006);
> +    int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006);
>   
>       for (i = diff_len; i > 0; i--) {
>           buffer[1000 + i] = i;
> @@ -153,12 +153,12 @@ static void encode_decode_range(void)
>       test[1000 + diff_len + 5] = 109;
>   
>       /* test encode/decode */
> -    dlen = xbzrle_encode_buffer(test, buffer, PAGE_SIZE, compressed,
> -                                PAGE_SIZE);
> +    dlen = xbzrle_encode_buffer(test, buffer, XBZRLE_PAGE_SIZE, compressed,
> +                                XBZRLE_PAGE_SIZE);
>   
> -    rc = xbzrle_decode_buffer(compressed, dlen, test, PAGE_SIZE);
> -    g_assert(rc < PAGE_SIZE);
> -    g_assert(memcmp(test, buffer, PAGE_SIZE) == 0);
> +    rc = xbzrle_decode_buffer(compressed, dlen, test, XBZRLE_PAGE_SIZE);
> +    g_assert(rc < XBZRLE_PAGE_SIZE);
> +    g_assert(memcmp(test, buffer, XBZRLE_PAGE_SIZE) == 0);
>   
>       g_free(buffer);
>       g_free(compressed);
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE
  2021-01-13  7:19   ` Thomas Huth
@ 2021-01-13  9:07     ` Jiaxun Yang
  0 siblings, 0 replies; 24+ messages in thread
From: Jiaxun Yang @ 2021-01-13  9:07 UTC (permalink / raw)
  To: Thomas Huth, BALATON Zoltan via
  Cc: Kevin Wolf, Fam Zheng, kvm, Viktor Prutyanov, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Alistair Francis, Greg Kurz, Wainer dos Santos Moschetta,
	Max Reitz, qemu-ppc, Paolo Bonzini, qemu-block, Alex Bennée,
	David Gibson



On Wed, Jan 13, 2021, at 3:19 PM, Thomas Huth wrote:
> On 21/12/2020 01.53, Jiaxun Yang wrote:
> > As per POSIX specification of limits.h [1], OS libc may define
> > PAGE_SIZE in limits.h.
> > 
> > To prevent collosion of definition, we discard PAGE_SIZE from
> > defined by libc and take QEMU's variable.
> > 
> > [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
> > 
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > ---
> >   accel/kvm/kvm-all.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> > index 389eaace72..3feb17d965 100644
> > --- a/accel/kvm/kvm-all.c
> > +++ b/accel/kvm/kvm-all.c
> > @@ -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
> 
> If I get that right, the PAGE_SIZE macro is only used one time in this 
> file... so it's maybe easier to get rid of the macro completely and replace 
> the single occurance with qemu_real_host_page_size directly?

It is also used in kernel headers included here.

Thanks.

- Jiaxun

> 
>   Thomas
> 
>

-- 
- Jiaxun

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux
  2021-01-13  7:05   ` Thomas Huth
@ 2021-01-13 11:36     ` Peter Maydell
  0 siblings, 0 replies; 24+ messages in thread
From: Peter Maydell @ 2021-01-13 11:36 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Jiaxun Yang, QEMU Developers, QEMU Trivial, Kevin Wolf,
	Fam Zheng, kvm-devel, Viktor Prutyanov, Laurent Vivier,
	Alex Bennée, Alistair Francis, Greg Kurz,
	Wainer dos Santos Moschetta, Max Reitz, qemu-ppc, Paolo Bonzini,
	Qemu-block, Philippe Mathieu-Daudé,
	David Gibson

On Wed, 13 Jan 2021 at 07:06, Thomas Huth <thuth@redhat.com> wrote:
>
> On 21/12/2020 01.53, Jiaxun Yang wrote:
> > signal.h is equlevant of sys/signal.h on Linux, musl would complain
> > wrong usage of sys/signal.h.
> >
> > In file included from /builds/FlyGoat/qemu/include/qemu/osdep.h:108,
> >                   from ../tests/qemu-iotests/socket_scm_helper.c:13:
> > /usr/include/sys/signal.h:1:2: error: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Werror=cpp]
> >      1 | #warning redirecting incorrect #include <sys/signal.h> to <signal.h>
> >        |  ^~~~~~~
> >
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > ---
> >   meson.build | 5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 372576f82c..1ef8722b3a 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -841,7 +841,10 @@ 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'))
> > +if targetos != 'linux'
> > +  # signal.h is equlevant of sys/signal.h on Linux
> > +  config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
> > +endif
>
> Seems like it sys/signal.h was introduced for OpenBSD once (see commit
> 128ab2ff50a), so this new check should be fine.

The right way to fix this would be to apply
https://patchew.org/QEMU/20201027003848.10920-1-mforney@mforney.org/
which got reviewed but never applied (it might need a respin to work
with meson) which simply removes the sys/signal.h include and the
"does the header exist" test entirely -- there is no platform which
needs sys/signal.h.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-01-13 11:37 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21  0:53 [PATCH 0/9] Alpine Linux build fix and CI pipeline Jiaxun Yang
2020-12-21  0:53 ` [PATCH 1/9] tests/docker: Add dockerfile for Alpine Linux Jiaxun Yang
2020-12-22 18:37   ` Wainer dos Santos Moschetta
2020-12-21  0:53 ` [PATCH 2/9] configure: Add sys/timex.h to probe clk_adjtime Jiaxun Yang
2021-01-13  6:59   ` Thomas Huth
2020-12-21  0:53 ` [PATCH 3/9] configure/meson: Only check sys/signal.h on non-Linux Jiaxun Yang
2021-01-13  7:05   ` Thomas Huth
2021-01-13 11:36     ` Peter Maydell
2020-12-21  0:53 ` [PATCH 4/9] libvhost-user: Include poll.h instead of sys/poll.h Jiaxun Yang
2021-01-13  7:08   ` Thomas Huth
2020-12-21  0:53 ` [PATCH 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE Jiaxun Yang
2021-01-13  7:14   ` Thomas Huth
2020-12-21  0:53 ` [PATCH 6/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE Jiaxun Yang
2021-01-13  7:16   ` Thomas Huth
2020-12-21  0:53 ` [PATCH 7/9] accel/kvm: avoid using predefined PAGE_SIZE Jiaxun Yang
2021-01-13  7:19   ` Thomas Huth
2021-01-13  9:07     ` Jiaxun Yang
2020-12-21  0:53 ` [PATCH 8/9] tests: Rename PAGE_SIZE definitions Jiaxun Yang
2021-01-13  7:21   ` Thomas Huth
2020-12-21  0:53 ` [PATCH 9/9] gitlab-ci: Add alpine to pipeline Jiaxun Yang
2020-12-21  1:06 ` [PATCH 0/9] Alpine Linux build fix and CI pipeline no-reply
2020-12-21  8:25   ` Jiaxun Yang
2020-12-22 18:41     ` Wainer dos Santos Moschetta
2020-12-23  0:54       ` Jiaxun Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).