From patchwork Mon Apr 10 20:46:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 67584 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9222A3855585 for ; Mon, 10 Apr 2023 20:47:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9222A3855585 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681159622; bh=9fyv7rH6GBBig5q7kjCTLj3SqeAYQEVEkSFYW4Z1y08=; 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=m6enfIsc+72P6NuCJQzLIKx7Q3yRoP7qiuhr38kRM0JrnOqSUxHmm+7r7VYOOB9uK vIAIoxsBtOf3hY4kE0aO6WEQABguhVtQs+XVxXL8D7uLlrwqmXkTXnbGb2fSIiS78q X4n2kWYyFUz9bGCAdtq7c8kQGymow/c230dso4do= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 484F03857716 for ; Mon, 10 Apr 2023 20:46:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 484F03857716 Received: by mail-oi1-x235.google.com with SMTP id be34so3988690oib.4 for ; Mon, 10 Apr 2023 13:46:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681159592; x=1683751592; 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=9fyv7rH6GBBig5q7kjCTLj3SqeAYQEVEkSFYW4Z1y08=; b=IM7fqgB18At0upUgigoLvWLk4tT4r+K/8ZwTB9tDe3fgQKIKvlknXkt0hDMnDOSjcS e3Z+IArmu+eBwVMoYYx/njni381JlPPsL8YCMv2K5rzbifnoAQonSPFc4Gw8+AMxlolh 3U22pxERxSj28arPBdD+3vtJpBtyRAkdR3nEWVjEQP4JsW9QBD72Fn8+qBaE5kyAa8yp NRYBn/Uy1SG7ZXdXcsXXxnaunTe/SV364Ti0qXwbRoFwOXKGR5A0789N3MR2+NmNSdFW Ovm43tANWIY82aPVar15hp7OTRSq5wZLBxE0Y9y7lDQ91DgZ2TvizDq7MCy/obgPPTJI nLQA== X-Gm-Message-State: AAQBX9cmaJixQesKlrdaCwB/j0imnGzwyynXwI9dES33gV3m6HnqLesq lbrl6TXd3o5I8y8zVyvnjYHPkUSEzWYhxnUFIsOlCA== X-Google-Smtp-Source: AKy350aFfBUagxzG76FRsU43V5uOEI5KXGVftkOL/LydzeieTUWadipegcMwp8qiO4CYNvbcHHis+A== X-Received: by 2002:a54:4115:0:b0:38b:5e4:9d3b with SMTP id l21-20020a544115000000b0038b05e49d3bmr5033233oic.4.1681159590587; Mon, 10 Apr 2023 13:46:30 -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.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:46:29 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v5 15/22] microblaze: Fix Race conditions in pthread cancellation [BZ#12683] Date: Mon, 10 Apr 2023 17:46:07 -0300 Message-Id: <20230410204614.4129551-7-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.8 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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.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 microblaze-linux-gnu. --- .../sysv/linux/microblaze/syscall_cancel.S | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S diff --git a/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S b/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S new file mode 100644 index 0000000000..1f9d202bf5 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S @@ -0,0 +1,61 @@ +/* Cancellable syscall wrapper. Linux/microblaze 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, + long int nr, + long int arg1, + long int arg2, + long int arg3, + long int arg4, + long int arg5, + long int arg6) */ + +ENTRY (__syscall_cancel_arch) + + .globl __syscall_cancel_arch_start +__syscall_cancel_arch_start: + + lwi r3,r5,0 + andi r3,r3,TCB_CANCELED_BITMASK + bneid r3,1f + addk r12,r6,r0 + + addk r5,r7,r0 + addk r6,r8,r0 + addk r7,r9,r0 + addk r8,r10,r0 + lwi r9,r1,56 + lwi r10,r1,60 + brki r14,8 + + .globl __syscall_cancel_arch_end +__syscall_cancel_arch_end: + + nop + lwi r15,r1,0 + rtsd r15,8 + addik r1,r1,28 + +1: + brlid r15, __syscall_do_cancel + nop + +END (__syscall_cancel_arch)