All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/5] Darwin patches for 2022-07-12
@ 2022-07-12 22:16 Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 1/5] hvf: Enable RDTSCP support Philippe Mathieu-Daudé via
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-07-12 22:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roman Bolshakov, Akihiko Odaki, Thomas Huth, Cameron Esfahani,
	Philippe Mathieu-Daudé

The following changes since commit 8e3d85d36b77f11ad7bded3a2d48c1f0cc334f82:

  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-07-12 14:12:15 +0100)

are available in the Git repository at:

  https://github.com/philmd/qemu.git tags/darwin-20220712

for you to fetch changes up to 50b13d31f4cc6c70330cc3a92561a581fc176ec9:

  avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR (2022-07-13 00:06:02 +0200)

----------------------------------------------------------------
Darwin patches:

- Enable RDTSCP support on HVF
- ui/cocoa: Take refresh rate into account

Few buildsys fixes:

- Restrict TCG to emulation
- Remove a unused-but-set-variable warning
- Allow running Avocado from pseudo-"in source tree" builds

----------------------------------------------------------------

Akihiko Odaki (1):
  ui/cocoa: Take refresh rate into account

Cameron Esfahani (1):
  hvf: Enable RDTSCP support

Peter Delevoryas (2):
  ui/cocoa: Fix switched_to_fullscreen warning
  avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR

Philippe Mathieu-Daudé (1):
  configure: Restrict TCG to emulation

 .gitlab-ci.d/buildtest.yml             |  2 +-
 configure                              | 20 ++++++++++++++------
 meson.build                            |  3 ++-
 target/i386/hvf/hvf.c                  | 26 +++++++++++++++++---------
 target/i386/hvf/vmcs.h                 |  3 ++-
 target/i386/hvf/x86_cpuid.c            |  7 ++++---
 tests/avocado/avocado_qemu/__init__.py | 17 +++++++++--------
 ui/cocoa.m                             | 20 ++++++++++++--------
 8 files changed, 61 insertions(+), 37 deletions(-)

-- 
2.36.1



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

* [PULL 1/5] hvf: Enable RDTSCP support
  2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
