From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Alexander Graf <agraf@csgraf.de>,
Mohamed Mediouni <mohamed@unpredictable.fr>,
Pedro Barbuda <pbarbuda@microsoft.com>,
qemu-arm@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH v7 0/8] target/arm: fully model WFxT instructions for A-profile
Date: Fri, 12 Jun 2026 18:18:51 +0100 [thread overview]
Message-ID: <87h5n7ekxw.fsf@draig.linaro.org> (raw)
In-Reply-To: <CAFEAcA94+mh_pigFDi+tEPRJ416fSWfxsQ1Lj8Byemug9kBp6w@mail.gmail.com> (Peter Maydell's message of "Mon, 8 Jun 2026 14:51:24 +0100")
Peter Maydell <peter.maydell@linaro.org> writes:
> On Fri, 29 May 2026 at 09:29, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> This series fully models the behaviour of WFxT instructions. We
>> already had support for WFE for M-profile but we left off A-profile as
>> it has more potential sources of wake-ups. The main one is the event
>> stream which includes events from significant bits of the timer
>> ticking over.
>>
>> The refactoring from the previous iterations of the patch have now
>> been merged.
>>
>> I've dropped trying to fully model the global monitor in favour of
>> taking advantage of the architectural flexibility to have an IMPDEF
>> event wake up for any reason. We treat the setting of exclusive_addr
>> as such a reason because it indicates the current vCPU is in a ldstx
>> exclusive region and we don't want the guest to deadlock. This does mean
>> the system won't sleep on WFE enabled locks but people shouldn't be
>> relying on QEMU to model real world sleep patterns anyway given the
>> efficiency of emulation compared to real HW.
>>
>> I've written a test case using kvm-unit-tests:
>>
>> Message-ID: <20260527111822.1563679-1-alex.bennee@linaro.org>
>> Date: Wed, 27 May 2026 12:18:21 +0100
>> Subject: [kvm-unit-tests PATCH v2] arm: add wfx test case
>> From: =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>
>>
>> All patches are now reviewed.
>
>
>
> Applied to target-arm.next, thanks.
Is it too late to drop them? I've a fix for 2/8:
--8<---------------cut here---------------start------------->8---
modified include/hw/core/sysemu-cpu-ops.h
@@ -18,6 +18,9 @@
typedef struct SysemuCPUOps {
/**
* @has_work: Callback for checking if there is work to do.
+ *
+ * This function should be idempotent (i.e. not change state) as
+ * it will likely be queried multiple times before a CPU resumes.
*/
bool (*has_work)(CPUState *cpu); /* MANDATORY NON-NULL */
/**
modified target/arm/cpu.c
@@ -158,7 +158,6 @@ static bool arm_cpu_has_work(CPUState *cs)
* A wake-up event should only wake us if we are halted on a WFE
*/
if (cpu->env.halt_reason == HALT_WFE && cpu->env.event_register) {
- cpu->env.halt_reason = NOT_HALTED;
return true;
}
@@ -170,7 +169,6 @@ static bool arm_cpu_has_work(CPUState *cs)
| CPU_INTERRUPT_NMI | CPU_INTERRUPT_VINMI | CPU_INTERRUPT_VFNMI
| CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_VSERR
| CPU_INTERRUPT_EXITTB)) {
- cpu->env.halt_reason = NOT_HALTED;
return true;
}
@@ -874,6 +872,8 @@ bool arm_cpu_exec_halt(CPUState *cs)
if (cpu->wfxt_timer) {
timer_del(cpu->wfxt_timer);
}
+ /* clear the halt reason */
+ cpu->env.halt_reason = NOT_HALTED;
}
return leave_halt;
}
--8<---------------cut here---------------end--------------->8---
>
> -- PMM
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2026-06-12 17:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 8:29 [PATCH v7 0/8] target/arm: fully model WFxT instructions for A-profile Alex Bennée
2026-05-29 8:29 ` [PATCH v7 1/8] target/arm: fix WFET typo in syndrome Alex Bennée
2026-05-29 8:29 ` [PATCH v7 2/8] target/arm: teach arm_cpu_has_work about halting reasons Alex Bennée
2026-05-29 8:29 ` [PATCH v7 3/8] target/arm: redefine event stream fields Alex Bennée
2026-05-29 8:29 ` [PATCH v7 4/8] target/arm: ensure aarch64 DISAS_WFE will exit Alex Bennée
2026-05-29 8:29 ` [PATCH v7 5/8] target/arm: implements SEV/SEVL for all modes Alex Bennée
2026-06-08 15:52 ` Peter Maydell
2026-05-29 8:29 ` [PATCH v7 6/8] target/arm: enable event stream on WFE instructions Alex Bennée
2026-05-29 8:29 ` [PATCH v7 7/8] target/arm: handle the WFE trap case Alex Bennée
2026-06-08 15:53 ` Peter Maydell
2026-05-29 8:29 ` [PATCH v7 8/8] target/arm: implement WFET Alex Bennée
2026-06-08 13:51 ` [PATCH v7 0/8] target/arm: fully model WFxT instructions for A-profile Peter Maydell
2026-06-08 15:54 ` Peter Maydell
2026-06-08 17:01 ` Alex Bennée
2026-06-12 17:18 ` Alex Bennée [this message]
2026-06-12 17:46 ` Peter Maydell
2026-06-12 18:50 ` Alex Bennée
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=87h5n7ekxw.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=agraf@csgraf.de \
--cc=kvm@vger.kernel.org \
--cc=mohamed@unpredictable.fr \
--cc=pbarbuda@microsoft.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox