Skip to contentSkip to conversation

Initial Windows on ARM (AArch64 64-Bit) host support

PATCH In review Cao Jiaxi 7 participants 17 messages May 3, 2019

lore
Share & tools
lore

Cao Jiaxi

author
#0 lore raw

v3 cover Initial Windows on ARM (AArch64 64-Bit) host support

Initial Windows on ARM (AArch64 64-Bit) host support

This series of patches is for initial support of Windows 10 on ARM as a QEMU host. Currently only TCG intepreter is working correctly, it crashes when TCG JIT is enabled.

For now we assume it is built using the clang aarch64-w64-mingw32 toolchain, you can get a prebuilt toolchain at https://github.com/mstorsjo/llvm-mingw.

Cao Jiaxi (4):
QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets
qga: Fix mingw compilation warnings on enum conversion util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64
osdep: Fix mingw compilation regarding stdio formats

 contrib/libvhost-user/libvhost-user.h |  2 +-
 include/qemu/compiler.h               |  2 +-
 include/qemu/osdep.h                  | 10 +++++-----
 qga/commands-win32.c                  |  2 +-
 scripts/cocci-macro-file.h            |  7 ++++++-
 slirp/src/util.h                      |  2 +-
 util/cacheinfo.c                      |  2 +-
 7 files changed, 16 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v3 1/4 QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets

gcc_struct is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets.

---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 include/qemu/compiler.h               | 2 +-
 scripts/cocci-macro-file.h            | 7 ++++++-
 slirp/src/util.h                      | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
contrib/libvhost-user/libvhost-user.h +1 -1
index 414ceb0a2f..78b33306e8 100644
@@ -148,7 +148,7 @@ typedef struct VhostUserInflight {
     uint16_t queue_size;
 } VhostUserInflight;
 
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define VU_PACKED __attribute__((gcc_struct, packed))
 #else
 # define VU_PACKED __attribute__((packed))
include/qemu/compiler.h +1 -1
index 296b2fd572..09fc44cca4 100644
@@ -28,7 +28,7 @@
 
 #define QEMU_SENTINEL __attribute__((sentinel))
 
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define QEMU_PACKED __attribute__((gcc_struct, packed))
 #else
 # define QEMU_PACKED __attribute__((packed))
scripts/cocci-macro-file.h +6 -1
index e485cdccae..c6bbc05ba3 100644
@@ -23,7 +23,12 @@
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #define QEMU_SENTINEL __attribute__((sentinel))
-#define QEMU_PACKED __attribute__((gcc_struct, packed))
+
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
+# define QEMU_PACKED __attribute__((gcc_struct, packed))
+#else
+# define QEMU_PACKED __attribute__((packed))
+#endif
 
 #define cat(x,y) x ## y
 #define cat2(x,y) cat(x,y)
slirp/src/util.h +1 -1
index 01f1e0e068..278828fe3f 100644
@@ -43,7 +43,7 @@
 #include <netinet/in.h>
 #endif
 
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define SLIRP_PACKED __attribute__((gcc_struct, packed))
 #else
 # define SLIRP_PACKED __attribute__((packed))
Signature · 1 line
2.17.1
Reviewed-by on v3 1/4
#2 lore raw

Re: [Qemu-devel] [PATCH v3 1/4] QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets

Quoted 60 lines · Cao Jiaxi

gcc_struct is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets.

---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 include/qemu/compiler.h               | 2 +-
 scripts/cocci-macro-file.h            | 7 ++++++-
 slirp/src/util.h                      | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
contrib/libvhost-user/libvhost-user.h +1 -1
index 414ceb0a2f..78b33306e8 100644
@@ -148,7 +148,7 @@ typedef struct VhostUserInflight {
     uint16_t queue_size;
 } VhostUserInflight;
 
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define VU_PACKED __attribute__((gcc_struct, packed))
 #else
 # define VU_PACKED __attribute__((packed))
include/qemu/compiler.h +1 -1
index 296b2fd572..09fc44cca4 100644
@@ -28,7 +28,7 @@
 
 #define QEMU_SENTINEL __attribute__((sentinel))
 
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define QEMU_PACKED __attribute__((gcc_struct, packed))
 #else
 # define QEMU_PACKED __attribute__((packed))