@ 2022-07-12 22:16 ` Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 2/5] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-07-12 22:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roman Bolshakov, Akihiko Odaki, Thomas Huth, Cameron Esfahani,
	Philippe Mathieu-Daudé,
	Silvio Moioli

From: Cameron Esfahani <dirty@apple.com>

Pass through RDPID and RDTSCP support in CPUID if host supports it.
Correctly detect if CPU_BASED_TSC_OFFSET and CPU_BASED2_RDTSCP would
be supported in primary and secondary processor-based VM-execution
controls.  Enable RDTSCP in secondary processor controls if RDTSCP
support is indicated in CPUID.

Signed-off-by: Cameron Esfahani <dirty@apple.com>
Message-Id: <20220214185605.28087-7-f4bug@amsat.org>
Tested-by: Silvio Moioli <moio@suse.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1011
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/i386/hvf/hvf.c       | 26 +++++++++++++++++---------
 target/i386/hvf/vmcs.h      |  3 ++-
 target/i386/hvf/x86_cpuid.c |  7 ++++---
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index f8833277ab..8d2248bb3f 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -221,6 +221,7 @@ int hvf_arch_init_vcpu(CPUState *cpu)
 {
     X86CPU *x86cpu = X86_CPU(cpu);
     CPUX86State *env = &x86cpu->env;
+    uint64_t reqCap;
 
     init_emu();
     init_decoder();
@@ -257,19 +258,26 @@ int hvf_arch_init_vcpu(CPUState *cpu)
     /* set VMCS control fields */
     wvmcs(cpu->hvf->fd, VMCS_PIN_BASED_CTLS,
           cap2ctrl(hvf_state->hvf_caps->vmx_cap_pinbased,
-          VMCS_PIN_BASED_CTLS_EXTINT |
-          VMCS_PIN_BASED_CTLS_NMI |
-          VMCS_PIN_BASED_CTLS_VNMI));
+                   VMCS_PIN_BASED_CTLS_EXTINT |
+                   VMCS_PIN_BASED_CTLS_NMI |
+                   VMCS_PIN_BASED_CTLS_VNMI));
     wvmcs(cpu->hvf->fd, VMCS_PRI_PROC_BASED_CTLS,
           cap2ctrl(hvf_state->hvf_caps->vmx_cap_procbased,
-          VMCS_PRI_PROC_BASED_CTLS_HLT |
-          VMCS_PRI_PROC_BASED_CTLS_MWAIT |
-          VMCS_PRI_PROC_BASED_CTLS_TSC_OFFSET |
-          VMCS_PRI_PROC_BASED_CTLS_TPR_SHADOW) |
+                   VMCS_PRI_PROC_BASED_CTLS_HLT |
+                   VMCS_PRI_PROC_BASED_CTLS_MWAIT |
+                   VMCS_PRI_PROC_BASED_CTLS_TSC_OFFSET |
+                   VMCS_PRI_PROC_BASED_CTLS_TPR_SHADOW) |
           VMCS_PRI_PROC_BASED_CTLS_SEC_CONTROL);
+
+    reqCap = VMCS_PRI_PROC_BASED2_CTLS_APIC_ACCESSES;
+
+    /* Is RDTSCP support in CPUID?  If so, enable it in the VMCS. */
+    if (hvf_get_supported_cpuid(0x80000001, 0, R_EDX) & CPUID_EXT2_RDTSCP) {
+        reqCap |= VMCS_PRI_PROC_BASED2_CTLS_RDTSCP;
+    }
+
     wvmcs(cpu->hvf->fd, VMCS_SEC_PROC_BASED_CTLS,
-          cap2ctrl(hvf_state->hvf_caps->vmx_cap_procbased2,
-                   VMCS_PRI_PROC_BASED2_CTLS_APIC_ACCESSES));
+          cap2ctrl(hvf_state->hvf_caps->vmx_cap_procbased2, reqCap));
 
     wvmcs(cpu->hvf->fd, VMCS_ENTRY_CTLS, cap2ctrl(hvf_state->hvf_caps->vmx_cap_entry,
           0));
diff --git a/target/i386/hvf/vmcs.h b/target/i386/hvf/vmcs.h
index b4692f63f6..aee6f75dfd 100644
--- a/target/i386/hvf/vmcs.h
+++ b/target/i386/hvf/vmcs.h
@@ -354,7 +354,7 @@
 #define VMCS_PRI_PROC_BASED_CTLS_TSC_OFFSET (1 << 3)
 #define VMCS_PRI_PROC_BASED_CTLS_HLT (1 << 7)
 #define VMCS_PRI_PROC_BASED_CTLS_MWAIT         (1 << 10)
-#define VMCS_PRI_PROC_BASED_CTLS_TSC           (1 << 12)
+#define VMCS_PRI_PROC_BASED_CTLS_RDTSC         (1 << 12)
 #define VMCS_PRI_PROC_BASED_CTLS_CR8_LOAD      (1 << 19)
 #define VMCS_PRI_PROC_BASED_CTLS_CR8_STORE     (1 << 20)
 #define VMCS_PRI_PROC_BASED_CTLS_TPR_SHADOW    (1 << 21)
@@ -362,6 +362,7 @@
 #define VMCS_PRI_PROC_BASED_CTLS_SEC_CONTROL   (1 << 31)
 
 #define VMCS_PRI_PROC_BASED2_CTLS_APIC_ACCESSES (1 << 0)
+#define VMCS_PRI_PROC_BASED2_CTLS_RDTSCP        (1 << 3)
 #define VMCS_PRI_PROC_BASED2_CTLS_X2APIC        (1 << 4)
 
 enum task_switch_reason {
diff --git a/target/i386/hvf/x86_cpuid.c b/target/i386/hvf/x86_cpuid.c
index f24dd50e48..7323a7a94b 100644
--- a/target/i386/hvf/x86_cpuid.c
+++ b/target/i386/hvf/x86_cpuid.c
@@ -95,7 +95,8 @@ uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
                 ebx &= ~CPUID_7_0_EBX_INVPCID;
             }
 
-            ecx &= CPUID_7_0_ECX_AVX512_VBMI | CPUID_7_0_ECX_AVX512_VPOPCNTDQ;
+            ecx &= CPUID_7_0_ECX_AVX512_VBMI | CPUID_7_0_ECX_AVX512_VPOPCNTDQ |
+                   CPUID_7_0_ECX_RDPID;
             edx &= CPUID_7_0_EDX_AVX512_4VNNIW | CPUID_7_0_EDX_AVX512_4FMAPS;
         } else {
             ebx = 0;
@@ -132,11 +133,11 @@ uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
                 CPUID_FXSR | CPUID_EXT2_FXSR | CPUID_EXT2_PDPE1GB | CPUID_EXT2_3DNOWEXT |
                 CPUID_EXT2_3DNOW | CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX;
         hv_vmx_read_capability(HV_VMX_CAP_PROCBASED2, &cap);
-        if (!(cap & CPU_BASED2_RDTSCP)) {
+        if (!(cap2ctrl(cap, CPU_BASED2_RDTSCP) & CPU_BASED2_RDTSCP)) {
             edx &= ~CPUID_EXT2_RDTSCP;
         }
         hv_vmx_read_capability(HV_VMX_CAP_PROCBASED, &cap);
-        if (!(cap & CPU_BASED_TSC_OFFSET)) {
+        if (!(cap2ctrl(cap, CPU_BASED_TSC_OFFSET) & CPU_BASED_TSC_OFFSET)) {
             edx &= ~CPUID_EXT2_RDTSCP;
         }
         ecx &= CPUID_EXT3_LAHF_LM | CPUID_EXT3_CMP_LEG | CPUID_EXT3_CR8LEG |
-- 
2.36.1



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

* [PULL 2/5] configure: Restrict TCG to emulation
  2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 1/5] hvf: Enable RDTSCP support Philippe Mathieu-Daudé via
@ 2022-07-12 22:16 ` Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 3/5] ui/cocoa: Fix switched_to_fullscreen warning Philippe Mathieu-Daudé via
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-07-12 22:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roman Bolshakov, Akihiko Odaki, Thomas Huth, Cameron Esfahani,
	Philippe Mathieu-Daudé,
	Richard Henderson

