Skip to contentSkip to conversation

accel: Re-enable WHPX cross-build on case sensitive filesystems

PATCH In review Philippe Mathieu-Daudé 2 participants 6 messages Jun 24, 2023 – Jun 28, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover accel: Re-enable WHPX cross-build on case sensitive filesystems

Re-enable cross-building of WHPX (via Docker images; also on CI).

Only cross-built.

Philippe Mathieu-Daudé (2):
docs/devel/testing: Update the 'Docker Debugging' section
accel: Re-enable WHPX cross-build on case sensitive filesystems

 docs/devel/testing.rst           | 2 +-
 meson.build                      | 4 ++--
 target/i386/whpx/whpx-internal.h | 4 ++--
 target/i386/whpx/whpx-all.c      | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.38.1
#1 lore raw

PATCH 1/2 docs/devel/testing: Update the 'Docker Debugging' section

Since commit 93cc0506f6 ("tests/docker: Use Fedora containers for MinGW cross-builds in the gitlab-CI") the MinGW toolchain is packaged inside the fedora-win[32/64]-cross images.

---
 docs/devel/testing.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/devel/testing.rst +1 -1
index 203facb417..e85e26c4ca 100644
@@ -558,7 +558,7 @@ When CI tasks, maintainers or yourself report a Docker test failure, follow the
 below steps to debug it:
 
 1. Locally reproduce the failure with the reported command line. E.g. run
-   ``make docker-test-mingw@fedora J=8``.
+   ``make docker-test-mingw@fedora-win64-cross J=8``.
 2. Add "V=1" to the command line, try again, to see the verbose output.
 3. Further add "DEBUG=1" to the command line. This will pause in a shell prompt
    in the container right before testing starts. You could either manually
Signature · 1 line
2.38.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] docs/devel/testing: Update the 'Docker Debugging' section

Quoted 8 lines · Philippe Mathieu-Daudé

Since commit 93cc0506f6 ("tests/docker: Use Fedora containers for MinGW cross-builds in the gitlab-CI") the MinGW toolchain is packaged inside the fedora-win[32/64]-cross images.

---
 docs/devel/testing.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#3 lore raw

PATCH 2/2 accel: Re-enable WHPX cross-build on case sensitive filesystems

In reply to Philippe Mathieu-Daudé

Since MinGW commit 395dcfdea ("rename hyper-v headers and def files to lower case") [*], WinHvPlatform.h and WinHvEmulation.h got respectively renamed as winhvplatform.h / winhvemulation.h.

The mingw64-headers package included in the Fedora version we use for CI does include this commit; and meson fails to detect these present-but-renamed headers while cross-building (on case-sensitive filesystems).

Use the renamed header in order to detect and successfully cross-build with the WHPX accelerator.

Note, on Windows hosts, the libraries are still named as WinHvPlatform.dll and WinHvEmulation.dll, so we don't bother renaming the definitions used by load_whp_dispatch_fns() in target/i386/whpx/whpx-all.c.

[*] https://sourceforge.net/p/mingw-w64/mingw-w64/ci/395dcfdea

---
 meson.build                      | 4 ++--
 target/i386/whpx/whpx-internal.h | 4 ++--
 target/i386/whpx/whpx-all.c      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
meson.build +2 -2
index 6ef78ea278..fc3c14a810 100644
@@ -661,8 +661,8 @@ endif
 if get_option('whpx').allowed() and targetos == 'windows'
   if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64'
     error('WHPX requires 64-bit host')
-  elif cc.has_header('WinHvPlatform.h', required: get_option('whpx')) and \
-       cc.has_header('WinHvEmulation.h', required: get_option('whpx'))
+  elif cc.has_header('winhvplatform.h', required: get_option('whpx')) and \
+       cc.has_header('winhvemulation.h', required: get_option('whpx'))
     accelerators += 'CONFIG_WHPX'
   endif
 endif
target/i386/whpx/whpx-internal.h +2 -2
index 06429d8ccd..6633e9c4ca 100644
@@ -2,8 +2,8 @@
 #define TARGET_I386_WHPX_INTERNAL_H
 
 #include <windows.h>
-#include <WinHvPlatform.h>
-#include <WinHvEmulation.h>
+#include <winhvplatform.h>
+#include <winhvemulation.h>
 
 typedef enum WhpxBreakpointState {
     WHPX_BP_CLEARED = 0,
target/i386/whpx/whpx-all.c +2 -2
index 0903327ac5..9ee04ee650 100644
@@ -31,8 +31,8 @@
 #include "whpx-internal.h"
 #include "whpx-accel-ops.h"
 
-#include <WinHvPlatform.h>
-#include <WinHvEmulation.h>
+#include <winhvplatform.h>
+#include <winhvemulation.h>
 
 #define HYPERV_APIC_BUS_FREQUENCY      (200000000ULL)
 
Signature · 1 line
2.38.1
Reviewed-by on v1 2/2
#4 lore raw
Quoted 17 lines · Philippe Mathieu-Daudé

Since MinGW commit 395dcfdea ("rename hyper-v headers and def files to lower case") [*], WinHvPlatform.h and WinHvEmulation.h got respectively renamed as winhvplatform.h / winhvemulation.h.

The mingw64-headers package included in the Fedora version we use for CI does include this commit; and meson fails to detect these present-but-renamed headers while cross-building (on case-sensitive filesystems).

Use the renamed header in order to detect and successfully cross-build with the WHPX accelerator.

Note, on Windows hosts, the libraries are still named as WinHvPlatform.dll and WinHvEmulation.dll, so we don't bother renaming the definitions used by load_whp_dispatch_fns() in target/i386/whpx/whpx-all.c.

Quoted 8 lines

[*] https://sourceforge.net/p/mingw-w64/mingw-w64/ci/395dcfdea

---
 meson.build                      | 4 ++--
 target/i386/whpx/whpx-internal.h | 4 ++--
 target/i386/whpx/whpx-all.c      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

Philippe Mathieu-Daudé (2):
docs/devel/testing: Update the 'Docker Debugging' section
accel: Re-enable WHPX cross-build on case sensitive filesystems

  docs/devel/testing.rst           | 2 +-
  meson.build                      | 4 ++--
  target/i386/whpx/whpx-internal.h | 4 ++--
  target/i386/whpx/whpx-all.c      | 4 ++--
  4 files changed, 7 insertions(+), 7 deletions(-)

Series queued.