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 Netto X-Patchwork-Id: 824694 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp2099159wrs; Mon, 2 Sep 2024 12:58:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTr/RAUOXhY2qR85tUxo55+5fMnhXVHMrFwo4XVrpxq2d1oeb2s+1Q7fw7gmwaghPfYU5uJw==@linaro.org X-Google-Smtp-Source: AGHT+IECheaz0Da5Hyk65k7Yreppmm3A3fgbekTmq0fSZizOQkl8MnC3UOKvMfcdwKNpg2/2LBYX X-Received: by 2002:a05:6830:720a:b0:70f:75a6:1f26 with SMTP id 46e09a7af769-70f75a620d0mr9197523a34.16.1725307139689; Mon, 02 Sep 2024 12:58:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725307139; cv=pass; d=google.com; s=arc-20160816; b=NziMvBvjoMG6I9GoDftKBTGJ7TCoT0IYMsg7PtBjb907WWZ5kJZjjd9hhVG7vRw7cm X0o++EdRJZMbyIpIHGaEmFxBogtLfwlColT62MepRiGGRyKVWPO+Y047zb0U0D04a1mm 8cVSmYr/HwUBINKov/I2oyptBmLKRxMzwE8VVoqxb3OTe0AvdWvF57REB1hhcjI7FEOa ltPW+xxNyL/1JdYSEnVjhqS1J88hOIkot3U3dXdjB8HRA8egneNCZwnaiiziwxgiqRbF fsGBxK8AjymkhU7bEIi8VYMSE0pNDRrEaKIOn7LQXk3bt7CnALFNEZCfTpwvf6vbjM3p 8s6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=VzHE/wEc38r90FNXuwuPJCgjpDo1wVh1n7zN1jXtpj8=; fh=yhgXGVPNhljh7euVmfLkaJrVSd6EcwAGzd5MQHYzmGE=; b=A5I5r2QXUVGMsWvlIw3PXm/XM5hzcJvvnJvEmUyhxsBioVn6LZ5IPYB6/pTEwO+3SH tsnB/trR3xfew5JKtRSjKpcTy2vjaQh8VYiUUEs3A1wMjNM2Mq/ZkSuv4w/dvH/2uGIN YRQ7zsdNxshyI4krg8Lbz3xY6s4YFDchPB+28yb5owaPhRnbrAiMLpzV0IeIzteRZrnI X8aq39cAasHOKuowojNXTxyfyWXkW4+vkydaNYmpQi0GTkKBRnAveO1xOGplyWWAq2oi rU9g10sYeoojz3ZU805a0pnN+V09rNJnlYzyWeQGbH8QX5nxV8wzDlXWEpsd83Z8DKki i+Bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oOE0iRAf; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d75a77b69052e-45682d7b3a0si112218871cf.426.2024.09.02.12.58.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 12:58:59 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oOE0iRAf; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AABA385EC1A for ; Mon, 2 Sep 2024 19:58:59 +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-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~patch=linaro.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). Acked-by: John Paul Adrian Glaubitz --- 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