If we don't need to emulate any target, we certainly don't need TCG.

This should also help to compile again with
 ".../configure --enable-tools --disable-system --disable-user"
on systems that do not have a TCG backend.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[thuth: Re-arranged the code, remove check-softfloat from buildtest.yml]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220706153816.768143-1-thuth@redhat.com>
---
 .gitlab-ci.d/buildtest.yml |  2 +-
 configure                  | 20 ++++++++++++++------
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 8a4353ef93..1931b77b49 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -599,7 +599,7 @@ build-tools-and-docs-debian:
     optional: true
   variables:
     IMAGE: debian-amd64
-    MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
+    MAKE_CHECK_ARGS: check-unit ctags TAGS cscope
     CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
     QEMU_JOB_PUBLISH: 1
   artifacts:
diff --git a/configure b/configure
index e8cc850727..465c5000ee 100755
--- a/configure
+++ b/configure
@@ -329,7 +329,7 @@ fi
 fdt="auto"
 
 # 2. Automatically enable/disable other options
-tcg="enabled"
+tcg="auto"
 cfi="false"
 
 # parse CC options second
@@ -1409,11 +1409,6 @@ EOF
   fi
 fi
 
-if test "$tcg" = "enabled"; then
-    git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
-    git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
-fi
-
 if test -z "${target_list+xxx}" ; then
     default_targets=yes
     for target in $default_target_list; do
@@ -1444,6 +1439,19 @@ case " $target_list " in
   ;;
 esac
 
+if test "$tcg" = "auto"; then
+  if test -z "$target_list"; then
+    tcg="disabled"
+  else
+    tcg="enabled"
+  fi
+fi
+
+if test "$tcg" = "enabled"; then
+    git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
+    git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
+fi
+
 feature_not_found() {
   feature=$1
   remedy=$2
-- 
2.36.1



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

* [PULL 3/5] ui/cocoa: Fix switched_to_fullscreen warning
  2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 1/5] hvf: Enable RDTSCP support Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 2/5] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
