From patchwork Mon Sep 2 19:58:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 1979751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=oOE0iRAf; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyKMc4QLHz1ygs for ; Tue, 3 Sep 2024 05:59:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 776D4385E83F for ; Mon, 2 Sep 2024 19:59:06 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 5D92C385EC0E for ; Mon, 2 Sep 2024 19:58:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D92C385EC0E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5D92C385EC0E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725307129; cv=none; b=dwTRGJp6HJbwFRqt6mZr1XgWS0ROTgW9TvmVvEtd90TNEHku90bdbJcO69x0t1WTfxxjNyx0d2Xgd14Q9ODEukgHgCWsfooky5YXwsCPEPTT11W2bB9LXw/DOl7pU67fEpHA0DcQxY9NxPrJbYXogW/qqd/B6mXPggSkl6fZLmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725307129; c=relaxed/simple; bh=t5CcksumHcTMY7lZXEcI3DhQIsDmNaRqYQuqHAPug/g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=d8w7ov12Ftzh2rAGHL1kxNjgyX0p+L/8OJx9gYM9CurBoK/xbt0GBx80Vq2mc3SNBnCdsLnF17clXaMSxqOAQiRFppY/hhFGi75+HIwdFgm75GLhJIpPsHFNbAXml8nGtZqxUQTdpQ5vf58jDI8hEQWiwqUtsR+6n6HxayOex1k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2059112f0a7so7848835ad.3 for ; Mon, 02 Sep 2024 12:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725307126; x=1725911926; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VzHE/wEc38r90FNXuwuPJCgjpDo1wVh1n7zN1jXtpj8=; b=oOE0iRAfVRKmkuxaXiLwwO6l0SuvX3tzx2WSLLt23V3JSoxNxLOhlJkKZpYjBCJXD2 uFrPYQE5n34oG8YdhDYq4vNthqt2tthGEhsaGXmaMbtgk1WXyRqTrv/67McEmq/EucPK RLmOWSl4eH2JZvD6h7cJucSOl7YIohhIPQL4cDE7lyXaR/2Mp7LMTxGrtpZbo0/I3yqe kqLBEiil7fnZkf58UUgyvfWbF4fjjDkrD85UGO154V5Ypb32p3FXXKh97uY2QSAhy0Gh B27IgNDVo6Hz0s159Y5j7RwJXRhWSSrkshJQTscOdK9WHz9MWUNwPSZflxtBsM1/eO3y Cs9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725307126; x=1725911926; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VzHE/wEc38r90FNXuwuPJCgjpDo1wVh1n7zN1jXtpj8=; b=VBgi21tKR0S5o2BPOEGnE7GkPkIyXU6bbi6v+O61t80XS9kmK+38BscfIP7VTojObv xZuKUttZYzbTK19USoSxRo+3uK+EmXm9IeURmiRTV1e269iF92ISD5ssLPKiID0U0p2j sBR/EgEE04rNrxmj3Uevej+ejmbwJVDzmQvsFbSUDGUcIID3Eu9god0Z6W3pUOzrAnvi s0LsRV6SIgEZHVvCc9jEn4M5U7nBUfPwg4y29Oz1AeosHVRXNqboee7tyoTd2YXepS6W J1Q8p8CVo4hOcK6FsZEPvokwtSiaIQQo4iIGgm6JO646mjfgn7WyWkg9kRzZc2uWPUCq vcPw== X-Gm-Message-State: AOJu0YzOdreSizYGRezWUEH2pOSMkSq82ttlEt8PX9w6nmgEXipkZKm3 L1ZBbkCbUPKLEpQ34k73XjQi7+oIKMCY+VjUPa3EAzjsj/L3VhI1xlBmwn4QpN2IcJ/leGRbsxT kUpM= X-Google-Smtp-Source: AGHT+IGwcB7dobh+VzZvTzDHlzPYPSTJ9433BOKUl5IKspsTT4WD26kQy+WhbB52nhYLo4uzWfzE1w== X-Received: by 2002:a17:902:ce11:b0:205:6114:9628 with SMTP id d9443c01a7336-20561149928mr47589655ad.7.1725307125674; Mon, 02 Sep 2024 12:58:45 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:e912:21a:cf7f:3adf:1e7f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2051553770fsm69521975ad.123.2024.09.02.12.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 12:58:45 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: John Paul Adrian Glaubitz , "Michael . Karcher" Subject: [PATCH] linux: sparc: Fix syscall_cancel for LEON Date: Mon, 2 Sep 2024 16:58:24 -0300 Message-ID: <20240902195841.1455273-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 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, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org LEON2/LEON3 are both sparcv8, which does not support branch hints (bne,pn) nor the return instruction. Checked with a build for sparcv8-linux-gnu targetting leon. I also check some cancellation tests with qemu-system (targeting LEON3). --- sysdeps/unix/sysv/linux/sparc/sparc32/syscall_cancel.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall_cancel.S b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall_cancel.S index aa5c658ce1..0db93c77bf 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall_cancel.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall_cancel.S @@ -42,7 +42,11 @@ __syscall_cancel_arch_start: __syscall_do_cancel() */ ld [%i0], %g2 andcc %g2, TCB_CANCELED_BITMASK, %g0 +#ifdef __sparcv9 bne,pn %icc, 2f +#else + bne 2f +#endif /* Issue a 6 argument syscall. */ mov %i1, %g1 mov %i2, %o0 @@ -60,8 +64,13 @@ __syscall_cancel_arch_end: sub %g0, %o0, %o0 1: mov %o0, %i0 +#ifdef __sparcv9 return %i7+8 nop +#else + jmp %i7+8 + restore +#endif 2: call __syscall_do_cancel, 0