[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 3/4] checkpatch: add qemu_bh_new/aio_bh_new checks
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v5 3/4] checkpatch: add qemu_bh_new/aio_bh_new checks |
Date: |
Thu, 26 Jan 2023 09:57:14 -0500 |
On Thu, Jan 26, 2023 at 12:25:57AM -0500, Alexander Bulekov wrote:
> Advise authors to use the _guarded versions of the APIs, instead.
>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
> scripts/checkpatch.pl | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 6ecabfb2b5..61bb4b0a19 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2865,6 +2865,14 @@ sub process {
> if ($line =~ /\bsignal\s*\(/ && !($line =~ /SIG_(?:IGN|DFL)/)) {
> ERROR("use sigaction to establish signal handlers;
> signal is not portable\n" . $herecurr);
> }
> +# recommend qemu_bh_new_guarded instead of qemu_bh_new
> + if ($line =~ /\bqemu_bh_new\s*\(/) {
> + ERROR("use qemu_bh_new_guarded() instead of
> qemu_bh_new() to avoid reentrancy problems\n" . $herecurr);
> + }
> +# recommend aio_bh_new_guarded instead of aio_bh_new
> + if ($line =~ /\baio_bh_new\s*\(/) {
> + ERROR("use aio_bh_new_guarded() instead of aio_bh_new()
> to avoid reentrancy problems\n" . $herecurr);
> + }
These checks should be limited to source code in hw/. Other directories
can use BHs without MemReentrancyGuard.
Stefan
signature.asc
Description: PGP signature
- [PATCH v5 0/4] memory: prevent dma-reentracy issues, Alexander Bulekov, 2023/01/26
- [PATCH v5 0/4] memory: prevent dma-reentracy issues, Alexander Bulekov, 2023/01/26
- [PATCH v5 1/4] memory: prevent dma-reentracy issues, Alexander Bulekov, 2023/01/26
- [PATCH v5 2/4] async: Add an optional reentrancy guard to the BH API, Alexander Bulekov, 2023/01/26
- [PATCH v5 3/4] checkpatch: add qemu_bh_new/aio_bh_new checks, Alexander Bulekov, 2023/01/26
- Re: [PATCH v5 3/4] checkpatch: add qemu_bh_new/aio_bh_new checks,
Stefan Hajnoczi <=
- [PATCH v5 4/4] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded, Alexander Bulekov, 2023/01/26
- Re: [PATCH v5 0/4] memory: prevent dma-reentracy issues, Darren Kenny, 2023/01/26