@ 2022-07-12 22:16 ` Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 4/5] ui/cocoa: Take refresh rate into account Philippe Mathieu-Daudé via
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-07-12 22:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roman Bolshakov, Akihiko Odaki, Thomas Huth, Cameron Esfahani,
	Philippe Mathieu-Daudé,
	Peter Delevoryas

From: Peter Delevoryas <peter@pjd.dev>

I noticed this error while building QEMU on Mac OS X:

    [1040/1660] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o
    ../ui/cocoa.m:803:17: warning: variable 'switched_to_fullscreen' set but not used [-Wunused-but-set-variable]
        static bool switched_to_fullscreen = false;
                    ^
    1 warning generated.

I think the behavior is fine if you remove "switched_to_fullscreen", I can
still switch in and out of mouse grabbed mode and fullscreen mode with this
change, and Command keycodes will only be passed to the guest if the mouse
is grabbed, which I think is the right behavior. I'm not sure why a static
piece of state was needed to handle that in the first place. Perhaps the
refactoring of the flags-state-change fixed that by toggling the Command
keycode on.

I tested this with an Ubuntu core image on macOS 12.4

    wget https://cdimage.ubuntu.com/ubuntu-core/18/stable/current/ubuntu-core-18-i386.img.xz
    xz -d ubuntu-core-18-i386.img.xz
    qemu-system-x86_64 -drive file=ubuntu-core-18.i386.img,format=raw

Fixes: 6d73bb643aa7 ("ui/cocoa: Clear modifiers whenever possible")
Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220702044304.90553-1-peter@pjd.dev>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 ui/cocoa.m | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6a4dccff7f..e883c7466e 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -800,7 +800,6 @@ - (bool) handleEventLocked:(NSEvent *)event
     int buttons = 0;
     int keycode = 0;
     bool mouse_event = false;
-    static bool switched_to_fullscreen = false;
     // Location of event in virtual screen coordinates
     NSPoint p = [self screenLocationOfEvent:event];
     NSUInteger modifiers = [event modifierFlags];
@@ -952,13 +951,6 @@ - (bool) handleEventLocked:(NSEvent *)event
 
             // forward command key combos to the host UI unless the mouse is grabbed
             if (!isMouseGrabbed && ([event modifierFlags] & NSEventModifierFlagCommand)) {
-                /*
-                 * Prevent the command key from being stuck down in the guest
-                 * when using Command-F to switch to full screen mode.
-                 */
-                if (keycode == Q_KEY_CODE_F) {
-                    switched_to_fullscreen = true;
-                }
                 return false;
             }
 
-- 
2.36.1



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

* [PULL 4/5] ui/cocoa: Take refresh rate into account
  2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
                   ` (2 preceding siblings ...)
  2022-07-12 22:16 ` [PULL 3/5] ui/cocoa: Fix switched_to_fullscreen warning Philippe Mathieu-Daudé via
@ 2022-07-12 22:16 ` Philippe Mathieu-Daudé via
  2022-07-12 22:16 ` [PULL 5/5] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR Philippe Mathieu-Daudé via
  2022-07-14 13:25 ` [PULL 0/5] Darwin patches for 2022-07-12 Peter Maydell
  5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-07-12 22:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roman Bolshakov, Akihiko Odaki, Thomas Huth, Cameron Esfahani,
	Philippe Mathieu-Daudé,
	Peter Maydell

From: Akihiko Odaki <akihiko.odaki@gmail.com>

Retrieve the refresh rate of the display and reflect it with
dpy_set_ui_info() and update_displaychangelistener(), allowing the
guest and DisplayChangeListener to consume the information.

The information will be used as a hint how often the display should
be updated. For example, when we run 30 Hz physical display updates
it is pointless for the guest to update the screen at 60Hz
frequency, the guest can spare some work instead.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220702142519.12188-1-akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 meson.build |  3 ++-
 ui/cocoa.m  | 12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index ad92d288a6..fea3566ea8 100644
--- a/meson.build
+++ b/meson.build
@@ -583,7 +583,8 @@ if get_option('attr').allowed()
   endif
 endif
 
-cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
+cocoa = dependency('appleframeworks', modules: ['Cocoa', 'CoreVideo'],
+                   required: get_option('cocoa'))
 if cocoa.found() and get_option('sdl').enabled()
   error('Cocoa and SDL cannot be enabled at the same time')
 endif
diff --git a/ui/cocoa.m b/ui/cocoa.m
index e883c7466e..5a8bd5dd84 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -561,8 +561,20 @@ - (void) updateUIInfoLocked
         CGDirectDisplayID display = [[description objectForKey:@"NSScreenNumber"] unsignedIntValue];
         NSSize screenSize = [[[self window] screen] frame].size;
         CGSize screenPhysicalSize = CGDisplayScreenSize(display);
+        CVDisplayLinkRef displayLink;
 
         frameSize = isFullscreen ? screenSize : [self frame].size;
