From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, Kevin Wolf <kwolf@redhat.com>
Subject: Re: Your clang TSA patches
Date: Tue, 9 May 2023 06:54:24 -0400 [thread overview]
Message-ID: <CAJSP0QVXUhq2umitm5vOEr-XMkP5L1TJ2oO9YqKT+FwehJ-inQ@mail.gmail.com> (raw)
In-Reply-To: <CAJ+F1CJXaE+1O_93QuAiZ8Zddhc9hRp2X3Umc1whSqrPDXxEyg@mail.gmail.com>
On Tue, 9 May 2023 at 03:01, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi Stefan
>
> On Mon, May 8, 2023 at 6:54 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>
>> Hi Marc-André,
>> clang's Thread Safety Analysis is being used more in the QEMU block
>> layer and a few limitations have been hit:
>> 1. Mutexes that are struct fields are not supported (only global mutexes work).
>> 2. Analysis does not extend across function pointers. See
>> GRAPH_RDLOCK_PTR for a workaround that is currently used.
>>
>> (There was a third limitation that I don't remember. Maybe Kevin remembers.)
>>
>> I heard you had clang or LLVM patches in that past that improve TSA.
>> Did your patches address these things? Any idea how hard it is to fix
>> these limitations?
>
>
>
> I don't remember much about that work, I didn't spend that much time on it, and it was 5y ago already!
>
> My WIP branch is still available: https://github.com/elmarco/clang/commits/qemu-ta
>
> it seems I was trying to modify clang to support TSA annotations on typedef and function pointers, and warn on unmatching. I have no idea if this is still relevant. I remember dropping the effort at that time because of lack of interest or help in both projects.
Thanks! The changes seem small enough that it may be possible to get
them merged without a major time commitment.
It seems the function pointer analysis limitation still exists after
these 5 years :).
Stefan
prev parent reply other threads:[~2023-05-09 10:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 14:53 Your clang TSA patches Stefan Hajnoczi
2023-05-09 7:00 ` Marc-André Lureau
2023-05-09 8:45 ` Kevin Wolf
2023-05-09 10:54 ` Stefan Hajnoczi [this message]
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=CAJSP0QVXUhq2umitm5vOEr-XMkP5L1TJ2oO9YqKT+FwehJ-inQ@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).