From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0EB1224EA for ; Wed, 29 Jan 2025 13:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738156922; cv=none; b=sYGgmZyciNoR3DZ3pYponI6gDMKlJy2C5yiYafBE+DOcXJe8mxKe+LhtssysZjZVK/1weFWLhjk6uyu154KZas6QyQLqj8GYs4mvou+LueV213DWEoc7l17kWxJR/uMBoDmv4cXWCR/gdlySFYgLk7pQ3jQGcXTilHChjuc9XCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738156922; c=relaxed/simple; bh=vwE6bRz0XtyXVQDsvbqyZMY4NvQV9ou81e5CungF+RY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=c6qiz8jt9O+iIPiOkcmFIlZJLDzrEMs6E7la8HnMPrBuhXlruAnCBLFvdOtSxvI1ZVfWPh2MHPO3445n+1BnGv59jd+Xg20RfgOLQNohflv9Kfn2tZzJGS2RBbPCjsxHj3nqS/Vut2KAJQ8t+6f+bokPPRceMOEyS92g8Kr39gQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ijqN3Ax1; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ijqN3Ax1" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2165cb60719so121984655ad.0 for ; Wed, 29 Jan 2025 05:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738156920; x=1738761720; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HX1TkHswfT325KOgLa+jpVFqKADYpAnjaP7bwf4ZtvQ=; b=ijqN3Ax1Co420ZhzlOw7veA88XteU4V4+HVrO0woAsDDXnn6EeJpq+KgF1GIUlAtzm fhKfFyKEcBqbgW1zrnXxD+Y4ieS/mwwdTehzE84Te86YCDzWp83wRfeUbNRE64FdE2mZ c2qaZ7+5vO1GvM2qXRNPWZ7N4JHjNAlcOAOLxuZ5YKlWxa5PvlsquPgFDmlt6hdO1oxm S34rK/jbipCG8z4Ej6zmLmf0ppbaedgJAxhPvs49wNXfjF5lko13LkaFd9wLJGqlbloQ MbSPwuC8IxBBe6/ow4qCcGgi4WnA+15gfMTNkEZSlS/S7gS3CnI4IBxq38epcDr02gP5 vRhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738156920; x=1738761720; 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=HX1TkHswfT325KOgLa+jpVFqKADYpAnjaP7bwf4ZtvQ=; b=JVtzp4coqGhIpXYaf4LeEXyeyozRGdSVkOVlI95xOFPnU6C0fwFh/FUHFRAonyKabD WcwcU9D3zBRGgbSQ9QyCjf4cpDBfZCbE315VPA1sZJIcl0KBcQyco0QX+HL6TbD1xeTF EVbxZLFfrbdPOnyB9GcTdQoU+IqX9W0Vfj3HLgy+XdfRhVUUC12vJXrC9HPlP6dc1Mi/ LQmtdxFI7+98OiDonbBW1d/LZD7ysA/G0A+PcsP9P0SQ52cGmVJcT8PBpwBZcBy31EZ9 2Uy2skDXhdRUmkn7tYsnPmNiIPx/K3tiB+sKKOF0dO7cyOF6zdsbkX+vyd4Y3781PKZU mF/w== X-Forwarded-Encrypted: i=1; AJvYcCU6pvMpMpFgboG+k2Vf8R1Rh8S/041khk2wVGu8Za5RiHmLCSufILCIgIwtFxxCfrRgNIHWyzRdWUNzQXs=@vger.kernel.org X-Gm-Message-State: AOJu0YwS8h3sSFe8wS+V5Zq4gMF+Rei2+YTO3EFZ+QXP2BlAmelm5D9e B4lfQyQUC9rfy0EQRem+RhL7U0JX5BGGIWumC6DgNjmdfHSqFzde X-Gm-Gg: ASbGnctsjqOhbrpQZFyt5sGnfE1Cb8CMotY0saP3GAwJSzkWyZTeuNZw8/9Wkxt0iEt WGEGqwhJ8uCfbc/kToNJohnBqwrqWNX7VjR+fm+UoPH1skzmj9LVPu4dhFbByZrvOl3KBfUEOMc bsh5wfomzPM+GvnEXmsrphrFtXewxfMCw8vw0UqR+T4JqrSbA6nK1nmr94eo7FnOfco5wVMaq1I 6j5alvvdX74/eMnDldDUbKoZa3GZK5zXwikEH+nPCxCBHnb15S1l2xCowDSKq0uZ3cZgJX6+PFB lyyJN1+F4IdoeVywb29roMCDXWawsNGDp7Oj78bBGAqvZWD60w== X-Google-Smtp-Source: AGHT+IGNZ+4sXAE9vj4IFlC2EXBWvLaRHv9Oiar/2blCQ1GBjBPs9Irv6Mh9HPXqMcWBqz4u+zX/7w== X-Received: by 2002:a17:902:e742:b0:215:a97a:c6bb with SMTP id d9443c01a7336-21dd7c65891mr47442355ad.12.1738156918464; Wed, 29 Jan 2025 05:21:58 -0800 (PST) Received: from wheely.local0.net (124-169-212-233.tpgi.com.au. [124.169.212.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da414131esm98984085ad.157.2025.01.29.05.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2025 05:21:57 -0800 (PST) From: Nicholas Piggin To: "Dmitry V. Levin" Cc: Nicholas Piggin , Oleg Nesterov , Eugene Syromyatnikov , Mike Frysinger , Renzo Davoli , Davide Berardi , strace-devel@lists.strace.io, Madhavan Srinivasan , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/2] powerpc: change syscall error return scheme Date: Wed, 29 Jan 2025 23:21:41 +1000 Message-ID: <20250129132148.301937-1-npiggin@gmail.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, I've been toying with the seccomp vs syscall return value problems, and wonder if something like this approach could give us a simpler alternative. Basically all the core code uses -errno return value, then we convert it to the powerpc convention at the last minute when returning. This seems to pass the seccomp_bpf test cases when applied with the set syscall info ptrace patches https://lore.kernel.org/lkml/20250113171054.GA589@strace.io/ With patch 1 of that series reverted. One concern is working out exact details of what tracers can see and trying to ensure it doesn't break some corner case. This could possibly be done for the other weird archs too, if it works out for powerpc Thanks, Nick Nicholas Piggin (2): powerpc/signal: Clean up pt_regs access powerpc/syscall: rework syscall return value handling arch/powerpc/include/asm/ptrace.h | 13 +--- arch/powerpc/include/asm/syscall.h | 31 +-------- arch/powerpc/kernel/interrupt.c | 16 +++-- arch/powerpc/kernel/signal.c | 67 ++++++++++--------- arch/powerpc/kernel/signal_64.c | 5 +- tools/testing/selftests/seccomp/seccomp_bpf.c | 16 +++++ 6 files changed, 69 insertions(+), 79 deletions(-) -- 2.47.1