+
+        if (!CVDisplayLinkCreateWithCGDisplay(display, &displayLink)) {
+            CVTime period = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(displayLink);
+            CVDisplayLinkRelease(displayLink);
+            if (!(period.flags & kCVTimeIsIndefinite)) {
+                update_displaychangelistener(&dcl,
+                                             1000 * period.timeValue / period.timeScale);
+                info.refresh_rate = (int64_t)1000 * period.timeScale / period.timeValue;
+            }
+        }
+
         info.width_mm = frameSize.width / screenSize.width * screenPhysicalSize.width;
         info.height_mm = frameSize.height / screenSize.height * screenPhysicalSize.height;
     } else {
-- 
2.36.1



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

* [PULL 5/5] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR
  2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
                   ` (3 preceding siblings ...)
  2022-07-12 22:16 ` [PULL 4/5] ui/cocoa: Take refresh rate into account Philippe Mathieu-Daudé via
@ 2022-07-12 22:16 ` Philippe Mathieu-Daudé via
  2022-07-14 13:25 ` [PULL 0/5] Darwin patches for 2022-07-12 Peter Maydell
  5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-07-12 22:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roman Bolshakov, Akihiko Odaki, Thomas Huth, Cameron Esfahani,
	Philippe Mathieu-Daudé,
	Peter Delevoryas

From: Peter Delevoryas <peter@pjd.dev>

I like to build QEMU from the root source directory [*], rather
than cd'ing into the build directory. This code may as well include
a search path for that, so that you can run avocado tests individually
without specifying "-p qemu_bin=build/qemu-system-arm" manually.

[*] See commit dedad02720 ("configure: add support for pseudo-"in source tree" builds")

Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220702185604.46643-1-peter@pjd.dev>
[PMD: Mention commit dedad02720]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/avocado/avocado_qemu/__init__.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py
index b656a70c55..ed4853c805 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -120,14 +120,15 @@ def pick_default_qemu_bin(bin_prefix='qemu-system-', arch=None):
     # qemu binary path does not match arch for powerpc, handle it
     if 'ppc64le' in arch:
         arch = 'ppc64'
-    qemu_bin_relative_path = os.path.join(".", bin_prefix + arch)
-    if is_readable_executable_file(qemu_bin_relative_path):
-        return qemu_bin_relative_path
-
-    qemu_bin_from_bld_dir_path = os.path.join(BUILD_DIR,
-                                              qemu_bin_relative_path)
-    if is_readable_executable_file(qemu_bin_from_bld_dir_path):
-        return qemu_bin_from_bld_dir_path
+    qemu_bin_name = bin_prefix + arch
+    qemu_bin_paths = [
+        os.path.join(".", qemu_bin_name),
+        os.path.join(BUILD_DIR, qemu_bin_name),
+        os.path.join(BUILD_DIR, "build", qemu_bin_name),
+    ]
+    for path in qemu_bin_paths:
+        if is_readable_executable_file(path):
+            return path
     return None
 
 
-- 
2.36.1



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

* Re: [PULL 0/5] Darwin patches for 2022-07-12
  2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
                   ` (4 preceding siblings ...)
  2022-07-12 22:16 ` [PULL 5/5] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR Philippe Mathieu-Daudé via
@ 2022-07-14 13:25 ` Peter Maydell
  5 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2022-07-14 13:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Roman Bolshakov, Akihiko Odaki, Thomas Huth,
	Cameron Esfahani

On Tue, 12 Jul 2022 at 23:45, Philippe Mathieu-Daudé via
<qemu-devel@nongnu.org> wrote:
>
> The following changes since commit 8e3d85d36b77f11ad7bded3a2d48c1f0cc334f82:
>
>   Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-07-12 14:12:15 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/philmd/qemu.git tags/darwin-20220712
>
> for you to fetch changes up to 50b13d31f4cc6c70330cc3a92561a581fc176ec9:
>
>   avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR (2022-07-13 00:06:02 +0200)
>
> ----------------------------------------------------------------
> Darwin patches:
>
> - Enable RDTSCP support on HVF
> - ui/cocoa: Take refresh rate into account
>
> Few buildsys fixes:
>
> - Restrict TCG to emulation
> - Remove a unused-but-set-variable warning
> - Allow running Avocado from pseudo-"in source tree" builds
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.1
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2022-07-14 13:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 22:16 [PULL 0/5] Darwin patches for 2022-07-12 Philippe Mathieu-Daudé via
2022-07-12 22:16 ` [PULL 1/5] hvf: Enable RDTSCP support Philippe Mathieu-Daudé via
2022-07-12 22:16 ` [PULL 2/5] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
2022-07-12 22:16 ` [PULL 3/5] ui/cocoa: Fix switched_to_fullscreen warning Philippe Mathieu-Daudé via
2022-07-12 22:16 ` [PULL 4/5] ui/cocoa: Take refresh rate into account Philippe Mathieu-Daudé via
2022-07-12 22:16 ` [PULL 5/5] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR Philippe Mathieu-Daudé via
2022-07-14 13:25 ` [PULL 0/5] Darwin patches for 2022-07-12 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.