All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Richard Henderson <richard.henderson@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Huth <thuth@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v7 12/40] accel/qtest: Implement AccelOpsClass::has_work()
Date: Sat, 25 Sep 2021 18:01:54 +0200	[thread overview]
Message-ID: <b5f7eccb-7b19-02c2-bef7-c8cf9e544440@amsat.org> (raw)
In-Reply-To: <e1c7cb21-459e-15a3-7d99-da30c174ea76@linaro.org>

On 9/25/21 17:32, Richard Henderson wrote:
> On 9/25/21 11:27 AM, Philippe Mathieu-Daudé wrote:
>>> +static bool qtest_cpu_has_work(CPUState *cpu)
>>> +{
>>> +    g_assert_not_reached();
>>> +}
>>
>> Sigh, this triggers:
>>
>> Running test qtest-i386/cpu-plug-test
>> **
>> ERROR:../accel/qtest/qtest.c:52:qtest_cpu_has_work: code should not be 
>> reached
>> ERROR qtest-i386/cpu-plug-test - Bail out! 
>> ERROR:../accel/qtest/qtest.c:52:qtest_cpu_has_work: code should not be 
>> reached
>> Broken pipe
> 
> Ha ha, yes.  You beat me to the reply within minutes.
> 
>> I suppose it is in my interest to 'return false' here and call it
>> a day...
> 
> I *think* that's the right thing, but I could see maybe "true" also 
> makes sense.  I'll try and have a closer look.

So first I tested using "-machine pc,accel=qtest" -> no crash.

Looking closely at how check-qtest calls QEMU, it does:
"-machine pc -accel qtest". Isn't the sugar property supposed
to work that way?

Then the backtrace is:

Thread 5 "qemu-system-i38" hit Breakpoint 1, qtest_cpu_has_work 
(cpu=0x555556a08400) at accel/qtest/qtest.c:52
52          g_assert_not_reached();
(gdb) bt
#0  qtest_cpu_has_work (cpu=0x555556a08400) at accel/qtest/qtest.c:52
#1  0x0000555555c330ba in cpu_has_work (cpu=0x555556a08400) at 
softmmu/cpus.c:254
#2  0x0000555555c32ac8 in cpu_thread_is_idle (cpu=0x555556a08400) at 
softmmu/cpus.c:91
#3  0x0000555555c33584 in qemu_wait_io_event (cpu=0x555556a08400) at 
softmmu/cpus.c:417
#4  0x0000555555d8a7f4 in dummy_cpu_thread_fn (arg=0x555556a08400) at 
accel/dummy-cpus.c:53
#5  0x0000555555f469f6 in qemu_thread_start (args=0x5555574edae0) at 
util/qemu-thread-posix.c:557
#6  0x00007ffff4ff3299 in start_thread () at /lib64/libpthread.so.0
#7  0x00007ffff4f1b353 in clone () at /lib64/libc.so.6

dummy_cpu_thread_fn() content didn't change since its introduction
in commit c7f0f3b1c82 ("qtest: add test framework"):

    "The idea behind qtest is pretty simple.  Instead of executing
     a CPU via TCG or KVM, rely on an external process to send events
     to the device model that the CPU would normally generate."

Based on that description, qtest should provide a command to notify
whether the CPU has work to do or not.

Meanwhile, no qtest command = no work = 'return false'.


  reply	other threads:[~2021-09-25 16:07 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 14:50 [PATCH v7 00/40] accel: Move has_work() from CPUClass to AccelOpsClass Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 01/40] accel: Simplify qemu_init_vcpu() Philippe Mathieu-Daudé
2021-09-25 15:25   ` Richard Henderson
2021-09-25 14:50 ` [PATCH v7 02/40] hw/core: Restrict cpu_has_work() to sysemu Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 03/40] hw/core: Un-inline cpu_has_work() Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 04/40] hw/core: Move cpu_common_has_work() to cpu_has_work() Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 05/40] accel: Introduce AccelOpsClass::has_work() Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 06/40] accel/kvm: Implement AccelOpsClass::has_work() Philippe Mathieu-Daudé
2021-09-25 14:50   ` Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 07/40] accel/whpx: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 08/40] accel/hvf: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 09/40] accel/xen: " Philippe Mathieu-Daudé
2021-09-25 14:50   ` Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 10/40] accel/hax: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 11/40] accel/nvmm: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 12/40] accel/qtest: " Philippe Mathieu-Daudé
2021-09-25 15:27   ` Philippe Mathieu-Daudé
2021-09-25 15:32     ` Richard Henderson
2021-09-25 16:01       ` Philippe Mathieu-Daudé [this message]
2021-09-27  6:12         ` Laurent Vivier
2021-09-25 14:50 ` [PATCH v7 13/40] accel/tcg: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 14/40] accel: Simplify cpu_has_work() Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 15/40] accel/tcg: Introduce TCGCPUOps::has_work() Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 16/40] target/arm: Explicit v7M cores use arm_cpu_has_work as CPUClass:has_work Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 17/40] target/arm: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 18/40] target/alpha: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 19/40] target/avr: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 20/40] target/cris: " Philippe Mathieu-Daudé
2021-09-25 14:50 ` [PATCH v7 21/40] target/hexagon: Remove unused has_work() handler Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 22/40] target/hppa: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 23/40] target/i386: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 24/40] target/m68k: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 25/40] target/microblaze: " Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 26/40] target/mips: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 27/40] target/nios2: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 28/40] target/openrisc: " Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 29/40] target/ppc: Introduce PowerPCCPUClass::has_work() Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 30/40] target/ppc: Restrict has_work() handlers to sysemu and TCG Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 31/40] target/riscv: Restrict has_work() handler " Philippe Mathieu-Daudé
2021-09-25 14:51   ` Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 32/40] target/rx: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 33/40] target/s390x: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 34/40] target/sh4: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 35/40] target/sparc: Remove pointless use of CONFIG_TCG definition Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 36/40] target/sparc: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 37/40] target/tricore: " Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 38/40] target/xtensa: " Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 39/40] accel/tcg: Remove CPUClass::has_work() Philippe Mathieu-Daudé
2021-09-25 14:51 ` [PATCH v7 40/40] accel/tcg: Simplify tcg_cpu_has_work() Philippe Mathieu-Daudé
2021-09-25 15:28 ` [PATCH v7 00/40] accel: Move has_work() from CPUClass to AccelOpsClass Richard Henderson
2021-09-25 15:36   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5f7eccb-7b19-02c2-bef7-c8cf9e544440@amsat.org \
    --to=f4bug@amsat.org \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.