scripts/cocci-macro-file.h +6 -1
index e485cdccae..c6bbc05ba3 100644
@@ -23,7 +23,12 @@
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #define QEMU_SENTINEL __attribute__((sentinel))
-#define QEMU_PACKED __attribute__((gcc_struct, packed))
+
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
+# define QEMU_PACKED __attribute__((gcc_struct, packed))
+#else
+# define QEMU_PACKED __attribute__((packed))
+#endif
 
 #define cat(x,y) x ## y
 #define cat2(x,y) cat(x,y)
slirp/src/util.h +0 -0
index 01f1e0e068..278828fe3f 100644

slirp/src/util.h line 49

Quoted 8 lines
slirp/src/util.h +1 -1
@@ -43,7 +43,7 @@
 #include <netinet/in.h>
 #endif
 
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define SLIRP_PACKED __attribute__((gcc_struct, packed))
 #else
 # define SLIRP_PACKED __attribute__((packed))

The slirp code is currently on its way into a separate module, so you might need to provide that hunk to the libslirp folks again... I'm putting the slirp maintainers on CC:, maybe they can pick it up from here.

Anyway:

#3 lore raw

Re: [Qemu-devel] [PATCH v3 1/4] QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets

Quoted 20 lines · Thomas Huth
Quoted 18 lines · Cao Jiaxi

gcc_struct is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets.

---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 include/qemu/compiler.h               | 2 +-
 scripts/cocci-macro-file.h            | 7 ++++++-
 slirp/src/util.h                      | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
slirp/src/util.h +0 -0
index 01f1e0e068..278828fe3f 100644
@@ -43,7 +43,7 @@
 #include <netinet/in.h>
 #endif
 
Quoted 10 lines

slirp/src/util.h line 49

Quoted 6 lines
slirp/src/util.h +1 -1
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define SLIRP_PACKED __attribute__((gcc_struct, packed))
 #else
 # define SLIRP_PACKED __attribute__((packed))

The slirp code is currently on its way into a separate module, so you might need to provide that hunk to the libslirp folks again... I'm putting the slirp maintainers on CC:, maybe they can pick it up from here.

Yes, the slirp module has now landed in master, so this patch definitely needs to be split into two. I've kept in my target-arm.next tree the parts which are applicable to the QEMU repo itself (ie everything except the slirp/ change), so we just need a new patch for the slirp submodule part.

Marc-André, Samuel -- what's the process for submitting and getting reviewed changes to the slirp submodule now it's a separate project ?

thanks
-- PMM

#4 lore raw

Re: [Qemu-devel] [PATCH v3 1/4] QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets

Hi

Le ven. 3 mai 2019 à 17:23, Peter Maydell <[email protected]> a écrit :

Quoted 40 lines · Thomas Huth
Quoted 3 lines · Cao Jiaxi
Quoted 1 line

gcc_struct is for x86 only, and it generates an warning on ARM64

Clang/MinGW targets.

Quoted 17 lines
Quoted 17 lines
---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 include/qemu/compiler.h               | 2 +-
 scripts/cocci-macro-file.h            | 7 ++++++-
 slirp/src/util.h                      | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
slirp/src/util.h +0 -0
index 01f1e0e068..278828fe3f 100644
@@ -43,7 +43,7 @@
 #include <netinet/in.h>
 #endif
 
Quoted 10 lines

slirp/src/util.h line 49

Quoted 6 lines
slirp/src/util.h +1 -1
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define SLIRP_PACKED __attribute__((gcc_struct, packed))
 #else
 # define SLIRP_PACKED __attribute__((packed))

The slirp code is currently on its way into a separate module, so you might need to provide that hunk to the libslirp folks again... I'm putting the slirp maintainers on CC:, maybe they can pick it up from

here.

Yes, the slirp module has now landed in master, so this patch definitely needs to be split into two. I've kept in my target-arm.next tree the parts which are applicable to the QEMU repo itself (ie everything except the slirp/ change), so we just need a new patch for the slirp submodule part.

Quoted 4 lines

Marc-André, Samuel -- what's the process for submitting and getting reviewed changes to the slirp submodule now it's a separate project ?

It's hosted on gitlab.freedesktop.org, with some CI. It's fine to send patches on qemu devel, as long as Samuel or I are in CC. But in the long term, I think gitlab MR will be favoured (after a while using it, I think gitlab is better than ML for patches & bug tracking tbh)

Quoted 1 line
#5 lore raw

Re: [Qemu-devel] [PATCH v3 1/4] QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets

Quoted 50 lines · Marc-André Lureau

Hi

Le ven. 3 mai 2019 à 17:23, Peter Maydell <[email protected]> a écrit :

