From patchwork Mon Apr 10 20:46:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 1767317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=PpI98+tg; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PwLdD1g17z1ybB for ; Tue, 11 Apr 2023 06:47:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 17739385354A for ; Mon, 10 Apr 2023 20:47:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17739385354A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681159646; bh=X8hQ9l79CLZQ+5d5bwfqB6Kl4hUTqaolhYhB2jWtcBA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PpI98+tgstt72F8mqbD7iE2gT2mAgwH0awv4jEFq6tl18MetEzV91NLO9lh6W/Vve gi2XxBFfNExDapqLkLdJ4d4f/m94Z+t0xmMKZOTBITLWJ39MYTt+XzXxsYMS69hoE7 AaJvbwSZgYMf3wnR2amwybDJg4IjrW8mPcrrhM/I= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id 700C73858C62 for ; Mon, 10 Apr 2023 20:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 700C73858C62 Received: by mail-oi1-x233.google.com with SMTP id bf5so4072924oib.8 for ; Mon, 10 Apr 2023 13:46:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681159584; x=1683751584; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X8hQ9l79CLZQ+5d5bwfqB6Kl4hUTqaolhYhB2jWtcBA=; b=7NX22pF/SZxHxRVZXxgXyGKlTyNiBuErWPtF/34znKEbrGg4DRn9BUiVYHa6slxrL3 ZGs8Cp92QCVvwQFPRn6k5wKN2i5NXQi2b/ftezbs4+TpplD17dx5Cr1D41z5OuZ+yf59 PwZ/W/In/qrEWH4LcKGAHUlgUGO0VmYkUD0Cf13hHwY5AQTPZSkb3KFTKTVLKdDCpcFV RVKWS3NHiPYzjeES7PbaIVr/Z2BhQq0tLFFaB1HS6FWEzaq0WU9eUNVha+0Tv4ojoWqC IUEdXzg1E7Ky7WhS7bdsw62gmZjo9J47aVspzpEtOrV5WnXLuY39WWkhLM0Ch2ROU9sv Szig== X-Gm-Message-State: AAQBX9djFKfdWsb5NG4eLEoEDUeYf7EpQxdIYr74Bad6Ufcktp5HUTut uxRlp0a1M0Q188bjN1HQA74VHizsPypG5BX3OlNrVA== X-Google-Smtp-Source: AKy350Z2N2g25Ouqtku451bZaPlx6+ipzY6AbamX+edsmrU6yhYzxwwubNHPN1chmLpCmCx9xwzyaw== X-Received: by 2002:a05:6808:1805:b0:389:6b98:32db with SMTP id bh5-20020a056808180500b003896b9832dbmr5824456oib.14.1681159583740; Mon, 10 Apr 2023 13:46:23 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:55a1:d59a:609a:284:6ed]) by smtp.gmail.com with ESMTPSA id p5-20020acabf05000000b003896f132821sm4865732oif.41.2023.04.10.13.46.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:46:23 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v5 11/22] arc: Fix Race conditions in pthread cancellation [BZ #12683] Date: Mon, 10 Apr 2023 17:46:03 -0300 Message-Id: <20230410204614.4129551-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410204614.4129551-1-adhemerval.zanella@linaro.org> References: <20230410195907.4123869-1-adhemerval.zanella@linaro.org> <20230410204614.4129551-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" By adding the required syscall_cancel.S. Checked against a build and make check run-built-tests=no for arc-linux-gnu, arc-linux-gnuhf, and arceb-linux-gnu. --- sysdeps/unix/sysv/linux/arc/syscall_cancel.S | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/arc/syscall_cancel.S diff --git a/sysdeps/unix/sysv/linux/arc/syscall_cancel.S b/sysdeps/unix/sysv/linux/arc/syscall_cancel.S new file mode 100644 index 0000000000..fa02af4163 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arc/syscall_cancel.S @@ -0,0 +1,56 @@ +/* Cancellable syscall wrapper. Linux/ARC version. + Copyright (C) 2023 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +/* long int __syscall_cancel_arch (int *cancelhandling, + __syscall_arg_t nr, + __syscall_arg_t arg1, + __syscall_arg_t arg2, + __syscall_arg_t arg3, + __syscall_arg_t arg4, + __syscall_arg_t arg5, + __syscall_arg_t arg6) */ + +ENTRY (__syscall_cancel_arch) + + .globl __syscall_cancel_arch_start +__syscall_cancel_arch_start: + ld_s r12,[r0] + bbit1 r12, TCB_CANCELED_BITMASK, 1f + mov_s r8, r1 + mov_s r0, r2 + mov_s r1, r3 + mov_s r2, r4 + mov_s r3, r5 + mov_s r4, r6 + mov_s r5, r7 + trap_s 0 + + .globl __syscall_cancel_arch_end +__syscall_cancel_arch_end: + j_s [blink] + + .align 4 +1: push_s blink + cfi_def_cfa_offset (4) + cfi_offset (31, -4) + bl @__syscall_do_cancel + +END (__syscall_cancel_arch)