From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: fam@euphon.net, berrange@redhat.com,
David Hildenbrand <david@redhat.com>,
qemu-devel@nongnu.org, f4bug@amsat.org, stefanha@redhat.com,
crosa@redhat.com, pbonzini@redhat.com,
Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>,
aurelien@aurel32.net
Subject: Re: [PATCH v1 1/7] softmmu: fix watchpoint-interrupt races
Date: Wed, 24 Nov 2021 10:22:08 +0000 [thread overview]
Message-ID: <87bl29j1jg.fsf@linaro.org> (raw)
In-Reply-To: <65658e1d-43cf-d61b-3064-32cf670d903e@linaro.org>
Richard Henderson <richard.henderson@linaro.org> writes:
> On 11/23/21 9:57 PM, Alex Bennée wrote:
>> From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
>> Watchpoint may be processed in two phases. First one is detecting
>> the instruction with target memory access. And the second one is
>> executing only one instruction and setting the debug interrupt flag.
>> Hardware interrupts can break this sequence when they happen after
>> the first watchpoint phase.
>> This patch postpones the interrupt request until watchpoint is
>> processed.
>> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>> Reviewed-by: David Hildenbrand <david@redhat.com>
>> Message-Id: <163662451431.125458.14945698834107669531.stgit@pasha-ThinkPad-X280>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>> accel/tcg/cpu-exec.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
>> index 2d14d02f6c..9cb892e326 100644
>> --- a/accel/tcg/cpu-exec.c
>> +++ b/accel/tcg/cpu-exec.c
>> @@ -742,6 +742,11 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
>> qemu_mutex_unlock_iothread();
>> return true;
>> }
>> + /* Process watchpoints first, or interrupts will ruin everything */
>> + if (cpu->watchpoint_hit) {
>> + qemu_mutex_unlock_iothread();
>> + return false;
>> + }
>
> I think this is redundant with the next patch.
OK I'll drop it. The function is getting messy anyway.
--
Alex Bennée
next prev parent reply other threads:[~2021-11-24 10:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 20:57 [PATCH for 6.2 v1 0/7] more tcg, plugin, test and build fixes Alex Bennée
2021-11-23 20:57 ` [PATCH v1 1/7] softmmu: fix watchpoint-interrupt races Alex Bennée
2021-11-24 7:38 ` Richard Henderson
2021-11-24 10:22 ` Alex Bennée [this message]
2021-11-23 20:57 ` [PATCH v1 2/7] accel/tcg: suppress IRQ check for special TBs Alex Bennée
2021-11-24 9:23 ` Richard Henderson
2021-11-24 10:24 ` Alex Bennée
2021-11-24 14:42 ` Richard Henderson
2021-11-24 16:04 ` Alex Bennée
2021-11-23 20:57 ` [PATCH v1 3/7] tests/avocado: fix tcg_plugin mem access count test Alex Bennée
2021-11-24 7:20 ` Philippe Mathieu-Daudé
2021-11-24 9:30 ` Richard Henderson
2021-11-23 20:57 ` [PATCH v1 4/7] plugins/meson.build: fix linker issue with weird paths Alex Bennée
2021-11-24 7:18 ` Philippe Mathieu-Daudé
2021-11-23 20:57 ` [PATCH v1 5/7] gdbstub: handle a potentially racing TaskState Alex Bennée
2021-11-23 20:57 ` [PATCH v1 6/7] MAINTAINERS: Remove me as a reviewer for the build and test/avocado Alex Bennée
2021-11-23 20:57 ` [PATCH v1 7/7] MAINTAINERS: Add section for Aarch64 GitLab custom runner 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=87bl29j1jg.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=crosa@redhat.com \
--cc=david@redhat.com \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=pavel.dovgalyuk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).