Quoted 40 lines · Thomas Huth
Quoted 3 lines · Cao Jiaxi
Quoted 1 line

gcc_struct is for x86 only, and it generates an warning on ARM64

Clang/MinGW targets.

Quoted 17 lines
Quoted 17 lines
---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 include/qemu/compiler.h               | 2 +-
 scripts/cocci-macro-file.h            | 7 ++++++-
 slirp/src/util.h                      | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
slirp/src/util.h +0 -0
index 01f1e0e068..278828fe3f 100644
@@ -43,7 +43,7 @@
 #include <netinet/in.h>
 #endif
 
Quoted 10 lines

slirp/src/util.h line 49

Quoted 6 lines
slirp/src/util.h +1 -1
-#if defined(_WIN32)
+#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define SLIRP_PACKED __attribute__((gcc_struct, packed))
 #else
 # define SLIRP_PACKED __attribute__((packed))

The slirp code is currently on its way into a separate module, so you might need to provide that hunk to the libslirp folks again... I'm putting the slirp maintainers on CC:, maybe they can pick it up from

here.

Yes, the slirp module has now landed in master, so this patch definitely needs to be split into two. I've kept in my target-arm.next tree the parts which are applicable to the QEMU repo itself (ie everything except the slirp/ change), so we just need a new patch for the slirp submodule part.

Quoted 4 lines

Marc-André, Samuel -- what's the process for submitting and getting reviewed changes to the slirp submodule now it's a separate project ?

Quoted 4 lines

It's hosted on gitlab.freedesktop.org, with some CI. It's fine to send patches on qemu devel, as long as Samuel or I are in CC. But in the long term, I think gitlab MR will be favoured (after a while using it, I think gitlab is better than ML for patches & bug tracking tbh)

Except when working offline (or with poor intermittent link).

author
#6 lore raw

PATCH v3 2/4 qga: Fix mingw compilation warnings on enum conversion

In reply to Cao Jiaxi

The win2qemu[] is supposed to be the conversion table to convert between STORAGE_BUS_TYPE in Windows SDK and GuestDiskBusType in qga.

But it was incorrectly written that it forces to set a GuestDiskBusType value to STORAGE_BUS_TYPE, which generates an enum conversion warning in clang.

---
 qga/commands-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/commands-win32.c +1 -1
index d40d61f605..6b67f16faf 100644
@@ -457,7 +457,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
 
 #ifdef CONFIG_QGA_NTDDSCSI
 
