From patchwork Sat Apr 15 21:28:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 673522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81093C77B73 for ; Sat, 15 Apr 2023 21:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjDOV2x (ORCPT ); Sat, 15 Apr 2023 17:28:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbjDOV2w (ORCPT ); Sat, 15 Apr 2023 17:28:52 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7762430D8; Sat, 15 Apr 2023 14:28:50 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1681594128; bh=ffuzWbsBT4I0Dzm1ac4bREAFCsDITc0shbz2IoN6G7s=; h=From:Subject:Date:To:Cc:From; b=JQ91D5LOfZi7AADvHsorsBSrap9gQCs8WEn0nMe8bBwPKEMCzeBDCX6OKzrKIRpwt xUynC+oE2TFmFmP9/5/2YCcvi7szYJv52lxYwCqzHrYvd+pP8OeOD/lpBii3kO/uaj agOxYkduxAOiU+wS4nrfXQDiMUcwL8KNBxewqJq0= Subject: [PATCH 0/2] tools/nolibc: fork: fix on s390 and add test Date: Sat, 15 Apr 2023 23:28:46 +0200 Message-Id: <20230415-nolibc-fork-v1-0-9747c73651c5@weissschuh.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAA4XO2QC/x2NSQrDMAwAvxJ0rsDOTr5SerBdpRExcpBpKYT8v aLHGRjmhErKVGFpTlD6cOUiBv7WQNqCvAj5aQytazvX+wGlZI4J16I7xsnNU+j6wY8jWBFDJYw aJG3WyDtnk4fSyt//4v64rh8WSOKecgAAAA== To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681594127; l=927; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ffuzWbsBT4I0Dzm1ac4bREAFCsDITc0shbz2IoN6G7s=; b=NT6hmRBQG7jQ+hw3g97sTAG6HwkeHoAj7Vr246YpEyxNiOXxpnKGk8rbLG7vK6UPH9v6ByOiZ R9vZTgycSdFAY3WiAD5lubtvCE2s1Z96Pu93wFWFKPmTPxnBg1I37Ok X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The generic fork() implementation in nolibc falls back to the clone() syscall. On s390 the first two arguments to clone() are swapped compared to other architectures, breaking the implementation in nolibc. Add a custom implementation of fork() to s390 that works. While at it also add a testcase for fork(). Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (2): tools/nolibc: s390: provide custom implementation for sys_fork tools/nolibc: add testcase for fork()/waitpid() tools/include/nolibc/arch-s390.h | 8 ++++++++ tools/include/nolibc/sys.h | 2 ++ tools/testing/selftests/nolibc/nolibc-test.c | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) --- base-commit: c1c4f33b6be9b3412d9e0ba01b367f4ffe47c379 change-id: 20230415-nolibc-fork-b7087a345166 Best regards,