[{"id":3676942,"web_url":"http://patchwork.ozlabs.org/comment/3676942/","msgid":"<934e73a1-0dcc-499c-b0c4-bbcc3cfe26f2@linaro.org>","list_archive_url":null,"date":"2026-04-13T22:20:58","subject":"Re: [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD","submitter":{"id":85046,"url":"http://patchwork.ozlabs.org/api/people/85046/","name":"Philippe Mathieu-Daudé","email":"philmd@linaro.org"},"content":"On 13/4/26 17:31, Warner Losh wrote:\n> Generate the syscall numbers from the installed header that has them.\n> Ideally, we'd use FreeBSD's lua infra for this, but that requires that\n> we have those files installed, and they aren't quite the same across\n> supported versions yet, so use this simple, but effective hack.\n> \n> Signed-off-by: Warner Losh <imp@bsdimp.com>\n> ---\n>   bsd-user/freebsd/syscallhdr.sh | 9 +++++++++\n>   1 file changed, 9 insertions(+)\n> \n> diff --git a/bsd-user/freebsd/syscallhdr.sh b/bsd-user/freebsd/syscallhdr.sh\n> new file mode 100644\n> index 0000000000..fa38500775\n> --- /dev/null\n> +++ b/bsd-user/freebsd/syscallhdr.sh\n> @@ -0,0 +1,9 @@\n> +#!/bin/sh\n> +# Copyright (c) 2026 Warner Losh <imp@bsdimp.com>\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +\n> +in=\"$1\"\n> +out=\"$2\"\n> +bsd=\"$3\"\n> +\n\necho '/* This file is autogenerated by syscallhdr.sh, do not edit. */' > \n$out\necho '/* SPDX-License-Identifier: GPL-2.0-or-later */' >> $out\n\n> +awk -v bsd=\"$3\" '{sub(\"SYS_\", \"TARGET_\" bsd \"_NR_\", $0); print;}' < $in > $out\n\n   ... >> $out\n\nWith the header changes:\nReviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=Enf4XjX7;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvhhx0R4Jz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 08:21:51 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wCPeX-0003x8-1u; Mon, 13 Apr 2026 18:21:09 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wCPeU-0003wh-Jq\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 18:21:07 -0400","from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wCPeQ-0002He-3j\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 18:21:04 -0400","by mail-wm1-x32e.google.com with SMTP id\n 5b1f17b1804b1-488afb0427eso61114475e9.1\n for <qemu-devel@nongnu.org>; Mon, 13 Apr 2026 15:21:01 -0700 (PDT)","from [192.168.69.228] (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488d5df260bsm108834325e9.13.2026.04.13.15.20.58\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 13 Apr 2026 15:20:59 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1776118860; x=1776723660; darn=nongnu.org;\n h=content-transfer-encoding:in-reply-to:from:references:cc:to\n :content-language:subject:user-agent:mime-version:date:message-id\n :from:to:cc:subject:date:message-id:reply-to;\n bh=2VRtE3k1J/gNI88tJ2LxJP5LU9NcvGS0CEtK+4g9nz8=;\n b=Enf4XjX7tqS3Ioz4D1CTcX6kPg/SlddXHaql7bKt5OFpPJN+fzBaUnRKrZN7pu51IX\n ZqXEJmFQXdQIWIfr4DxAgFmikhPdPUHYzehRMpNQY9/keHOevY5GTRE/EcILP7qQi3oY\n dEEZJZXw6EZN+wgMjAgexV71di53+YRdKQ7BYyohHAphUBQ1Df1TTjbnz4pUfbKzHO5x\n +LRrkrlY49c0Br5ORavZs9ys6NveeL767RGsTONhWHnP5J6LsaQbBkyEbdjgYaTd9F8d\n rq3sR1l3kShWW/MG25ANvVyXC4/bc18w4Pp4VFy7OCvdNOgg4s6uXqc5xKtoXy+OW3Jp\n CvBQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776118860; x=1776723660;\n h=content-transfer-encoding:in-reply-to:from:references:cc:to\n :content-language:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=2VRtE3k1J/gNI88tJ2LxJP5LU9NcvGS0CEtK+4g9nz8=;\n b=TsVwETxP1vuH7czfuvGjlhXLS05QMcxAYjYOJiEVzlIJKPzauIOx9Q/ju++EgEbjY9\n iwNRX5S/m3jIzg2YKDHJnZcYEUBC5tT5RaqSrRT4htuyT4niO61kK4bnSHSc14Z7TLFX\n uJYc8enQ5QVXW3i2/iiBAX6sslS/EmQhmUr0H4YM06oLQOlQnljESywfIBX1MUfaYLzz\n JzOTjgJXt8hAHG6qEMYV0tgn46JQgSDPTl1V4zwE+0mBIeSqWv+E6bIbo+Briw4mMv4b\n dGDPsYEX3Zv6t3RiVT+yxt/O3GtuQOZMal7cj0I13JWb5sJ9vnkwIwzlxWdgvN0Qwje/\n PQDA==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/wL7MrzUq827Dd4+W5Zo3bnnxkT3VXp54mip+hiaSDpaW5wotE4frvPLE1uIaZRcxkOnelM8Sy8uXo@nongnu.org","X-Gm-Message-State":"AOJu0YwVvP7X6BuEJlJ607LL5ukt80bbYWrHUQfPE+NRZOpIIu2Yo4Tr\n LZBfZ0+ZmlryxxmiYCngd2/cisGSt8sgKIEBjYRXR8Mx/X6jDi4oZLQornQtHxa8N2k=","X-Gm-Gg":"AeBDieuAu1+bXrQPThqXCBoCt06j4ZBa55hxSSyB0yLEaEQHCUniQSKL6d4pwrfDEaa\n Kemku2eF95L0pzyF4Ae1ngsZOUyUbCRaS+km51GsMIiltBrowsqruokE2pQiCWNN/oRD/Ct4qPG\n 3Qp/3uJW7RlSfOG4bdJL3ivfWoQgdU9VNw+v/ofwgayWedhg5kVbN4BKeOFeDUgGKwQMShdTNXE\n 6fVIRffgYdVIv5n/+r3OXrRuOYL8/60R7xzBIrMj3PzAOPg2a8ueASl/vYCIoiFzcAwBRaIi5cM\n zQ4oetJfWmk2MMpvwjS1jc//VyqowSyGGADG1LzBDios4+lPsF2lz1iCPCi5pY3ThQUnsUDptex\n 5FAHjnww6pSzVysfU6ry19ptSdmCBLKiRcoG3VlWdmk0dBnvKr6P5BTOK9wxVMXC4CamVpKiUJL\n 6QWdCAfaTg92RMYD65Dfn3/iCb29aOreqyQ8LD4RwcxyU3eN4reHeHXsGC+ApzW8Axmw==","X-Received":"by 2002:a05:600c:a311:b0:483:7903:c3b1 with SMTP id\n 5b1f17b1804b1-488d68607fbmr150220895e9.20.1776118859982;\n Mon, 13 Apr 2026 15:20:59 -0700 (PDT)","Message-ID":"<934e73a1-0dcc-499c-b0c4-bbcc3cfe26f2@linaro.org>","Date":"Tue, 14 Apr 2026 00:20:58 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD","Content-Language":"en-US","To":"Warner Losh <imp@bsdimp.com>, qemu-devel@nongnu.org","Cc":"Kyle Evans <kevans@freebsd.org>, Paolo Bonzini <pbonzini@redhat.com>,\n\t=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n\t=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>","References":"<20260413-syscall-nr-v1-0-f70408d042ea@bsdimp.com>\n <20260413-syscall-nr-v1-1-f70408d042ea@bsdimp.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","In-Reply-To":"<20260413-syscall-nr-v1-1-f70408d042ea@bsdimp.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2a00:1450:4864:20::32e;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3677007,"web_url":"http://patchwork.ozlabs.org/comment/3677007/","msgid":"<CANCZdfqwQKExBX-3g_+_0crJUi7qgU92PM7W2pAgBdRO0nO9FA@mail.gmail.com>","list_archive_url":null,"date":"2026-04-14T02:44:02","subject":"Re: [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD","submitter":{"id":1896,"url":"http://patchwork.ozlabs.org/api/people/1896/","name":"Warner Losh","email":"imp@bsdimp.com"},"content":"On Mon, Apr 13, 2026 at 4:21 PM Philippe Mathieu-Daudé <philmd@linaro.org>\nwrote:\n\n> On 13/4/26 17:31, Warner Losh wrote:\n> > Generate the syscall numbers from the installed header that has them.\n> > Ideally, we'd use FreeBSD's lua infra for this, but that requires that\n> > we have those files installed, and they aren't quite the same across\n> > supported versions yet, so use this simple, but effective hack.\n> >\n> > Signed-off-by: Warner Losh <imp@bsdimp.com>\n> > ---\n> >   bsd-user/freebsd/syscallhdr.sh | 9 +++++++++\n> >   1 file changed, 9 insertions(+)\n> >\n> > diff --git a/bsd-user/freebsd/syscallhdr.sh\n> b/bsd-user/freebsd/syscallhdr.sh\n> > new file mode 100644\n> > index 0000000000..fa38500775\n> > --- /dev/null\n> > +++ b/bsd-user/freebsd/syscallhdr.sh\n> > @@ -0,0 +1,9 @@\n> > +#!/bin/sh\n> > +# Copyright (c) 2026 Warner Losh <imp@bsdimp.com>\n> > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > +\n> > +in=\"$1\"\n> > +out=\"$2\"\n> > +bsd=\"$3\"\n> > +\n>\n\nHey, thanks for the review.\n\n\n> echo '/* This file is autogenerated by syscallhdr.sh, do not edit. */' >\n\n$out\n> echo '/* SPDX-License-Identifier: GPL-2.0-or-later */' >> $out\n>\n\nThese aren't needed. The generated file starts off:\n/*\n * System call numbers.\n *\n * DO NOT EDIT-- this file is automatically @generated.\n */\n...\nwe're just doing sed -e s/SYS/TARGET_FREEBSD_NR/g on\nthat file (though awk is mildly more convenient). No need to add\na license, since it's already in the public domain, and you don't\nneed a license to do anything you want to public domain material\n(including incorporating it into a GPL'd work). Since the generated\nfile isn't committed to the repo, there's no style checker to appease.\n\nWarner\n\n> +awk -v bsd=\"$3\" '{sub(\"SYS_\", \"TARGET_\" bsd \"_NR_\", $0); print;}' < $in\n> > $out\n>\n>    ... >> $out\n>\n> With the header changes:\n> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bsdimp-com.20251104.gappssmtp.com\n header.i=@bsdimp-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=0iafAlTD;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvpXq5Jzkz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 12:45:14 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wCTlE-0002eL-QU; Mon, 13 Apr 2026 22:44:20 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <wlosh@bsdimp.com>) id 1wCTlC-0002dk-1C\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 22:44:18 -0400","from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <wlosh@bsdimp.com>) id 1wCTlA-000124-2s\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 22:44:17 -0400","by mail-pg1-x536.google.com with SMTP id\n 41be03b00d2f7-c76eea1672aso1734766a12.1\n for <qemu-devel@nongnu.org>; Mon, 13 Apr 2026 19:44:14 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; t=1776134653; cv=none;\n d=google.com; s=arc-20240605;\n b=XtmK75RN0jvq55oT4FI11WVyn/20wLGs12wy9CV5H+1OCMR93QRvvChyfQCOcIfDKI\n 1fKFr9emkgp4PsEI7Gy7gO7eFfVzBqRzOklJ4yvp0W7Lx9+pYnOaGeQGu0ajNhW9IDjA\n hXO65poLhqibZNJt8n7LdiQxxpqxZ1aZ8BkFPtOvbN6vdl4Sfw5tiYTbhcvnGxTDpZdN\n 10p9QUeYVvRmwrAE2u3OYBf2KvXfjhIMEEAkM1LicC233ZzEUzi0q6ZAWFGiesJrvbVL\n qxys3Ag1fdRZ1qkscKHgNlj+5Vk0AgCy8NgfW7hWKZZqa8k2+XXHXxMwzBH67NZirg++\n HkjQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=jHnHwpU6+1fA7nzBnIVa04mhK2Yk89d9kJyilcrjSd0=;\n fh=GnmRbJ6oH7GfxUPIM2ND+IrLwiLhn2jdjMCJOqQX1fw=;\n b=P0RY3y/6QC5QpFj1yqZRSxScXIwbCj60ME23ADrdRyN35CLtLeqEltMn8LKmqyrnSn\n wQby1NqijqPEASIEbTdhN4+lgb4c/8TIeIiPRbcP3IefkmLZeqpRrlRlybJPXBTtdhFb\n plkJGSjlKJozfjPJSZ9bh8+Oql3jLITGmNmRkquveyUYu6TsZAcEKfSdmQTDZ2VFrTCP\n Uh8/fR8In5xKacBQ69vAVtpQ+L8XBcC2h3QVhbbUJ4GzS7ydiGTlsXe463ZtcxrEkLBA\n 4QvNMVTE1I85YWKHDEJOoObFDXrmV2LVFXG7bIR2erBSRTAyVIpe0Co8CJDl3eLzbHMz\n D/gg==; darn=nongnu.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1776134653; x=1776739453;\n darn=nongnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=jHnHwpU6+1fA7nzBnIVa04mhK2Yk89d9kJyilcrjSd0=;\n b=0iafAlTDHSQPJtn3xW9s6znyZC65GFIO08RlvZFkwT7LZEQ4VB3TcSH1UwKHeQtZ6c\n rZv8tvoUAR90MQFv9+YeJWawmBjCUCJ3xebgMNAIwWiZ3bk+HheWR1ghcSNVeOB7N2XR\n qYdNWXxpYbDbzHvlUii7SezWChwZxrJRKfmUQx2tz/slU5DZYgwL0xSdGTwQv9x4Qfw3\n DfKmCIlaNaOe2ixVWIOrDeOQ8juKsu8Nmb43jjeoMngO1YFG9/CQFfmoOx5zbX214n/0\n /ER9BL3jXZ+m7Rw9NIRqKEH9wHrjwPEKFj7cOhf9i3uxK169A2SaxeYTWGfXZE6OFn/2\n SkMQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776134653; x=1776739453;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=jHnHwpU6+1fA7nzBnIVa04mhK2Yk89d9kJyilcrjSd0=;\n b=gSjDVPtRyLgXqy4wx92gHHAF3Ug9/nIcKeqfLFqWm8k+QDvFSOmMjbeZaid3tvw80F\n ANN+TAz4wKsa+2y0QKamZdx/uQp1pr4HBF0AHICBrERKB+l04UqQ2ud97QNcvQu51yc3\n lALfHAl2nEFcS/jsPucX8EbfXouzKKohDEeCaNMLWq2RlyKWuptqVkye1rKwbZO+6CUx\n GdNhN1R8OyKPm84elC8Wuqjwap8tJ9begmramGsGd+f88xmp9koeeEeexngyqqxXJcvY\n IqkRNMWeQF756eR7bKOs0CVGOOOORIoSw3ovCAT58719kBI96P+UTfPcz/WSYwJlkNOi\n 5TEQ==","X-Gm-Message-State":"AOJu0Yzgj2LNF/NyvvKRgqRhF68fLAc123KqeXzszG3dPHyMlAv2hQsD\n eBw6Zk/4s33hZflQNaR8SKPmj5+HM2F2qoGOy9HgEe2/HziqJl2Z+T6OMtPXaDLnBb4ka8O3JRf\n AM5LKitv2WnlumDXM23dKf4+RQJztQDP4XyarwNMwFQ==","X-Gm-Gg":"AeBDieuCPlIV6C6tcVFpmZfyoqVdsVj99NXJpNs32XuGmUR4HYgKpPCm18cF7eK4QFG\n cSbmCuahTqw+WNR+4azAtyn1K125Jz8d57eXHTusufEw8vcpbPHiF7zhSU1GEQjz3w5rtxbICA3\n ZHsDWm9m0TddAVkF6ZfO6NMylLnc1BYkNymKFxq1Bb2nKNihHizHG33cm4D5EGP7mGke38Zf1KK\n ySzYfVH8NaqE+1682HP7sFcwKJUlZtL2vPrB38giMu/icgKSbZ+2Qzi6MDjEO2CuiFaSlAWlAQE\n eSAxWCrQ9wfaj/p/mnN7pCyKiVmWFo3AkvZepg==","X-Received":"by 2002:a05:6a20:7486:b0:398:b346:b13 with SMTP id\n adf61e73a8af0-39fe3d0dfafmr17613349637.16.1776134653447; Mon, 13 Apr 2026\n 19:44:13 -0700 (PDT)","MIME-Version":"1.0","References":"<20260413-syscall-nr-v1-0-f70408d042ea@bsdimp.com>\n <20260413-syscall-nr-v1-1-f70408d042ea@bsdimp.com>\n <934e73a1-0dcc-499c-b0c4-bbcc3cfe26f2@linaro.org>","In-Reply-To":"<934e73a1-0dcc-499c-b0c4-bbcc3cfe26f2@linaro.org>","From":"Warner Losh <imp@bsdimp.com>","Date":"Mon, 13 Apr 2026 20:44:02 -0600","X-Gm-Features":"AQROBzDQqUdIgPJ8mBkvq3qPOMtx8XA_jqvMXGJZknZ3VLpm_aVdFDHZbyYKPkY","Message-ID":"\n <CANCZdfqwQKExBX-3g_+_0crJUi7qgU92PM7W2pAgBdRO0nO9FA@mail.gmail.com>","Subject":"Re: [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD","To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","Cc":"qemu-devel@nongnu.org, Kyle Evans <kevans@freebsd.org>,\n  Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n\t=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>","Content-Type":"multipart/alternative; boundary=\"00000000000017a48c064f629383\"","Received-SPF":"none client-ip=2607:f8b0:4864:20::536;\n envelope-from=wlosh@bsdimp.com; helo=mail-pg1-x536.google.com","X-Spam_score_int":"-18","X-Spam_score":"-1.9","X-Spam_bar":"-","X-Spam_report":"(-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001,\n SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3677086,"web_url":"http://patchwork.ozlabs.org/comment/3677086/","msgid":"<d0f10fe8-1df2-488e-ae4a-03534573ba29@linaro.org>","list_archive_url":null,"date":"2026-04-14T09:16:45","subject":"Re: [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD","submitter":{"id":85046,"url":"http://patchwork.ozlabs.org/api/people/85046/","name":"Philippe Mathieu-Daudé","email":"philmd@linaro.org"},"content":"On 14/4/26 04:44, Warner Losh wrote:\n> \n> \n> On Mon, Apr 13, 2026 at 4:21 PM Philippe Mathieu-Daudé \n> <philmd@linaro.org <mailto:philmd@linaro.org>> wrote:\n> \n>     On 13/4/26 17:31, Warner Losh wrote:\n>      > Generate the syscall numbers from the installed header that has them.\n>      > Ideally, we'd use FreeBSD's lua infra for this, but that requires\n>     that\n>      > we have those files installed, and they aren't quite the same across\n>      > supported versions yet, so use this simple, but effective hack.\n>      >\n>      > Signed-off-by: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>\n>      > ---\n>      >   bsd-user/freebsd/syscallhdr.sh | 9 +++++++++\n>      >   1 file changed, 9 insertions(+)\n>      >\n>      > diff --git a/bsd-user/freebsd/syscallhdr.sh b/bsd-user/freebsd/\n>     syscallhdr.sh\n>      > new file mode 100644\n>      > index 0000000000..fa38500775\n>      > --- /dev/null\n>      > +++ b/bsd-user/freebsd/syscallhdr.sh\n>      > @@ -0,0 +1,9 @@\n>      > +#!/bin/sh\n>      > +# Copyright (c) 2026 Warner Losh <imp@bsdimp.com\n>     <mailto:imp@bsdimp.com>>\n>      > +# SPDX-License-Identifier: GPL-2.0-or-later\n>      > +\n>      > +in=\"$1\"\n>      > +out=\"$2\"\n>      > +bsd=\"$3\"\n>      > +\n> \n> \n> Hey, thanks for the review.\n> \n>     echo '/* This file is autogenerated by syscallhdr.sh, do not edit. */' >\n> \n>     $out\n>     echo '/* SPDX-License-Identifier: GPL-2.0-or-later */' >> $out\n> \n> \n> These aren't needed. The generated file starts off:\n> /*\n>   * System call numbers.\n>   *\n>   * DO NOT EDIT-- this file is automatically @generated.\n>   */\n> ...\n> we're just doing sed -e s/SYS/TARGET_FREEBSD_NR/g on\n> that file (though awk is mildly more convenient). No need to add\n> a license, since it's already in the public domain, and you don't\n> need a license to do anything you want to public domain material\n> (including incorporating it into a GPL'd work). Since the generated\n> file isn't committed to the repo, there's no style checker to appease.\n\nAh great, thanks for clarifying! R-b stands.\n\n> \n> Warner","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=pdYNEKie;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvzF22ZTCz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 19:17:10 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wCZt7-0001yM-FV; Tue, 14 Apr 2026 05:16:53 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wCZt6-0001y8-KP\n for qemu-devel@nongnu.org; Tue, 14 Apr 2026 05:16:52 -0400","from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wCZt4-0008G6-TI\n for qemu-devel@nongnu.org; Tue, 14 Apr 2026 05:16:52 -0400","by mail-wm1-x32f.google.com with SMTP id\n 5b1f17b1804b1-48334ee0aeaso51249865e9.1\n for <qemu-devel@nongnu.org>; Tue, 14 Apr 2026 02:16:50 -0700 (PDT)","from [192.168.69.228] (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488d687b241sm114979185e9.32.2026.04.14.02.16.45\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Tue, 14 Apr 2026 02:16:47 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1776158209; x=1776763009; darn=nongnu.org;\n h=content-transfer-encoding:in-reply-to:from:references:cc:to\n :content-language:subject:user-agent:mime-version:date:message-id\n :from:to:cc:subject:date:message-id:reply-to;\n bh=F9crJcEHJxv6WuEhcRiQRs8t+RpvdyFT6HSI1ygGFMg=;\n b=pdYNEKieXAqkBBRb+Jurxu8y0cZQAM3iIiz+Ky+wbtqSKSWm345R/Md8cIytExEI4K\n zvhIaqPkbXvcIzJ3+l+XlwT2HmeBMVoDsP/rECyoYA+fjufudNZgzsqzbMCGCFE+z7Aw\n G+/VsItU4/dsdGLWDPGtP7L0jT2QjZe8Roe0y6fWfjJ/WEQYUnB6S5CL5+6YrSKGnT6x\n 2Cqx6nWbXlatxPbXFMBxBOK/qrrG0MmKie51amZ6Ap5WkTxo//hfLlQtEpL8QnsaETcJ\n 98usKQ2PgIoTZhW2Z5Q2FWUFE+d6ilXhBg+msS7sm1Jmu0NVwFEzmuRe+q1nve/UhYcJ\n 9z+A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776158209; x=1776763009;\n h=content-transfer-encoding:in-reply-to:from:references:cc:to\n :content-language:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=F9crJcEHJxv6WuEhcRiQRs8t+RpvdyFT6HSI1ygGFMg=;\n b=MsQFhna0es6WuKkV+Pj41J8EzBFCwj3euNxgDiIaDV/DZGvsaQGz98ank+qJ7/pZll\n tshwOGusW0vbeb2kbXGeLaGaPfaCfPdJE6o32d/zoREiVJrGsbRu3Bioke/iSOXxE3Uf\n EX41kfFjyI57N4IHle+BRRGQKfKzogs0A5j3G4w+ZarW3SOxFCtH3eFMHg4nLIgNMuAF\n OpYa9RidUCHUWqiNpPWqG7ix97rSI/lpbb8S1g+/mRn7cDlSgsydxxixHTOOyutkGJN5\n 3NADVh2igQATsHnQp4ECgK3r/D70pMAweuX8mgO2ijX3l6h+ymiNpQ752xVYziD58d8C\n zVWw==","X-Gm-Message-State":"AOJu0YxSGxbPojvFg/1J1pQKr03bILfIMJlDrLh769CX/GJ9qFZfotZE\n tNXDKDVvkE3PAkKVFVsCCtrLijPbSjKKtNwjUFdhCkkfqXDv8wQMYG7vB0VTJ5Un4mQ=","X-Gm-Gg":"AeBDietb3kTmrjGNANjWuRC02dh3Q2UOUWXvSJaF1xLTk1Ce9++xQB1H/D9vPe3uveG\n c6G8YVIWvsrI1sRqcPb557/CJSV1vA94kQfVztSGL3ZNvoikaXBQKqrYEvTAmEFjmMjTaj70OVG\n qqUxAuhEADKDdixR2cYzO1YPUZQ9hpEItTnphGPSJli3dYV9qyFd9zlmSmoHOvg8D3inBfxG0FC\n 8QdG3DRDYS39MFC4qIxRf/Ia7/0Ouv10NWyunro7Eq1vFFrbeeeJndg5Qe2dUI2xDdGsugJSgyf\n BHiikZSkz8tSpBRsFU2BGXjOF8xfgZi3TPMRPNo3te6hLGUNgZ66pk9gMMmUB3B5fpmRmB/HDv1\n DM9H8+1RVmjiw+mIHWjHtjEnXzS+oXrvy2enwPSwSmcmhXjezdHL/Se8SXVq1A3jqlKfgDibtWA\n 0h4WHvqsEDzGSrUjjAp23ubU7NZgiiE6IfC0wyvzqBa8I7i0TdXvO5BfUyoIj0ipKp93+bI+FLN\n 4gC","X-Received":"by 2002:a05:600c:8883:b0:488:869c:eda4 with SMTP id\n 5b1f17b1804b1-488d689b4edmr165447325e9.21.1776158208717;\n Tue, 14 Apr 2026 02:16:48 -0700 (PDT)","Message-ID":"<d0f10fe8-1df2-488e-ae4a-03534573ba29@linaro.org>","Date":"Tue, 14 Apr 2026 11:16:45 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD","Content-Language":"en-US","To":"Warner Losh <imp@bsdimp.com>","Cc":"qemu-devel@nongnu.org, Kyle Evans <kevans@freebsd.org>,\n Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n\t=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>","References":"<20260413-syscall-nr-v1-0-f70408d042ea@bsdimp.com>\n <20260413-syscall-nr-v1-1-f70408d042ea@bsdimp.com>\n <934e73a1-0dcc-499c-b0c4-bbcc3cfe26f2@linaro.org>\n <CANCZdfqwQKExBX-3g_+_0crJUi7qgU92PM7W2pAgBdRO0nO9FA@mail.gmail.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","In-Reply-To":"\n <CANCZdfqwQKExBX-3g_+_0crJUi7qgU92PM7W2pAgBdRO0nO9FA@mail.gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2a00:1450:4864:20::32f;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]