-static STORAGE_BUS_TYPE win2qemu[] = {
+static GuestDiskBusType win2qemu[] = {
     [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
     [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI,
     [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE,
Signature · 1 line
2.17.1
Reviewed-by on v3 2/4
#7 lore raw

Re: [Qemu-devel] [PATCH v3 2/4] qga: Fix mingw compilation warnings on enum conversion

Quoted 17 lines · Cao Jiaxi

The win2qemu[] is supposed to be the conversion table to convert between STORAGE_BUS_TYPE in Windows SDK and GuestDiskBusType in qga.

But it was incorrectly written that it forces to set a GuestDiskBusType value to STORAGE_BUS_TYPE, which generates an enum conversion warning in clang.

---
 qga/commands-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/commands-win32.c +0 -0
index d40d61f605..6b67f16faf 100644

qga/commands-win32.c void qmp_guest_file_flush(int64_t handle, Error **errp) · line 463

Quoted 8 lines
qga/commands-win32.c +1 -1
@@ -457,7 +457,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
 
 #ifdef CONFIG_QGA_NTDDSCSI
 
-static STORAGE_BUS_TYPE win2qemu[] = {
+static GuestDiskBusType win2qemu[] = {
     [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
     [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI,
     [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE,

r~

Reviewed-by on v3 2/4
#8 lore raw

Re: [Qemu-devel] [PATCH v3 2/4] qga: Fix mingw compilation warnings on enum conversion

In reply to Cao Jiaxi
Quoted 16 lines · Cao Jiaxi

The win2qemu[] is supposed to be the conversion table to convert between STORAGE_BUS_TYPE in Windows SDK and GuestDiskBusType in qga.

But it was incorrectly written that it forces to set a GuestDiskBusType value to STORAGE_BUS_TYPE, which generates an enum conversion warning in clang.

---
 qga/commands-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/commands-win32.c +0 -0
index d40d61f605..6b67f16faf 100644

qga/commands-win32.c void qmp_guest_file_flush(int64_t handle, Error **errp) · line 463

Quoted 8 lines
qga/commands-win32.c +1 -1
@@ -457,7 +457,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
 
 #ifdef CONFIG_QGA_NTDDSCSI
 
-static STORAGE_BUS_TYPE win2qemu[] = {
+static GuestDiskBusType win2qemu[] = {
     [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
     [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI,
     [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE,
author
#9 lore raw

PATCH v3 3/4 util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64

In reply to Cao Jiaxi

Windows ARM64 uses LLP64 model, which breaks current assumptions.

---
 util/cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/cacheinfo.c +1 -1
index 3cd080b83d..eebe1ce9c5 100644
@@ -107,7 +107,7 @@ static void sys_cache_info(int *isize, int *dsize)
 static void arch_cache_info(int *isize, int *dsize)
 {
     if (*isize == 0 || *dsize == 0) {
-        unsigned long ctr;
+        uint64_t ctr;
 
         /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1,
            but (at least under Linux) these are marked protected by the
Signature · 1 line
2.17.1
Reviewed-by on v3 3/4
#10 lore raw

Re: [Qemu-devel] [PATCH v3 3/4] util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64

Quoted 13 lines · Cao Jiaxi

Windows ARM64 uses LLP64 model, which breaks current assumptions.

---
 util/cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/cacheinfo.c +0 -0
index 3cd080b83d..eebe1ce9c5 100644

util/cacheinfo.c static void sys_cache_info(int *isize, int *dsize) · line 113

Quoted 8 lines
util/cacheinfo.c +1 -1
@@ -107,7 +107,7 @@ static void sys_cache_info(int *isize, int *dsize)
 static void arch_cache_info(int *isize, int *dsize)
 {
     if (*isize == 0 || *dsize == 0) {
-        unsigned long ctr;
+        uint64_t ctr;
 
         /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1,
            but (at least under Linux) these are marked protected by the

r~

Reviewed-by on v3 3/4
#11 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH v3 3/4] util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64

In reply to Cao Jiaxi
Quoted 13 lines · Cao Jiaxi

Windows ARM64 uses LLP64 model, which breaks current assumptions.

---
 util/cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/cacheinfo.c +0 -0
index 3cd080b83d..eebe1ce9c5 100644

util/cacheinfo.c static void sys_cache_info(int *isize, int *dsize) · line 113

Quoted 8 lines
util/cacheinfo.c +1 -1
@@ -107,7 +107,7 @@ static void sys_cache_info(int *isize, int *dsize)
 static void arch_cache_info(int *isize, int *dsize)
 {
     if (*isize == 0 || *dsize == 0) {
-        unsigned long ctr;
+        uint64_t ctr;
 
         /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1,
            but (at least under Linux) these are marked protected by the
author
#12 lore raw

PATCH v3 4/4 osdep: Fix mingw compilation regarding stdio formats

In reply to Cao Jiaxi

I encountered the following compilation error on mingw:

/mnt/d/qemu/include/qemu/osdep.h:97:9: error: '__USE_MINGW_ANSI_STDIO' macro redefined [-Werror,-Wmacro-redefined]

 #define __USE_MINGW_ANSI_STDIO 1
        ^

/mnt/d/llvm-mingw/aarch64-w64-mingw32/include/_mingw.h:433:9: note: previous definition is here
#define __USE_MINGW_ANSI_STDIO 0 /* was not defined so it should be 0 */

It turns out that __USE_MINGW_ANSI_STDIO must be set before any system headers are included, not just before stdio.h.

---
 include/qemu/osdep.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/qemu/osdep.h +5 -5
index 303d315c5d..af2b91f0b8 100644
@@ -85,17 +85,17 @@ extern int daemon(int, int);
 #endif
 #endif
 
+/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
+#ifdef __MINGW32__
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
 #include <stdlib.h>
-
-/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
-#ifdef __MINGW32__
-#define __USE_MINGW_ANSI_STDIO 1
-#endif
 #include <stdio.h>
 
 #include <string.h>
Signature · 1 line
2.17.1
Reviewed-by on v3 4/4
#13 lore raw

Re: [Qemu-devel] [PATCH v3 4/4] osdep: Fix mingw compilation regarding stdio formats

Quoted 34 lines · Cao Jiaxi

I encountered the following compilation error on mingw:

/mnt/d/qemu/include/qemu/osdep.h:97:9: error: '__USE_MINGW_ANSI_STDIO' macro redefined [-Werror,-Wmacro-redefined]

 #define __USE_MINGW_ANSI_STDIO 1
        ^

/mnt/d/llvm-mingw/aarch64-w64-mingw32/include/_mingw.h:433:9: note: previous definition is here
#define __USE_MINGW_ANSI_STDIO 0 /* was not defined so it should be 0 */

It turns out that __USE_MINGW_ANSI_STDIO must be set before any system headers are included, not just before stdio.h.

---
 include/qemu/osdep.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/qemu/osdep.h +5 -0
index 303d315c5d..af2b91f0b8 100644
@@ -85,17 +85,17 @@ extern int daemon(int, int);
 #endif
 #endif
 
+/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
+#ifdef __MINGW32__
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdbool.h>
 #include <stdint.h>

include/qemu/osdep.h extern int daemon(int, int); · line 101

Quoted 10 lines
include/qemu/osdep.h +0 -5
 #include <sys/types.h>
 #include <stdlib.h>
-
-/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
-#ifdef __MINGW32__
-#define __USE_MINGW_ANSI_STDIO 1
-#endif
 #include <stdio.h>
 
 #include <string.h>
Reviewed-by
#14 lore raw

Re: [Qemu-devel] [PATCH v3 4/4] osdep: Fix mingw compilation regarding stdio formats

Quoted 43 lines · Thomas Huth
Quoted 42 lines · Cao Jiaxi

I encountered the following compilation error on mingw:

/mnt/d/qemu/include/qemu/osdep.h:97:9: error: '__USE_MINGW_ANSI_STDIO' macro redefined [-Werror,-Wmacro-redefined]

 #define __USE_MINGW_ANSI_STDIO 1
        ^

/mnt/d/llvm-mingw/aarch64-w64-mingw32/include/_mingw.h:433:9: note: previous definition is here
#define __USE_MINGW_ANSI_STDIO 0 /* was not defined so it should be 0 */

It turns out that __USE_MINGW_ANSI_STDIO must be set before any system headers are included, not just before stdio.h.

---
 include/qemu/osdep.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/qemu/osdep.h +5 -5
index 303d315c5d..af2b91f0b8 100644
@@ -85,17 +85,17 @@ extern int daemon(int, int);
 #endif
 #endif
 
+/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
+#ifdef __MINGW32__
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
 #include <stdlib.h>
-
-/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
-#ifdef __MINGW32__
-#define __USE_MINGW_ANSI_STDIO 1
-#endif
 #include <stdio.h>
 
Quoted 4 lines

include/qemu/osdep.h extern int daemon(int, int); · line 101

Quoted 2 lines
include/qemu/osdep.h +0 -0
 #include <string.h>
Reviewed-by Tested-by Reviewed-by Tested-by Reviewed-by on the v3 series
#15 lore raw
In reply to Cao Jiaxi
Quoted 8 lines · Cao Jiaxi

Initial Windows on ARM (AArch64 64-Bit) host support

This series of patches is for initial support of Windows 10 on ARM as a QEMU host. Currently only TCG intepreter is working correctly, it crashes when TCG JIT is enabled.

For now we assume it is built using the clang aarch64-w64-mingw32 toolchain, you can get a prebuilt toolchain at https://github.com/mstorsjo/llvm-mingw.

I'm a bit confused since those patches appear 2 times in my mailbox. Assuming this is a git send-email setup mistake, please consider adding my Reviewed-by/Tested-by here too.

These are:

Quoted 2 lines

Cao Jiaxi (4):
QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets

No tag.

Quoted 1 line

qga: Fix mingw compilation warnings on enum conversion

Quoted 1 line

util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64

Quoted 1 line

osdep: Fix mingw compilation regarding stdio formats

Thanks,

Phil.

#16 lore raw
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Cao Jiaxi

Initial Windows on ARM (AArch64 64-Bit) host support

This series of patches is for initial support of Windows 10 on ARM as a QEMU host. Currently only TCG intepreter is working correctly, it crashes when TCG JIT is enabled.

Quoted 7 lines
Quoted 3 lines

For now we assume it is built using the clang aarch64-w64-mingw32 toolchain, you can get a prebuilt toolchain at https://github.com/mstorsjo/llvm-mingw.

I'm a bit confused since those patches appear 2 times in my mailbox. Assuming this is a git send-email setup mistake, please consider adding my Reviewed-by/Tested-by here too.

Thanks -- I've applied these patches to target-arm.next, and have consolidated the various tags that people have applied to the two sets of emails (and checked that they actually are the same patches and not different code :-))

-- PMM