From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986124; cv=none; d=zohomail.com; s=zohoarc; b=LImhCvmYDPlax4X/U6daOKxbCeVOdTOk5eWjTOobhLLqmgrnizIFS8MRAhUII4h3sUnwxtAD7UJ+r+vAfQtAAPIh137ZIEPR5UL39aVb96UsrEOeB9YEH+mml4Fezm6CEQfsbyomgdLtTy9GFmNERLZMpY4gPJ3vddnrwNRmEZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986124; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=25LjOfeKTQcmMeCxITdAZ3CXvVbnOFuL7T38wF7gg2o=; b=C4YEeoAxJ1+2bjCZCgFhEDXuw49R82tO2hMSPjqcqhUqdZbjIlgfKuSQa1jnSsSpGItf+uFpHl5oVgYLfz/J+C3k2cQaeRc2hyQYA3ga8L1xDpuuCrC/syM+3a62nKurgLYUgoml3mUyG8wyV1yzXPRmAKgiD7n9Ao++1pNbtzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789986124614930.5922500559998; Mon, 21 Sep 2026 03:22:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8V-0002OC-5H; Mon, 21 Sep 2026 06:20:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8T-0002Mq-Ue for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:33 -0400 Received: from mail-oi2-x11.google.com ([2607:f8b0:4864:32::11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8R-0002eY-PP for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:33 -0400 Received: by mail-oi2-x11.google.com with SMTP id 5614622812f47-4c6b4783778so1520266b6e.0 for ; Mon, 21 Sep 2026 03:20:31 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986030; x=1790590830; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=25LjOfeKTQcmMeCxITdAZ3CXvVbnOFuL7T38wF7gg2o=; b=pLtiA5ka79gvFQ3jLGNu+WSkC/X691i1FVoMokbiq8vcAoMSAn51zt+r7hf2Wv+1c0 J0noo9zkVEiypmcOJfEJeWu8KCqbRNWFMnEl7Vco3kF4E7ZmGRWSlN0Vin0eaeojHbqG 09GaV9JKB6nINJkL3HuQBs/26CdyHWeiPEz0i1i1hn4Qn0sivjGvYJ4JewHIA++fDuXe JqfDO25R76UAIwnhUQLtCT1IdhUGQDvvSWiqnk6Lc4oUu6SvtfEE0JGcr3V/pnwQWTo3 4CSDw2wQVWFHbogI+8EDFTizoNmzmyqAwy2vNsfLoYTBv3Msus0V5bKi8BMk2Y2XnRt3 YKPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986030; x=1790590830; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=25LjOfeKTQcmMeCxITdAZ3CXvVbnOFuL7T38wF7gg2o=; b=rsgy6lphNm86zIlvGDvwclNLFjoJCpnIQkbrS67z8+Gz1ZY7q/tJikCUeHsmVwGtSX x7CGFEUdBWg0C2osFM16CP0NR34LlCuuJTDAPDKj+4OKHkfQkOPhTAZP9wbZFXn9LF+T 7wnEvPHs1wYXYKuKoupDTEpK6Wt1lhdVZo0sjSVevwxb69zVQi6G/OWw2VNGN5MR4A5M ao7Eg1y5jxV9sL42vDk4tz7q3Rzk0vHMNSA747f5Uyy99m3VKo4VKdkTNNRzsatrEP1I 828q+hqVBrV/hnNKSErEYc86NrRr+v+PQzinufwiFCbB8Eo7uDkuQl7JHLySlPbxUVwu uWmA== X-Gm-Message-State: AFuF++nfFjSVJ0VZKauhj0dkOv2GqLDuyPEmHt9w7e3ZgpNAiOCe2fm4 lruBe7Bc2gHVfthiH3Z4IctnC1EmbV3Yu3Q7K/vT7/94BqaDZ0+q/l/PiBckG8sQtb4= X-Gm-Gg: AYBFou1OHbqDbNWsCa/19eaLYfs/d5gjE6S8pkwnhJywdzdqOK9NMNRyCHmxmS0fKvG IdljQv636stAkq2HC/Z1zdk9NQOyQZbokjWZiGyKieEUZo1yUVIR35FVycOiLY0kL+9Wgd8JrCq Wf4nnuS1jPC77H9K+XCwR/o1CEWRcAwrrTseLFH+SJi2JzIrrtREMXMr6pVCrQ8YPEfA4lKV8mR iOBtGGeTW/AkuBcDXIBlfTxb1bXqhZu+DrbgV4Y1tzGUbCLFCt4qwDYmJFniXrlxNxA7vFXocdv L/+9Pj6Fyn6Ex/Bbp8NXd4YwvQ7jr6DADnJwnmJzU3OlgICyI6TNi9VZzE9WHSF8W0MSDXsGfV6 0iMDjLuUs/bHutd32pxf2HOOPjhlgaYkFhyGVTEsA8e+/E/WPYsKG2R8BFdWvfXhCkLDfcIJODS K9oJsA12MZ6cXkVlB/07p0pgckF6cUEADtaSg7usdpXi4k498Xe9VmXQ7fhA== X-Received: by 2002:a05:6808:3086:b0:4cb:f21c:a79d with SMTP id 5614622812f47-4ccf946feeemr12977537b6e.37.1789986030482; Mon, 21 Sep 2026 03:20:30 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:43 -0600 Subject: [PATCH v2 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-1-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Rick Richard X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=7730; i=imp@bsdimp.com; h=from:subject:message-id; bh=gBZ+A1c4KGglUwktvyfOghqJluuqvYjPT5k9ueBNReE=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTdpdrv78xLRjECu5JWDURan6kthypcqeAYV PmSXzsHy16JAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3RsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQBe5A/+N/gia7mkSM5B2JFOxBm39lkozCfJuQJ Sw/RbH0ELtr2qOV9p9fKSTKapWW8p0RlaZSfwRD/RQYRu3sD8oc+NxSZzCaZTGqKlHfupGgEicI YYkWPCpr/p35S9sTN3kCVttUAajk6BKGcqOMcr7Pf6C73FKleg9FOsvPvcJcI+MJvdUE+FNhH8h Wlcd3BUQCAN4yvZHHBAGZK8mvmRf4mDsJ4hAOipYv+dWIIi1l9SdCh1aYtW4mCFBqqrMrSqt+vC L46KazgG9o7HKd08MyFZkdpi2Kg1tjAnUasSnl0YjRvvL0SrQdYjlOCmvrAVDvdPreoN/7YjlX1 nzCWENv1JbuYhuCNTFt/Ayf71WDYe8sqYcQedFF6/e/QdIsQEfvVjx1Fxdvztqz6x/QxqFnI+Jm F1KyVXnBIvd058yXaZXSCyiOYzVBgSOyPeHSJtRHDdU4kBbvP8q7cWALlqLj4yzuypO4bLT7jew qFSlSAm6Q09JY4zfq7Jq3ROw+YFUGqr9BTd/NeV1h+VEsbccFcbs6ZsBPMxLGOrO4WyLEKxmdoq HxwOcEi0SFQLGO2P50S3P9zOHP1WvE3scPQlgqGkYD5VaXMDMcpmYT/U8u3bH0g4N44pf9Bef/1 fHxHh11cG/TVJgqW6cym8cdO7I4H+cMKtFPXMTI3DAQQAagTIGqc= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::11; envelope-from=imp@bsdimp.com; helo=mail-oi2-x11.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, DKIM_VALID=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986126296158500 From: Rick Richard TARGET_BIG_ENDIAN and HOST_BIG_ENDIAN are always defined. lseek and target_offset64() transpose upper and lower halves on 32-bit ABIs, -strace prints wrong off_t. Signed-off-by: Rick Richard [ fixed defined() too and moved to C if() instead of ifdef ] Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 43 +++++++++--------- bsd-user/freebsd/os-misc.h | 105 +++++++++++++++++++++------------------= ---- bsd-user/freebsd/os-thread.h | 2 +- 3 files changed, 74 insertions(+), 76 deletions(-) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 0fefc07232..5c32aa0396 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -973,30 +973,31 @@ static abi_long do_bsd_lseek(CPUArchState *env, abi_l= ong arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { abi_long ret; -#if TARGET_ABI_BITS =3D=3D 32 - int64_t res; =20 - /* 32-bit arch's use two 32 registers for 64 bit return value */ - if (regpairs_aligned(env) !=3D 0) { - res =3D lseek(arg1, target_arg64(arg3, arg4), arg5); - } else { - res =3D lseek(arg1, target_arg64(arg2, arg3), arg4); - } - if (res =3D=3D -1) { - ret =3D get_errno(res); - set_second_rval(env, 0xFFFFFFFF); + if (TARGET_ABI_BITS =3D=3D 32) { + /* 32-bit arch's use two 32 registers for 64 bit return value */ + int64_t res; + + if (regpairs_aligned(env) !=3D 0) { + res =3D lseek(arg1, target_arg64(arg3, arg4), arg5); + } else { + res =3D lseek(arg1, target_arg64(arg2, arg3), arg4); + } + if (res =3D=3D -1) { + ret =3D get_errno(res); + set_second_rval(env, 0xFFFFFFFF); + } else { + if (TARGET_BIG_ENDIAN) { + ret =3D ((res >> 32) & 0xFFFFFFFF); + set_second_rval(env, res & 0xFFFFFFFF); + } else { + ret =3D res & 0xFFFFFFFF; + set_second_rval(env, (res >> 32) & 0xFFFFFFFF); + } + } } else { -#ifdef TARGET_BIG_ENDIAN - ret =3D ((res >> 32) & 0xFFFFFFFF); - set_second_rval(env, res & 0xFFFFFFFF); -#else - ret =3D res & 0xFFFFFFFF; - set_second_rval(env, (res >> 32) & 0xFFFFFFFF); -#endif + ret =3D get_errno(lseek(arg1, arg2, arg3)); } -#else - ret =3D get_errno(lseek(arg1, arg2, arg3)); -#endif return ret; } =20 diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h index 0f87b21cc8..be549c4bd9 100644 --- a/bsd-user/freebsd/os-misc.h +++ b/bsd-user/freebsd/os-misc.h @@ -106,19 +106,19 @@ static inline abi_long do_freebsd_cpuset_setid(CPUArc= hState *env, abi_long arg1, cpuwhich_t which; =20 target_to_host_cpuset_which(&which, arg1); -#if TARGET_ABI_BITS =3D=3D 32 - /* See if we need to align the register pairs */ - if (regpairs_aligned(env)) { - id =3D target_arg64(arg3, arg4); - setid =3D arg5; + if (TARGET_ABI_BITS =3D=3D 32) { + /* See if we need to align the register pairs */ + if (regpairs_aligned(env)) { + id =3D target_arg64(arg3, arg4); + setid =3D arg5; + } else { + id =3D target_arg64(arg2, arg3); + setid =3D arg4; + } } else { - id =3D target_arg64(arg2, arg3); - setid =3D arg4; + id =3D arg2; + setid =3D arg3; } -#else - id =3D arg2; - setid =3D arg3; -#endif return get_errno(cpuset_setid(which, id, setid)); } =20 @@ -135,13 +135,13 @@ static inline abi_long do_freebsd_cpuset_getid(abi_lo= ng arg1, abi_ulong arg2, =20 target_to_host_cpuset_which(&which, arg1); target_to_host_cpuset_level(&level, arg2); -#if TARGET_ABI_BITS =3D=3D 32 - id =3D target_arg64(arg3, arg4); - target_setid =3D arg5; -#else - id =3D arg3; - target_setid =3D arg4; -#endif + if (TARGET_ABI_BITS =3D=3D 32) { + id =3D target_arg64(arg3, arg4); + target_setid =3D arg5; + } else { + id =3D arg3; + target_setid =3D arg4; + } ret =3D get_errno(cpuset_getid(level, which, id, &setid)); if (is_error(ret)) { return ret; @@ -212,15 +212,15 @@ static inline abi_long do_freebsd_cpuset_getaffinity(= cpulevel_t level, id_t id; /* 64-bit */ abi_ulong setsize, target_mask; =20 -#if TARGET_ABI_BITS =3D=3D 32 - id =3D (id_t)target_arg64(arg3, arg4); - setsize =3D arg5; - target_mask =3D arg6; -#else - id =3D (id_t)arg3; - setsize =3D arg4; - target_mask =3D arg5; -#endif + if (TARGET_ABI_BITS =3D=3D 32) { + id =3D (id_t)target_arg64(arg3, arg4); + setsize =3D arg5; + target_mask =3D arg6; + } else { + id =3D (id_t)arg3; + setsize =3D arg4; + target_mask =3D arg5; + } =20 ret =3D get_errno(cpuset_getaffinity(level, which, id, setsize, &mask)= ); if (ret =3D=3D 0) { @@ -241,15 +241,15 @@ static inline abi_long do_freebsd_cpuset_setaffinity(= cpulevel_t level, id_t id; /* 64-bit */ abi_ulong setsize, target_mask; =20 -#if TARGET_ABI_BITS =3D=3D 32 - id =3D (id_t)target_arg64(arg3, arg4); - setsize =3D arg5; - target_mask =3D arg6; -#else - id =3D (id_t)arg3; - setsize =3D arg4; - target_mask =3D arg5; -#endif + if (TARGET_ABI_BITS =3D=3D 32) { + id =3D (id_t)target_arg64(arg3, arg4); + setsize =3D arg5; + target_mask =3D arg6; + } else { + id =3D (id_t)arg3; + setsize =3D arg4; + target_mask =3D arg5; + } =20 ret =3D copy_from_user_cpuset_mask(&mask, target_mask); if (ret =3D=3D 0) { @@ -333,33 +333,30 @@ static inline abi_long do_freebsd_kldsym(abi_long fil= eid, abi_long cmd, * New posix calls */ =20 -#if TARGET_ABI_BITS =3D=3D 32 -static inline uint64_t target_offset64(uint32_t word0, uint32_t word1) -{ -#ifdef TARGET_BIG_ENDIAN - return ((uint64_t)word0 << 32) | word1; -#else - return ((uint64_t)word1 << 32) | word0; -#endif -} -#else /* TARGET_ABI_BITS =3D=3D 32 */ static inline uint64_t target_offset64(uint64_t word0, uint64_t word1) { - return word0; + if (TARGET_ABI_BITS =3D=3D 32) { + if (TARGET_BIG_ENDIAN) { + return ((uint64_t)word0 << 32) | word1; + } else { + return ((uint64_t)word1 << 32) | word0; + } + } else { + return word0; + } } -#endif /* TARGET_ABI_BITS !=3D 32 */ =20 /* posix_fallocate(2) */ static inline abi_long do_freebsd_posix_fallocate(abi_long arg1, abi_long = arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { =20 -#if TARGET_ABI_BITS =3D=3D 32 - return get_errno(posix_fallocate(arg1, target_offset64(arg3, arg4), - target_offset64(arg5, arg6))); -#else - return get_errno(posix_fallocate(arg1, arg2, arg3)); -#endif + if (TARGET_ABI_BITS =3D=3D 32) { + return get_errno(posix_fallocate(arg1, target_offset64(arg3, arg4), + target_offset64(arg5, arg6))); + } else { + return get_errno(posix_fallocate(arg1, arg2, arg3)); + } } =20 /* posix_openpt(2) */ diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h index 4258b24095..6552c60337 100644 --- a/bsd-user/freebsd/os-thread.h +++ b/bsd-user/freebsd/os-thread.h @@ -18,7 +18,7 @@ int safe_thr_suspend(struct timespec *timeout); int safe__umtx_op(void *, int, unsigned long, void *, void *); =20 -#if defined(HOST_BIG_ENDIAN) =3D=3D defined(TARGET_BIG_ENDIAN) && \ +#if HOST_BIG_ENDIAN =3D=3D TARGET_BIG_ENDIAN && \ (TARGET_ABI_BITS =3D=3D HOST_LONG_BITS || defined(UMTX_OP__32BIT)) #define _UMTX_OPTIMIZED #if defined(TARGET_ABI32) --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986122; cv=none; d=zohomail.com; s=zohoarc; b=Ax9G8X58+RO+zye2sJP5uRWx3aS+AfXUNkikksyUxmyzHNrfEimp/cQ23BF9vra7OnZdhvM0V1PP5DlM06V1/Fj0oWci4QrUPRSHRSJYBDVafO7/EftoF3M+G/zNrPB+MR6166BKzG9Usp1w3W63XriY8NIGb9IYvsq1m2HrhJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986122; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/aafcq/csDJa1UZaYBIFoIJSQMYPsOz1xJbfqG7LhTg=; b=CvQtQnoyYsBubpCNTuEXWHBeEF5U400Sj6gweNBTB+3znnZb1VyGu0LSliX0H04xYSApkecm80ltNauzOg9Ow0BWy8jAiulljkqiH/gOC8nPv2J49gDu3/+X20bZQ7LfdyObNCTQnzVqZDRmgwlbq0/LznI4EJbpmsLebfoUDFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178998612248831.592293656042557; Mon, 21 Sep 2026 03:22:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8V-0002OH-FB; Mon, 21 Sep 2026 06:20:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8U-0002NC-E6 for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:34 -0400 Received: from mail-oi2-x27.google.com ([2607:f8b0:4864:32::27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8T-0002ex-1q for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:34 -0400 Received: by mail-oi2-x27.google.com with SMTP id 46e09a7af769-8055dcba0a5so414700a34.1 for ; Mon, 21 Sep 2026 03:20:32 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986032; x=1790590832; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/aafcq/csDJa1UZaYBIFoIJSQMYPsOz1xJbfqG7LhTg=; b=AsJBV4EIwG7R67XlkAfcPiQZeJ4TiIK1cIEahT47ipDmO/k71afxmBHqqq1mq1yU2/ 0qmekicGKyQJHIBe/d5/M7/si+2Korx4gnAwimrfh+UOrlKbr4Zy+bXgzE0qMT+O3sY9 BiJOADzBx2BHBL4s2oQk2ZfUacAdTurOR37ovDTbRi4woKf3RKKzlomYWvs2tvMjTKJo 4CO9IpRYXOH2allPWIMpZmFa2PWZBD/S6BzYSaQXjuFwVEFH9cKxvX5NvhXLyQauFS3v XRCvEY44DilY2WzSi5M2O9dx3TwKyUvePXeohqoMuKpkmEQkJgTkxTCbenLv8Zz8v9y0 4TpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986032; x=1790590832; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/aafcq/csDJa1UZaYBIFoIJSQMYPsOz1xJbfqG7LhTg=; b=dnoI8g9vjYTTolcfG0AjEI3s/2lcyD5olqSQHtBbWmhHJDtimj8usfl5otWDaq9U6o Yv35VzQ9Lcrnq5p9m13EcfIiTNd4mt9/+FVDAHUfc0B8umqqQA5unGWDxZ61HRwjmYWH I45KBqa9Hott8oB9v3KzTe5QAULWADX3z7GD4Rhmip5N20yoBAa/ApkYtIP6iJJIKfh1 Z5Jxj4DNxk+zmnIcCw6rTHxA00UbAGEOaBCHkJCUmF2NbohwQ3ToueB+XUsLY767zo/X 7jpku132udFGvPyLptmhh3ZvPaH8jOcJ6yVFYPnbuaGlwIBlc29cp6TtnD07Z2eGBrPc EdtQ== X-Gm-Message-State: AFuF++mUBhPz9eza+FcUxrTMUhbphoCrPMtnRJp25ThAWS7k8/nVxApG VKzvxJXSBhNuM66pXRNPG75ia5u28QF7jvnDsgk8s9YxycZptlq4HrtcLZSWb3DyfkJByGPuKpJ 9kZbhmpE= X-Gm-Gg: AYBFou1YX9jm8Yg2zF9jZXoxakZaTBJImIY2UDG4QZkHxMEbAzHymcAqODTUlaI7mF/ YguVlSgUrccc8vfWBWeopVeLJxmNwm/K6KJNLzrenMfJsYaEBxFiz8ByErElKWPCPvtSUAmEu35 FO9mD5P41fSngbN39AIa5sfz0s3t6bHmi6mF8bXWMhVHfFjC90AzB3FIJItmk+Y06pVCJFPzcd6 UfoLArkRYiSSKs0kBgMPgOV4OOJ48df3z2W1VwQM3Igxf0IRByHzzzBj8cImPGAJKu5fmWbGxwQ UA0Ul3Dwv6PJm34iZiy2AI6PLhp7JMfetKJQYISbeXEVdxH9PqcEjlyQYOAEWl6nmT7UZbK9OUW GDyJ9RUHCICric6jDADU2FdmSPE7N+yLcs2+0jfF8gEIC1pjiVmY+AHrc82eQaOA+FQ8ooAK2Wc gTKOd5aSDfNBdK/sm5y7P2X5c6OzKnrW6Ds4gWMooIdtnDvXDwbvdFtHMynw== X-Received: by 2002:a05:6830:25d4:b0:804:e0e8:1a86 with SMTP id 46e09a7af769-80ddea721ccmr11549002a34.1.1789986031828; Mon, 21 Sep 2026 03:20:31 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:44 -0600 Subject: [PATCH v2 02/11] bsd-user: Drop support for FreeBSD 12 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-2-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1230; i=imp@bsdimp.com; h=from:subject:message-id; bh=lwQPYjfcLlLGXO1WOwNb4B+G4uN+9tStASCCSyWsQTs=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTdU3jlecnLDwTkqVSQDRKRsnXSr+ZbOHsG3 ufy4AM7K8OJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3RsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQCtIhAAu8eNdGXBfCdZ3lqfYKsxGvb+SeuF2FJ fJrf8uQfCdzNw6cUFTD+0PC4ubhMvs2O6oyXMtFvDe0DmAeOogAdLnbbsfCoKz+BmXvY/slr2Da DFk/oBBgJNgaRkBdxoK3Pqr2aHSZ8bVpj4fgVPCHVn+1vLCZ9247RVZdT5ArVfsR66F/5fL15d1 ChLwt8S6vYsR9HE0UYuO/Uq0LZIlzKTMF7Ox7EAq55gZKHbZBi/+F2bRdaoFEuR3D9WpWkvH3nE Y/brTr6TB0p+C7BXc36x3w60/zmRWQv9Rjanqjt10mCEKqicFyV4lSR3cDFwNdrMACv3ztCoSwr prNgbilpErgJaT+9nds1jDOmHoXks804BEsFYlEkhuzONBUL9IOp7ltK/1jLlSU4kOaOoX1l2xe drguQcsSeDCHeN3dOz1Qm2pRUMicNv0OQnMAqzxB5GeqhX4WLF4oOwse4OC0dZjkdAjBxAlQMOB FLWfDVWQnWImNYnT7QLOOVq1Gn4NxHHI7QhOiGi7OQRTiI6Ln0v6NAWtiOkGk+yE7eVhPTlu85K JGEY9Au0Hi/eHZ2umglkt25fflqUjmT5PbX/5AEq19JYStYskEGTj5ofEMr1fcE7+kXQywtyR9W o9uF8XO+OFBqlpgXADMv1VncPc1+190oYEJXlxEuQLqkuQ5XJOfk= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::27; envelope-from=imp@bsdimp.com; helo=mail-oi2-x27.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, DKIM_VALID=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986124280158500 All supported branches have these, so we don't need ifdefs anymore. Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_user.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bsd-user/freebsd/target_os_user.h b/bsd-user/freebsd/target_os= _user.h index 9703b9a61a..688da6c81a 100644 --- a/bsd-user/freebsd/target_os_user.h +++ b/bsd-user/freebsd/target_os_user.h @@ -297,17 +297,12 @@ struct target_kinfo_vmentry { uint32_t kve_vn_rdev_freebsd11; /* Device id if device. */ uint16_t kve_vn_mode; /* File mode. */ uint16_t kve_status; /* Status flags. */ -#if (__FreeBSD_version >=3D 1300501 && __FreeBSD_version < 1400000) || \ - __FreeBSD_version >=3D 1400009 union { uint64_t _kve_vn_fsid; /* dev_t of vnode location */ uint64_t _kve_obj; /* handle of anon obj */ } kve_type_spec; #define kve_vn_fsid kve_type_spec._kve_vn_fsid #define kve_obj kve_type_spec._kve_obj -#else - uint64_t kve_vn_fsid; /* dev_t of vnode location */ -#endif uint64_t kve_vn_rdev; /* Device id if device. */ int _kve_ispare[8]; /* Space for more stuff. */ /* Truncated before copyout in sysctl */ --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986058; cv=none; d=zohomail.com; s=zohoarc; b=hpqnBSMICXhQVMQHA9OzXNKokXZutHvYoQ/MLiq58PPV2DQmt4BGVWBif/rzqXrfiu/X2u/CqLX4mVtsfE1RFhcYVrzrJI6Dtk3F1r0yGFRce8fXdMtkZyY/APOeVUMhkmN/yrH05ZMxSP0mcFCEUMBG8Pf7w9aiAVwU9yt9R9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986058; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UYe6sBnG4kIobRX7QWTzvfr4slonQK5LIp21zrSiRdY=; b=bFs8LzL9WZAtLzMwhDjjYFtk56g5BsRCparaGnirhq/rv/sL2loSW0rx/9pczi5jFHKb0TG/qc5y8dW8T66AMEZBHTnsLH1pGNr7Cqo0r9i6dHEFnoeK5wJ0xps/NKbnGMIp0FKjVYVg68TAAwuKjf5RQEkGDXr50eWBOfxjyr0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789986058833550.3896134444333; Mon, 21 Sep 2026 03:20:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8Y-0002Q7-7U; Mon, 21 Sep 2026 06:20:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8W-0002PJ-DG for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:36 -0400 Received: from mail-oi2-x1b.google.com ([2607:f8b0:4864:32::1b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8U-0002fC-QY for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:36 -0400 Received: by mail-oi2-x1b.google.com with SMTP id 46e09a7af769-7f4f0d37dccso1480811a34.3 for ; Mon, 21 Sep 2026 03:20:34 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986033; x=1790590833; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UYe6sBnG4kIobRX7QWTzvfr4slonQK5LIp21zrSiRdY=; b=MLAk3OThmUjuHmoTfTkPrbo0xjIWf9ihUzcmcoxarOxXojsh8fruc3BvgZzMWYZ1T+ t6RAW1R4D4t5yyNAx5DDJoZtBD1Cbg4RcbJFmwvkRJ3Nr+OCHD85oWcp4eBOIvdMcUdQ 7FMwt4Z5hQ7CpbG8rhrfc9G8rr0OnzsmSR8TZrHOpT783xId+C5GNKdGmHfGhvfyts5o KAmUD7XaPnAkp7/d+scpsDnzVq83qHFuM+hByrvVM1DLnJNzpvkQJTKfQzrfQUAa81RO Z727H/6qiAIUAZN3A7XmlFQYDQrMKmqlKlXPs4Y1YFUSD42Qa/+zqCw1HFAsrbuQFwYH DPMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986033; x=1790590833; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UYe6sBnG4kIobRX7QWTzvfr4slonQK5LIp21zrSiRdY=; b=bj+p6n3H6g9/K+XAn7mpjunSoTfmhyX5mkuGGX8I4TFNy65P0eNWVycvCcR2nbE2a0 ySl7WabuKCIfaS3u5IhM3MrbOSxQLhzMyk4Y+YX/0NvjUZ63hegtDcklC29XJRZRURzd xoVwTprEiVYkH5mC+fSgdSujv3bdHUbnzW+4o2Px3sFjSqOnUIwWOIr88dSJE268guk/ nfQEIET/WVru3sRsYG69cO7b3DzFF1DMJZVbeoVDdlsARjOfjlztTvwvagV11xp6vxf4 voWfLdmvlxa/lE41qTnTtP87nlCi9CQcCjr1u/k4SCr6css13KG3WOZJpn79Sk3cESB0 4UBw== X-Gm-Message-State: AFuF++lbX1yNPTDXbPKn2tZXuZvg7litEbhu9cktE/qXbrwUCMEfPE2U k4khSvVZBrlsuugBllwFMRgeml8EU16W0nSHfpFDWZiaKsraFR9Pl6Capky6s4wJap8= X-Gm-Gg: AYBFou2ZGyF+pps9gsmE/gwB6a6D0xFCCZ14b7bVUUwHmA881ijw6TtTmp85JrIZUZC sskzITttLYZsV2COMkOkBKWR41CE0zCHOYIs4fBBsPuZYVPevjGRvFW/FoOeIYtdW9GUqChLbRt VZwiWA0VgqXqUMKKzegeeDWJ9r1hqK+ogQuIujSPI8eV7TjLz1TEtncPPSKd59uTjy7tI1x4iFE W3gGlfrJBuApnu28quPVhEvJabDIScbej8xhMzGghhmaYtpIQBDTgcU7LZs7IgOAUGAlMzXBtMr iziu4dzSerWCW5TW3rd+LeSzzpNLtMe0JyJuL/LEmrliC+Vy8Md3wp+ALHVltRgnLpw/O6jJ2eC CbRol7VZF7Wg25A/OssUrzco7n0Fj3aYBk57pzi5WWklDbCQq7/6GpG8QPkXkRGB/KdmxrhffGu fYfWk1iR0zsWP1B+InUtztm6PxPwyFdYcfsH/Z0SHlDZrihl/rDSwq48GI9g== X-Received: by 2002:a05:6830:2a87:b0:805:2785:fad5 with SMTP id 46e09a7af769-80de32ee435mr12452633a34.27.1789986033537; Mon, 21 Sep 2026 03:20:33 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:45 -0600 Subject: [PATCH v2 03/11] bsd-user: Flag shared memory as needing atomics MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-3-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2226; i=imp@bsdimp.com; h=from:subject:message-id; bh=R1d7F7J68W20Y/SivRrAonnLdqR7jMMfGp76nrz6DGM=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTdR/zrCIJBeQnrGIcyUhy2CiDd/szFO55i2 S4sMe/uSCqJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3RsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQCMcxAAk4HOeh0LT6Lk+yt76PCxQDo1+DO9uZV SDaZAWMdgrspSt1As2E34rzjMdJBhX/9Zt3dUkhFlJ1kF41P4UxjXg7SbTDJHO8jx7Of67goWfX RDq/PklLhjjaBhh0ejIhunSak3KNwYkWJyu4tdLH1EdYllTnd6aiMqo8fdtW8Ln81kY8GPCCDZF xj3YPJJAX0+P/7k7L/Kgygq9538hyD8okgPAA8a9A1ERm/GXGNKxfd7n8BYksheglM/4XTVtxEB W4dHz5xnsQzo3kzS9upbO54kqu1GX2npu1ecr3Nx3LLusqI/EILboe4Emjaq/Ft2fXXGPbuhQgt z2wROoncbl5Nobh677bVoF4np2pejokuLIgELGdTrxhe19Lhvj6Gn7838ZQbAugvqC4MqCrIjBQ XTZ9ZD3IL+Jz5dqsi+0E0WGY5CA3QztDbuIVHx4cO//KgmCT8IajjKv81uF4u38GRghPiTO3TSJ 73SjSpiRmLFodOOzMDnL5RQl+me/rgNVb755qDtyeZGJWnDsS02h5Ze73i+2tksUypG9Ii+YKbw ZvyKDYFimtJZTP0VoMoCcOnLsffQ97ywJ+RFSIT9aC1Th2dL3kejTrIEra2LosHPjkxTJueBDTT KKnL6GuR9g9I5Yft8dBQhLspkPjyGiks0djRWdFFwB4YYjkMGXG8= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::1b; envelope-from=imp@bsdimp.com; helo=mail-oi2-x1b.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, DKIM_VALID=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986059976158500 Catch up with linux-user 228168cbb7c: Signal the translator to use host atomic instructions for guest operations, insofar as it is possible. This is the best we can do to allow the guest to interact atomically with other processes. as well as subsequent tweaks and adjustmentst for bsd-user's code structure (we don't have one exit path linux-user does and could frankly stand to resturcture a bit to match the evolved code in linux-user). On non-private mmap(2) sharing and all successful shmat(2) calls we tell tcg that we're in a parallel context, which changes how it does atomics. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/bsd-mem.h | 8 ++++++++ bsd-user/mmap.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h index 3086143d40..65270e2cdf 100644 --- a/bsd-user/bsd-mem.h +++ b/bsd-user/bsd-mem.h @@ -389,6 +389,14 @@ static inline abi_long do_bsd_shmat(int shmid, abi_ulo= ng shmaddr, int shmflg) } } =20 + /* + * We're mapping shared memory, so ensure we generate code for parallel + * execution and flush old translations. This will work up to the lev= el + * supported by the host -- anything that requires EXCP_ATOMIC will not + * be atomic with respect to an external process. + */ + begin_parallel_context(thread_cpu); + return raddr; } =20 diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index fe77eceb48..548b4824df 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -662,6 +662,15 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, i= nt prot, printf("\n"); #endif mmap_unlock(); + /* + * If we're mapping shared memory, ensure we generate code for parallel + * execution and flush old translations. This will work up to the lev= el + * supported by the host -- anything that requires EXCP_ATOMIC will not + * be atomic with respect to an external process. + */ + if ((flags & MAP_TYPE) !=3D MAP_PRIVATE) { + begin_parallel_context(thread_cpu); + } return start; fail: mmap_unlock(); --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986087; cv=none; d=zohomail.com; s=zohoarc; b=fctv19rKtvbF1y/FZFErFTZfIkxQNGFUznBoX8jCSWelDmEcsR3iH2wA+za+l4s/y29daNFzDxdxDdP9xpzZXqLmmcpL+gtQLSV4PiE+FBMESun5uTT4F6lMtsA1BpTDyjAEyoPWA2JcJAndorgfm0ZFITyclQvbxPmBWOjWHLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986087; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a2CNx2yAuTJirmhz9tsR410+Iq2tLlls1B+J5RZcPHg=; b=CdG15Ep4ACgNW7CfNtP5+V8S+T6FwqkcMJElUez/g+h1FMxjQiLtWba8DblpRvLomJ1Etj4jc4yCcgPSK3307ciVJiTJGFgMNX8Iqo8eV52DEM5VQx4vbOyFG926ye/Zqt4hkeuPnzzGCJrovXg1G4hkv4Bs577Q2rdNQu+UibQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178998608750643.914406790318935; Mon, 21 Sep 2026 03:21:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8Z-0002QP-5R; Mon, 21 Sep 2026 06:20:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8X-0002Pl-Ko for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:37 -0400 Received: from mail-oi2-x10.google.com ([2607:f8b0:4864:32::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8W-0002fP-6U for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:37 -0400 Received: by mail-oi2-x10.google.com with SMTP id 46e09a7af769-7f4f0cfb29cso1053383a34.1 for ; Mon, 21 Sep 2026 03:20:35 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986035; x=1790590835; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=a2CNx2yAuTJirmhz9tsR410+Iq2tLlls1B+J5RZcPHg=; b=JKft2VehepEqBxbTP1HKaJbTbVTBPH3gtD71aHRGHFZ+jF5o0VLoXqag6gUVKA5Yna GXGspgUqz5/hxllUuGIzrwXFzypnz5+hHF9GhJPc3VcF4iG0vOvmFcet+yigb3NLVPbt XnJO82ugqDP8v6sG61zz0fY85ErjC5A76numPJpincxN1kvx2U/SLghk+cW0VX7/Q52Y 7TxAEushCpYs/LgprA2wyQBht/4Ygeb+teBeywWC6Cbg5dmko19Zb19thgN7JPN5QmD6 3sd9C+An6QLmQ218EKRhBhOWoY/zKVR5jTGvvzN8F/kPvL8zz7M7W/lgDW1S0PLI0DDi sY4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986035; x=1790590835; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=a2CNx2yAuTJirmhz9tsR410+Iq2tLlls1B+J5RZcPHg=; b=IOneG7gIpvBW24Kybj0aOXFwMDUaCEgGImd8OW8lojR95mTrRTPgH9cubEmSR+u2AD 1b5JtK663v/1RgL3lRbtB6GqE2jY56U2hogpElG0MhjNG7Rg1HtEyMxjJggLtI+tGmgM nXeEw2mZ9pJ6neFsPGYJvKAxZDtymFKkbgyecbUgv90ZPlZ7LFm4Hv6i7twfty5MUbmO OoTonZ6O86VIoIoxped2MmadZmFK9UmyX0OUDBx6EzKS/r5RYxyILL0NYsNJw0AK6mKp jAzG+fjXXnfO+zAz6a1FI9wlCe92aUMD6qLA7T2ivw0wXF1dik6CtVnjV05QaEaQiptt bjww== X-Gm-Message-State: AFuF++kftKcc5F/EBQYtJSBn12dHJw4PHVDIIfjfz8Bw0WQWnSPDPLA+ 97FHPfsQeyaFD7oG1yMnahFsP6lRkjSu/2MoQcZFdN4JxoBLVLvJ4wkinUqcHJSmgBY= X-Gm-Gg: AYBFou1uueFvxksQ5Hv3UukLbupPEGpQYwB4hcT56D1jyNohMs2DK4O3g5kScVGzxpc nE0AhTtw1aFQWxfI6j+dsIqxqtkfE0BZWK2lgT6KEIPrYyMqTGVpmnWK+usYihXcaFhkT+IPT+r Y7f1T/APYp3/z9BeR6XCDl0I5l1t13t0GPqtbapYm04XKqcqdlccGy0A5bW9JAPg9u0ozUy0ba1 iuP4gavRONa9G77x7Tm244qRCdAn9Ll9ZuylZF53R9GB9TtyDWOr6cYs7Gt2pPMdQch2AlWoQxH lGO2GAkB6RoV9eHroWWxMuGPQERz4/glw/tiWFFwIz7jtW2CBQhONx9RqYshgDeObaAQMgRj2/i SbtHjkukLcB8YbNDg++8c5IOKvQXB9h9KiWgEoxPQAV6ZVgnvk4szkcHFNEykCW6mVQo2EYrC2h inVLsfyjCi5EMJ14IyrcBDPbZ/fevJvAzqViaPCZfCgPndO758+36p4TCe6A== X-Received: by 2002:a05:6830:3150:b0:80c:d34f:5f5d with SMTP id 46e09a7af769-80de2cd115dmr10422389a34.22.1789986035026; Mon, 21 Sep 2026 03:20:35 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:46 -0600 Subject: [PATCH v2 04/11] bsd-user: Initialize per-arch child registers MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-4-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=684; i=imp@bsdimp.com; h=from:subject:message-id; bh=cIeaM+XjTT1zUAhnOfefrbaYQqDmbpjiTKOOb/1fUwY=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTeckVrZaJ+oyDR/GAN9yWGOSjbZX6re4r8M t2JeETyfGeJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQC1vhAApfjI8qikk1rN9xZIy+a6NFY3YDhjjzf j/9a6I4KTEhmhD36rL1+nmnREM4Gh4QddA4MrFFQ8YyFnwjPuEMM+I8+ucXFOtUa+7wvzdRLknX k5mc0n+T4SsSdMOWsvBMxTtKDKWhnodv9NNP53REDQqmuuZc1vV1Y+sgZoU3T+0OZaOynCg5pNQ Z6/uVR9gFtwQ0Xy8RL60lKjvIVVp230a1uHvvkhv/1hH87rE0sEcWqFsNsq6NZvKaXJcmaqplSj mC31ow/g4jJI+f0RoozEgUGOnl1y61uOJXhkB0NG9pwmo4xqAQ4bzLTQebe4qO6dW5rQy6/mrSB E1zHwAdonajyfHx7aTLFcdXMnn2uURVs+BUq5AZ+uTyrG7kCTICRN/pVkx62jKAAKeX94AkKzEJ JVif4RflFNmk2l3ZzxR9raJ/caNDEWRaY0ohH4WoY2mDqHA5hczyHg3FJNs2iNHyhGmOWlPHe/j 80D2RPYxigK3Xq9wwUqFogmuIx9jlCUXixk2P1bW11CudqchN315Q9Z6L+vRajVeL72SrASjG5g QgJzs9euqY7kUAmHWOVtpQaF3gN2Qn8oZ1YcpziqNMiu5dpDfDhEyhqkva0X764e5CVBxVQI5lx XSaIg0/EOtcwFAhbX2so4vlgOkGFaV6Z10c0slP/+J3ADDRpPDm8= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::10; envelope-from=imp@bsdimp.com; helo=mail-oi2-x10.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, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986088086158500 Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-thread.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c index 15872f03fd..eaab062d3d 100644 --- a/bsd-user/freebsd/os-thread.c +++ b/bsd-user/freebsd/os-thread.c @@ -1629,6 +1629,9 @@ abi_long do_freebsd_thr_new(CPUArchState *env, =20 new_env =3D cpu_copy(env); =20 + /* Init regs that differ from the parent. */ + target_cpu_clone_regs(new_env, 0); + new_cpu =3D env_cpu(new_env); new_cpu->opaque =3D ts; ts->bprm =3D parent_ts->bprm; --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986084; cv=none; d=zohomail.com; s=zohoarc; b=HzBeaWAcoPApraw8Pnu0LPKoagRjUGEMFOOjbDprqw3dHhxJ9JpUicii0lgzeSwA94LbCIvqae0KTv9o4QJNhajiYEnOO9X23PswZire7R1nQZpmUiDEMdTZ0Dl1ZklV/pjjr35s2gtVxDe6noxFiy9hnZ0tYQnHH8/cBHMtRJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986084; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UaoBfGYtj+XBQk/Pn9BUZGITNmY8c6uE/0zBnA0+eBs=; b=TcEk0hqaQFEoOy9tCQNI16Y2kvgxHBh8LuEnL5dAZPIgklaixKycwVbQIrmpUoLcbQUHOpGVzvwsyrhouC29/ugb+XYJ0kmAdwBvxuYSAYZy8aeOdrbkZWXj8J2QWqlsACIUeR0MMDaQEyOuBzt2bdKgQaTClgVNjpEdcNFF3HE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789986084291846.245398801889; Mon, 21 Sep 2026 03:21:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8b-0002RY-Hi; Mon, 21 Sep 2026 06:20:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8Z-0002QR-75 for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:39 -0400 Received: from mail-oi2-x0f.google.com ([2607:f8b0:4864:32::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8X-0002fk-H5 for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:38 -0400 Received: by mail-oi2-x0f.google.com with SMTP id 46e09a7af769-7f4f0d1779dso2440184a34.2 for ; Mon, 21 Sep 2026 03:20:37 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986036; x=1790590836; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UaoBfGYtj+XBQk/Pn9BUZGITNmY8c6uE/0zBnA0+eBs=; b=kfggN8Vkn4k6uIxpCaQYswl8rzvhiEIYbTk2FP32KCkRvay2wLu8FQrZv2xWGdXT4o cNti1dzdP4pQ1MQKreEK9rPXgtMyNZ+gso1MW1UwX5nONOtkhmFrSvY51LRgVZqwR/tt bM3MulYu02T251vSrD2ZVh/Kn6+J6hl1KE310T4k6NtjFwYJDiXjOkZMLD5gyr4+2gwA YwYCeLfZfx7iWTAcRG053RMr0DicoNtQTZoQWFMQfrxBJWGnYmlN61NbfPjd5nd27o2+ V/AhTUK9fCGjosMN0ImUNxHoHFKBqpHkP3bXcTcwsENSSkTC7GcEe3eX7janBvw52F2H U5bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986036; x=1790590836; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UaoBfGYtj+XBQk/Pn9BUZGITNmY8c6uE/0zBnA0+eBs=; b=HsoXEIHJZ6gUeDoW2cYadLGBzXPhjYiq71IspH7060+CrcMGaALTOCXISeOGNdacA8 AKcatQl7FtTn+HxTNWG3gg8dqeZEY2F4uS0kjDPWIEe906Z+yQKqyJ2u9MXD7zL5s9lb 0An+W2VA6xygYlc1oYRsbh+yelwZ7uMq8a4xnhxMbr/JceIufu+LYDPk7wZMTweWTaLD +OyeQneg0hEl2WPqFq97fEqXqKKCm4L1PMT6JK7ZiMgvMIcbkv1OlSHCabYI0hBHezdC rCo+WwDmKmepMr+OxaqIKvN4DGirZaC2yH/Q/dTJLyhIK77bbGWjAik5ZMVjKvQ4VyYu 9J6w== X-Gm-Message-State: AFuF++ndSxvcNLVHoSvPNqPRyMgtSHM5KT4zwVrWykx+HPE55SAJf7Lv c43s6pxd/1O0QjsCPUFV3K1JX5WKHceznZXGKWGDLBWKKAjLVHdQdtnWE/uEhFYR1DY= X-Gm-Gg: AYBFou1Uq92vs0hFpumFFxd1naMEs7cl/SI939a33gzOUcF0mZlGLaKFgWP5WmAuJUn weYSbegZ82ak6LXem32wKptv/QNchb0Xl7HKZm4/ZK30yooL6zHbgT9e6lCw0FlZPyHuGU9LP6X ijCTo7CBYSZC12wMdfO4/U6X5lP6KA4CXbpW5JB9HqKUgc7hM6QfcdR6oS7NKz18KiGXGxK/NEl xpg3Qvs9vF8q8AsyHd3kDPPn7r6YkQp5Qn2cVbAPHiXNN0Rjzuv5pAU0wsmBTlekp4u3rXbinXA qZ7xqhUtTcU9R7Agf7GMCbKzF+oeOlsXrq+xlugBn5hWbIVXVStBhCDA7aFXQZcsl0JT/nut4DS WHagbXc0K8TnK70HBU0e/kv2xqh/Ncp9juF6i2eWHUW28TWJDPIERVH0U9JYhcmnUoIgv+cdBdF fl/B+pZatbMGJKviogR2kGlLyfSUY80cjkPH4PEopZRAy7knPB9cozk8NQdw== X-Received: by 2002:a05:6830:82c3:b0:80c:88c9:7dc5 with SMTP id 46e09a7af769-80de125a209mr10087654a34.13.1789986036463; Mon, 21 Sep 2026 03:20:36 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:47 -0600 Subject: [PATCH v2 05/11] bsd-user: Fix crazy bug with mmap MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-5-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3326; i=imp@bsdimp.com; h=from:subject:message-id; bh=dXewvp/yMZ4bM4b8QZtjmK+kFp0IRtwVPf1hzp00CEM=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTePlEEI0epUo9jGakIv4qWVgAe+raKLW+KN vUmukHHQBOJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQCl4xAAqz1Dsnev04rmnh3RM1TZqflvRbyh5tM V4Ocar8A083OnXWRXNsYDmwGm2ABc+vXae76/fy0lHHuDbOItjpDyPZtU+EqgtrQo45feCe9e2S EC5uEgwKKDqvaRbM/KkhYLlVsc7nTYiYatKmJK8y4Y2k8+4zI9urW+h1BVm1vc6yQxpUj9jalXW V/53OKZy2krLwPWuHDDq4T8b3YMJzy/iSOYFPi0iTLn/C9Rik6obgTiF+VnKRdn0i5e2c5lnDwx 3Fxh59/L/s0p0V/lf1ZmjIUz1uTouFF6x65xgg4mS/Od9CeZAHmVPSR1SBhFKeGyTJBEp8BK8y8 /yCGXVNgWP9AvwpaWL4hmmuqHo5KKtyjSU9Io7+2MNrMvvSsrZUZuw5y0RvAaRiKznh8WQGSmzn 2YcdaMa2rihJFWXqSbEHQKMsIhTwiqZJLQbKCoc/i8bJtoKFWGEV/qqkS84cC9xToWLqoc52N8x 1JIOZsmiP9t1vQbwitgIpaE7LUvDneKtOGiI/lHZHJhrC6Y7EO80FkaVr1Ksgx9LUr7XFFIC0KZ fGT14VK3o84X90pgSn9CmmhSJGCUaHcnYhzdEo/1Nc0oGxcTfonTcAt3fp8m8iY77xQGTf35CIx J83xsrD9jlZDcBfqXh6nUSDRWpi/PqfEsAcZVg/wtrEx8RtxxEEk= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::f; envelope-from=imp@bsdimp.com; helo=mail-oi2-x0f.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, DKIM_VALID=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986086128158500 So, for some crazy reason, we checked that only the SHARED bit was set out of all these bits. The only ones that were live was MAP_ANON and MAP_FIXED. We never called mmap with MAP_FIXED and MAP_SHARED. And the equivalent from linux-user tested that MAP_ANON was off, but MAP_SHARED was on. So incorporate the more direct approach from linux-user for testing this condition. Many of these bits haven't been actually used in FreeBSD since the very early days.... Also fix MAP_TYPE definition. The 0xf I think was copied from the Linux headers a long time ago, since BSD doesn't define this. In FreeBSD, there's only two bits of this low nibble that are used for the sharing type (linux has 2 more types encoded in these low bits). The kernel rejects bogus flags (0xc part of 0xf mask), so it's better to have just these two bits here. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/mmap.c | 17 +++++++++++------ bsd-user/syscall_defs.h | 9 ++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 548b4824df..5068e5c3b7 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -215,11 +215,15 @@ static int mmap_frag(abi_ulong real_start, =20 prot_new =3D prot | prot1; if (fd !=3D -1) { - /* msync() won't work here, so we return an error if write is - possible while it is a shared mapping */ - if ((flags & TARGET_BSD_MAP_FLAGMASK) =3D=3D MAP_SHARED && - (prot & PROT_WRITE)) + /* + * msync() won't work here, so we return an error if write is + * possible while it is a shared mapping + */ + if (!(flags & MAP_ANON) + && (flags & MAP_TYPE) =3D=3D MAP_SHARED + && (prot & PROT_WRITE)) { return -1; + } =20 /* adjust protection to be able to read */ if (!(prot1 & PROT_WRITE)) @@ -586,8 +590,9 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, in= t prot, * msync() won't work here, so we return an error if write is * possible while it is a shared mapping */ - if ((flags & TARGET_BSD_MAP_FLAGMASK) =3D=3D MAP_SHARED && - (prot & PROT_WRITE)) { + if (!(flags & MAP_ANON) + && (flags & MAP_TYPE) =3D=3D MAP_SHARED + && (prot & PROT_WRITE)) { errno =3D EINVAL; goto fail; } diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 9fa16e0863..c4fd5f5589 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -121,7 +121,14 @@ struct target_msgbuf { /* * sys/mman.h */ -#define TARGET_BSD_MAP_FLAGMASK 0x3ff7 +/* + * FreeBSD doesn't define this, but Linux does. In Linux, it's only MAP_PR= IVATE + * and MAP_SHARED and a few Linux-specific types (0xf). FreeBSD allows oth= er + * types of mapping with MAP_ANON, MAP_GUARD, and MAP_STACK. The mask on L= inux + * excludes these: They don't have MAP_GUARD, and MAP_STACK and MAP_ANON h= ave + * similar flags with different names that aren't in it's 0xf MAP_TYPE. + */ +#define MAP_TYPE (MAP_PRIVATE | MAP_SHARED) =20 /* * sys/time.h --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986076; cv=none; d=zohomail.com; s=zohoarc; b=dvzFWvRAhVyqEq/2jvdAYfeWmrhaDIkEitS5Z57Bp0XBwtdmOCDuQAfdvxwqgDpPQKwcKTlyY2YT5fxCW1AEk/ChM1x8nCay/sUQU9ls4ukvWmXw5Mn4GsxLCPF4acNAPz6mNgurITIWRWM9uYWXvZk8eNG+6UoxN57lWTqxdQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986076; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eZy7A5zxWV4gC9mqKSXKnBsL/zM8a9eBWjdX7xNCKIE=; b=FqBOcchl0QrMJfJX1mScAxHr/llYjwMDszHrPCPHbeEf6yc298BCluEfxS3syj3dqlR6XJ08VTcV680ntmKMY9jmp6ROT4evtI+8zoI1t0FyRSZUUxZgMmfVX388XmVSpNieEAGknHBtLJSlbGKBO3sqVksPHxxtvPq7VpKB/Q0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789986076283616.1512387833233; Mon, 21 Sep 2026 03:21:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8d-0002Tr-Nm; Mon, 21 Sep 2026 06:20:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8b-0002RH-5j for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:41 -0400 Received: from mail-oi2-x0f.google.com ([2607:f8b0:4864:32::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8Z-0002g9-M6 for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:40 -0400 Received: by mail-oi2-x0f.google.com with SMTP id 46e09a7af769-7fccd4c3f36so2113356a34.3 for ; Mon, 21 Sep 2026 03:20:39 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986037; x=1790590837; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=eZy7A5zxWV4gC9mqKSXKnBsL/zM8a9eBWjdX7xNCKIE=; b=RjGeter3rYfGLPw6f2GvnYVUxWsGhdS48Ho4VBKHMZnqF6i33gISiRkcOklOekNtKe MTJGB0ElFTZ/+vlfPdzuvgvfvKKR6qsq0v+uOXYL7CPapv7UkRKcBqarTL/APyAAgdLG YyBE87UyZl3nLjLPiqjC+29uxKy2Ps3+K5h69973mmA3BajBFxn76blN06oJhok6Vsl0 X3QtusSq1Y4h0PkZ/+qOpfCrqIlowerG61f9WXRHeMQLH4FbxmpU+x8wAWwqjom/qAr2 prxV/CfWvBl2PBBSg8DGMN0XaSGKj6vWdASh/zM962xu/mMj6/o3LnloLTb7UEW3BWmq /0hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986037; x=1790590837; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=eZy7A5zxWV4gC9mqKSXKnBsL/zM8a9eBWjdX7xNCKIE=; b=wiWJK1j7rkfxAaPsrcr7u2z584tQRqn6rvSChti1NX09td2nf6hWU33R7xp+wiZawn XOfV44Q36gSD/u4GES0kKuz5Ioy9YoW5sXSpI0PdyApDjXncTVHp55xLuoXAUDiN5BD7 VTGeVzzhdLPonf+b58fxhhM/6VkAOpc9Va3CiDwfZRZ0zf8FUejZ283iuMHPQnYaDFSp Md5b34jOhX41+S0HlPxLvY3MRBSljVNRwU3BVpToP+o4DtAfgRAampzNWdxR1t1dCnS2 EMf6vEuPB9lldOW2tauo1iysRnGOV9dwGBjZTw1eCfwWpTSUo6vSDdumAro0mktlFIL2 0Xpg== X-Gm-Message-State: AFuF++ljwYjOdINriahCwebQlHkC8mYPFq2uTdK0KyYKaLegEXg2MCMx 5QRWiul1J8nz8kr2DYnAAYcKyD1Ijpy3ObQMMVWer7xmfAfIVqwlnyIYIus3iwmxe6g= X-Gm-Gg: AYBFou3bETRG/nl6g312+OrOkUEccSzi+jZFP0g7KDuZ5EbzclORSN+bJU0nLOKiLMg XlBOw//Cv+mO9c6sqy1tHqarP9kMYH6fn6GBo50wY199CJPEzRnTvbxAf9Ea6P2ne40oba0twSd HsTyBl3a3GHNQYtnRsEgoMSS+E2t6gVFyJUmr2aMmeiRwTHm0nDq7K9YQDosXGpeJVk97CBLVdC v5bS1sVi6KGnimzk03HWsMUvvQkYW3Zv0DdmdHagRsJuLnmQKmvg9P2WaxdL3x5SFOKRqePiw0q Xpt1w1iHY/TplQfL/8noILRwRao65fnZjxJLOlGm2XYqMlkNOjqAFgiklkCUkx5kCUpiBE729Hx 84szkzPUZFTImc2Jtc0+k4vjt1hgqFGG3QwREgdwOMfwIOoEGQaWFoM87CtCgxBy5RHrPzaz6dH 3YH5pc06MC0wO9aaShePRs1R6Obhuvl7ft0lFpMM2PuAsoZnka4GScsSao2A== X-Received: by 2002:a05:6830:4c02:b0:80c:d34f:5f66 with SMTP id 46e09a7af769-80de36f88e3mr12398971a34.31.1789986037670; Mon, 21 Sep 2026 03:20:37 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:48 -0600 Subject: [PATCH v2 06/11] bsd-user: Move tb_flush stuff to begin_parallel_context MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-6-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2211; i=imp@bsdimp.com; h=from:subject:message-id; bh=jb5+v75jbNJuuiLF3xUx/leyKn5gw3EifXIbRmwvUdc=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTee913J4pUgArtyneKs+sSYKJyCvyZzHeol +2qCpoPaaaJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQD/gw//Z+Zymh1AkKGrUv8qyndWjuk+LT8cgIF 9XIy5A9Ecu/KTkDKk8Qzl8b99IVmhUscYnhvHfOB6jvVBl+w9yTb9g0tQWPV06zg9VpdgyCXbHK njp7B8VUL5294SPSu/jXi6be0YaGJs5HMKDkfwZtZbmWOroefkozF/nl0JeXeZyNIoAU8tjuhGF HLDUJOJUKJ/4h3pY0sXMsqMUXaFLuGnjxjlAF4tvK+qNXD6mVsK+xmvsVx+I7tggsp5sQlv7wb5 v0MdJx2JN1ozoj9n23XkTBOZMltRCCoChhPf7+Z9H7DL/gtHbVr70eaSEQapd8xG/QcdVkARa/h S3ygGr3QBp9waosHuESBMSmiKzE9cec29lpQxz8NAHqKWKDH6i1K5c7Lsn3BQUkOytxwWIcpS32 jBeV9dXtRYELcS9C5wcwV4jN3lVscrkAa2A5rLyNCBpRJqS+Pw02L7l4iVMvq2tvjyS6QBXsqzC tzoH2X37kB7SzCABb+nx4dRCbUNdePkTTBzqz4b5GmgBk6TehSYktwWzOYCMigvQPJom5dcTq1B kGuM9eqJqt3WAkV1vvhtOgQbzuxYYLsOj9OIy6/EKoWwnSm5RoCmXGYZvJzfc+/o1302hgFsCFR yadL8fFsuirTeg99ArHr3ku3QGVdRozg5JAw5ZHW5cfzDh5nGtoQ= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::f; envelope-from=imp@bsdimp.com; helo=mail-oi2-x0f.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, DKIM_VALID=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986078014158500 Catch up with linux-user 430014bee7a6c26a70e9f3854428843d5918cdf5 and impelment begin_parallel_context. We'd already moved to using tb_flush__exclusive_or_serial, but need this in several places, like linux-user has. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-thread.c | 6 +----- bsd-user/qemu.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c index eaab062d3d..4ffa76a798 100644 --- a/bsd-user/freebsd/os-thread.c +++ b/bsd-user/freebsd/os-thread.c @@ -16,7 +16,6 @@ #include "target_arch_thread.h" #include "qemu/guest-random.h" #include "tcg/startup.h" -#include "exec/tb-flush.h" =20 #include "os-thread.h" =20 @@ -1622,10 +1621,7 @@ abi_long do_freebsd_thr_new(CPUArchState *env, * generate code for parallel execution and flush old translations. * Do this now so that the copy gets CF_PARALLEL too. */ - if (!(cpu->tcg_cflags & CF_PARALLEL)) { - cpu->tcg_cflags |=3D CF_PARALLEL; - tb_flush__exclusive_or_serial(); - } + begin_parallel_context(cpu); =20 new_env =3D cpu_copy(env); =20 diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index d2dd8c2ee8..851b0c2c5f 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -41,6 +41,7 @@ extern char **environ; #include "target.h" #include "exec/gdbstub.h" #include "exec/page-protection.h" +#include "exec/tb-flush.h" #include "accel/tcg/vcpu-state.h" =20 #include "qemu-os.h" @@ -529,4 +530,21 @@ static inline uint64_t target_arg64(uint32_t word0, ui= nt32_t word1) =20 #include "user/safe-syscall.h" =20 +/* In user-internal.h in linux-user XXX consider similar cleanup */ + +/** + * begin_parallel_context + * @cs: the CPU context + * + * Called when starting the second vcpu, or joining shared memory. + */ +static inline void begin_parallel_context(CPUState *cs) +{ + if (!tcg_cflags_has(cs, CF_PARALLEL)) { + tb_flush__exclusive_or_serial(); + tcg_cflags_set(cs, CF_PARALLEL); + } +} + + #endif /* QEMU_H */ --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986087; cv=none; d=zohomail.com; s=zohoarc; b=jFpSYwc4ZQCOQQejdMbsVs8wDOJnVl23qUqkyZ0PBX2kykdUuhstJV+jmyMMpGiw00gfwK9maEn543ZdqTvkfQePtNMezCBFVuii6UXiShhSW0TQ+6zeMJroEwwCLI2MgGyWC4QwZ4SlEPdQshyt6y4ya7GbU7JA9Qfd3bivZ50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986087; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ssighiSPUExRNK+u6YhdtC00lHHudlBtMjJ6uyLW9p8=; b=fMgAgdZPOtxpYRDDyVkFLX7bnRms2VZq2IZ2+kRrc1dkKPL+V+GlmdUBHqdxwhKMABf4tPZRAd38RsbODVep6epC6kiOBeQ6vtWrNVl1Fe2tpLpS7v1USoVAghtyVuAwmJdXzAxpQzSsNbLYokPH9Pnvc/Y6q9+yrZP7srfOhqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17899860878443.9910484242567463; Mon, 21 Sep 2026 03:21:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8d-0002Uu-WC; Mon, 21 Sep 2026 06:20:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8c-0002Ru-0l for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:42 -0400 Received: from mail-oi2-x10.google.com ([2607:f8b0:4864:32::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8a-0002gH-Dp for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:41 -0400 Received: by mail-oi2-x10.google.com with SMTP id 46e09a7af769-7f4f0d298caso1147611a34.0 for ; Mon, 21 Sep 2026 03:20:39 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986039; x=1790590839; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ssighiSPUExRNK+u6YhdtC00lHHudlBtMjJ6uyLW9p8=; b=FD5JG0lLEGITkGV2uyGHM4Eb6nq7IVbcHlPwkhsbs27BQ9q/DhEtyOzflbnuxr/sQr 5jyQe8v52KOXbClKE5I3UdgJm+DLfd2G8v5YEZNpoQRfd4HDLVb1ZB0VWQf7HWy4rfHj UBC246+DlV2yxPbOD107FjbhA4aHSwurdmi4RoqbMKcSrYaYfV08Gw2v/3FtorDgF352 JaKu+6uV2qsm/3AOZe/hqkka4TKEPTdj6uURf5nTlulakySAxsQYLV73omjt7SrhWH7e +ov4OwAcf5Ak9926CCptse21+GhzAHwxnJALUQzHXACs6txP5ndNX9v9T+XK8IAl1fxU UrOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986039; x=1790590839; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ssighiSPUExRNK+u6YhdtC00lHHudlBtMjJ6uyLW9p8=; b=PHlUvRpV1RBdHoTjmCa4OJw6GzCzSvEgAhz5EhQkX4XBY3TAIgbmu+4D4i+ZOHUdlh 2O96Amja5LGdfgKcGk89zFXaywZ0lEAF6PEqnZE1qwgetIemFC/cUPROy0I53vBtsIza 19xyB+2GIzv/aMOHEC3oO+2VO/2yNGc6aT5HtdBV0OPNe9D6bb8xzH4LZxNZwVgvL1wA asYkvmz7lLWYH0+ZKF5QypS50xUPrZymbJGlsH6yEBpJkAjnAywGbYCNtAtS8W64O9We tIHLpfmX+GzJSJXsWpilV9ltbl8/Ljkd+OsT0iCrnOqtJt6yaFphzkcYRF5KclhpB9AT aZ6Q== X-Gm-Message-State: AFuF++l3L5XYQeJl8zfRwBvUSpwG/FtRIzVjuzZ/4W1viRtjU0iL2xQR dqNODFuGjIG4AUphqt2fJFoC9cgjde8mlhr0a7sjPvEVdyCyvqajF63yax15J9k8nQGuFQDrTOe 5EH27Qsw= X-Gm-Gg: AYBFou3pQBD1c2k8o3VOMzRxeCFOIeTofoaI5XWsjtDFCsET8cP9vQK/isjyOZQv2Bi Mzm856DgVPzBF5hqjx2vE/suuf/vRyjUe+b4mwsULW2Z4hNhT40CLDko1mq6Co+JFhDXA4j/BoF 8FtK+xcEPUwDbvSzMrep3PlmRE4c0Q4r6LFdLn5fGFDeKjWL4UUqDQqiZNmaL0+ZxNEqxKxcPos ug44TedLKVUTJwZoGE0/vyqbuXwd/aUG9wKaLggD0c52sm8nU34V20dwb+8q57BU4vP+DGokc66 SVQTi4EsS4zuhMcb5QwlWt+DwWw62Z/AtPKSdvpGn74pxVg3RArQ8TUtXS7sdUul2Ifo15M1urB fVgd/YzgOCilpeG1DDZZIhKnRLOHfsaOGKjEE6MrF6U0ykkyCk0wc508SwMe7bbVD0jw1NzlfmC Du263GkhGdY3nrIKJx8VAbIB+SFiiNpfCPlKOvESwIeY5ZfxdsZ8kYJni3soE= X-Received: by 2002:a05:6830:442b:b0:80a:3b3b:8ac6 with SMTP id 46e09a7af769-80de21ccc78mr10847031a34.14.1789986039022; Mon, 21 Sep 2026 03:20:39 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:49 -0600 Subject: [PATCH v2 07/11] bsd-user: Implement exterrctl(2) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-7-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1678; i=imp@bsdimp.com; h=from:subject:message-id; bh=S2hYo9J+XOEsZ2N3+GzJd5woLvB78xfoaqGahFntErE=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTeVehENgUEGbShaWL1Z0oPlMlpGas8I030q M4MS7PwkMeJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQBbhxAAje89C0aOsGNvUXZn/qA8vFOMkBtAy4A ZWJPD4v236OzrlKLYHhqEqncpQaDBja+f/r4fEFaJhUPAc0+iRqBeU+htOFYpiQNtFMJ2jjlKQb 0GTvtHO4zffKiAQQdyp2c+HLJXtJiHWhZ4rud00ZnjyAdG3SHiDDGNgtKrLKNYhtL0qAyk2YwF9 e46H1qirbI2pfwdQleySvRw1nD0rL1XCH5mQ42n2C6b3HDCM8CjEcA24afE9IuTX1NDsBGRTk3b JlabhnmJ8ywiHgKoztW1IsyVcTxDwmhgGPky31U7g0u3QhF1E8HrvSiWXlUamGDTwZovcEbUHHZ rT9Uoy1NT4qwP7e9iuQQsPF4XTXjPvbLDiDr+n3loQh6rd0bIioxAj5HWbVoX5+Wu4OwmAH4znn vKtH1ZXzdvLv9qtlOeCqU2ch8ZKVTmnoHrseXnvPpZdtbEmzfXavd4H9Lt/4lNWcu6XxUqLby6Z ulSSmVcEfG+1KT+yXeN1AizSqbxScIbz7hYtJSkW6x5kIx3jLcTLcqkMGwj0jBRB95904xK0JJe MMp1o44fVISWE+oFGwznZRxhPoRTMNHfZEEW9bZii0n4GSk6sH7V14KsbGc2EOXq1G8a2TuRzln aFt/A9Y5+MxIQCInBl8o7dDdqKdq5Bf2r/sXJuIqVfdVaHkxpLHE= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::10; envelope-from=imp@bsdimp.com; helo=mail-oi2-x10.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, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986090145158500 Signed-off-by: Warner Losh --- bsd-user/freebsd/os-misc.h | 16 ++++++++++++++++ bsd-user/freebsd/os-syscall.c | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h index be549c4bd9..fa40261da3 100644 --- a/bsd-user/freebsd/os-misc.h +++ b/bsd-user/freebsd/os-misc.h @@ -9,6 +9,9 @@ #define OS_MISC_H =20 #include +#ifdef TARGET_FREEBSD_NR_exterrctl +#include +#endif #include #include #include @@ -538,4 +541,17 @@ static inline abi_long do_freebsd_kenv(abi_long action= , abi_ulong name, return ret; } =20 +#ifdef TARGET_FREEBSD_NR_exterrctl +static inline abi_long do_freebsd_exterrctl(abi_long op, abi_long flags, a= bi_long ptr) +{ + void *hostptr =3D 0; + + if (op =3D=3D EXTERRCTL_ENABLE) { + hostptr =3D g2h_untagged(ptr); + } + + return get_errno(exterrctl(op, flags, hostptr)); +} +#endif + #endif /* OS_MISC_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 7e400c89bc..e87924fbb5 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -1592,6 +1592,12 @@ static abi_long freebsd_syscall(CPUArchState *env, i= nt num, abi_long arg1, ret =3D do_freebsd_kenv(arg1, arg2, arg3, arg4); break; =20 +#ifdef TARGET_FREEBSD_NR_exterrctl + case TARGET_FREEBSD_NR_exterrctl: + ret =3D do_freebsd_exterrctl(arg1, arg2, arg3); + break; +#endif + /* XXX */ case TARGET_FREEBSD_NR_cap_rights_limit: case TARGET_FREEBSD_NR_cap_ioctls_limit: --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986121; cv=none; d=zohomail.com; s=zohoarc; b=SYYmZ1uDs7aalaLVzfa4081e08HXZgbzuD1jeaZXe2d80ddE+boIRGpRyZqGU8X8Sk2nGg/SqRhM8kWi1lLx+7RARbK32uhKAoUA6J5WdMA6lztBYoiBapwBG50+CWQki5+hZtjPXUQTRYnGV2+tH23QTTwL1NKhfZTGvY7HRrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986121; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wkWH1ZE6wt9RwfiMkvGZiBnMh0Vi3XqmzfxwWeKEcvw=; b=JR8KKjn/eFnnYLTIIu+ORcZGwHOQl4Q+6K/QOFEBx1p4crHYlcyu3SzEIaWS7G6CQKbdqdHKsg1y4WIgUejRA7GgcJN5iacPwdzQ64fPt/T0XZfTMzMLX0Ld99wnUDUpiKqnaBRP5s3u/gOmCZfOYCNpp3Uwvw5M4yl1TSWSFUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178998612149211.557113304599284; Mon, 21 Sep 2026 03:22:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8g-0002WQ-D9; Mon, 21 Sep 2026 06:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8d-0002SI-4j for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:43 -0400 Received: from mail-oi2-x10.google.com ([2607:f8b0:4864:32::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8b-0002gg-Nb for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:42 -0400 Received: by mail-oi2-x10.google.com with SMTP id 46e09a7af769-801a8bf8112so989037a34.1 for ; Mon, 21 Sep 2026 03:20:41 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986041; x=1790590841; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wkWH1ZE6wt9RwfiMkvGZiBnMh0Vi3XqmzfxwWeKEcvw=; b=AKHjYOPfoP1kjv/3mu9w0WXRGyBgwrNTbljiQ+BBrus7hGnWdDUw8sophhUGitxKRY il/ChxW+NzThUd+aOxW6iX9SquU+SwUx0mGtuwglNqn0IpPiw06cBxTvXTT2TIl2ffje JHjcie5/ecYI2v93+JYlcrjA8nv9/13wcjA5I3ISpbV44JOPAsRvPbNVLGio+2VViYge 9sXtlzAD49ID4c1stte/M8ak2U8kilAa6SIgrItExJ7anvMIPyS54zluT5e/WYmUPD1J MMpVblkfgyYlWxsZmHdGHWElKI2wihpgSK8NVq9zJ+LNmxFo6FgZp0QiILzsM10Br0As 7ieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986041; x=1790590841; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wkWH1ZE6wt9RwfiMkvGZiBnMh0Vi3XqmzfxwWeKEcvw=; b=u1kx684QGHGg+4JqDcXIWlFoCZMGg+Ef7FT7prdPIBFgyWtO89PNsvcR9Z6AW4vUvx Dzt9vNLMFc7+7oKow+/KrO0DY3QHGjbk9SWpdAGeWbBCkF+JptOfNxJvX+BPuadL3qBf 9XMgni6JqKaFxNq247vlouPue16XRYLyDFe28MMmySPGSrYOlO2MXffjjVu+9ZmKTDmL RZaTVuGNuyVixLs+gsx6mkBm9OepbZ4ZV36cwg1Fsi44T+5jW0W9qk88dBFNXY8SSe++ YE24RN4rJ300A9+0lc8F6SUoVtXno8neuUa8i3A5tgZB1NL8bnaYlkolzpHr+0WPbVjm /z+w== X-Gm-Message-State: AFuF++kQ/NnRsnbk8cjNPV/coNcxKxzDBa+gCnfJI3PpCQWaaK+8tUn7 Lwm4DBxtCld6yPj9w42iSZfJylizMp6F7o7iNMyORgan9MnZxOjPFvHdGDPnXb0JoZoCv+FJzfP BgEuEgtU= X-Gm-Gg: AYBFou2dkgpHo2tIEjojqcQCNlkJJdPp8jVfES91fbXVOoi1TqRSAgdPwuWjnzZ+/6s STzESd6P1IhOgUcmWYNAPFo3vsVMlNQuETbEobd48l5oELc1C/TIX1yTdZ413ckCIJWtFenf2q4 BU4/nr4Be7rOophFBZE/VEARBaiStGNOOaw6lMk+zvZJBqSJS0SYXVFpoVnw3qwRZ8y64miKDba vddzFUKykIEKC6NTFohNbiPRnJl09N0l4Z8FXDLwiJckuXL8EWsiRQRc6QkFQxilPElRlDJQ48q kcYpAVnFPVSZDd2DT1Mah+XturxnoNtIfhUVl1NsbiiZuuZUsnjwFHsjm5van/tZfUW16yDndFW lmmskhoOh4ywB5w3G2MHYEXSK4OTQAWEOHJxvL2Rb0JTmVlV2pTHmTLFu6JFDirrxYxGpz+fBFH hYSFUjdvnu0u/XyT4ZpEVYQ0+GTk/aHdDojlD0/Hefe1KY4VSten8cdJARlSHeFSM84gXF X-Received: by 2002:a05:6830:660f:b0:805:6a93:d9ba with SMTP id 46e09a7af769-80de33e9139mr10768123a34.15.1789986040666; Mon, 21 Sep 2026 03:20:40 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:50 -0600 Subject: [PATCH v2 08/11] bsd-user: Implement sigfastblock MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-8-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2090; i=imp@bsdimp.com; h=from:subject:message-id; bh=17Ryw/lxO2Pse8NV9o6To3pLR/TQx9He+lK8vRViddg=; b=kA0DAAoBbBzRKH2wEQAByyZiAGqxBN6gmIRHkkTE0CL4y1ei1wn5fTWoKKmAlSclnLAjVUwxd YkCTwQAAQoAORYhBCA1+JSwCqPPfM3ht2wc0Sh9sBEABQJqsQTeGxSAAAAAAAQADm1hbnUyLDIu NSsxLjEyLDIsMwAKCRBsHNEofbARALHSD/wNxU+Zyb90FCrARi/92xsHoKqKDU7Z3paw8brtkdP 1lR4qJIbTc9t8o3vT0es+LFkIX6NyaSIIR/ouuHLuI4HbN788+BQru/7qFxwIXRxxheOw2PgOXh xw3zpGuUOji+lgodOGEUm3/Mrg2WmAwLDkUXyV90NEHEBG/Gms8Q6rrSCEbwGXkENVQR9cZaZ5k UztEAl25Xwx6qcKnUMaHzMrb5d634GCFvnf7rxM3+Hugc4mXK0qg2whbpDH1tTBRu9rBJRytlZJ Z0Z7zbnY2OMKY8dJr/E54sdv10KKiGB5zNyXL0alHM8Lq50FsZG5mPwUHfdMPs4dA8C+k783c9O DVHcp48qflyaGo6+oqk0UTztjh1W5IEX8Me29TIm6QnjrxQm1eX5RB5KQgwl4aahZUtvSrawYtR Y27QG8ccf0ZCB3OR580Sp4bMKd40NXSYD/IDNzcpGD8RUM0SKZjvdGvcNSZLKYCC9Xo/7NwSnxg hgU+L8+xJLwyR61WFr3Q3C9wGfniaK0QVBUd0oq6Jr07LrXSrW2mGOf7eMaWxyRfpt0XRhw5eo5 6eVFYxZxNhyWNVm1BAIY8UvXCQlUi0nxMYVw/O1B+8XQSrq0KcmuryTMg9PJa8gfPnzOjWZw3xl Mo5s0I3e+9IbOaOsq4whR4wR/2tL9kMQVCGpxOFeiLw== X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::10; envelope-from=imp@bsdimp.com; helo=mail-oi2-x10.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, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986122166158500 Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 5 +++++ bsd-user/freebsd/os-thread.h | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index e87924fbb5..b5178f298e 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -97,6 +97,7 @@ safe_syscall3(ssize_t, sendmsg, int, s, const struct msgh= dr *, msg, int, flags); safe_syscall1(int, thr_suspend, struct timespec *, timeout); safe_syscall5(int, _umtx_op, void *, obj, int, op, unsigned long, val, voi= d *, uaddr, void *, uaddr2); +safe_syscall2(int, sigfastblock, int, cmd, void *, ptr); =20 /* used in os-time */ safe_syscall2(int, nanosleep, const struct timespec *, rqtp, struct timesp= ec *, @@ -1175,6 +1176,10 @@ static abi_long freebsd_syscall(CPUArchState *env, i= nt num, abi_long arg1, ret =3D do_freebsd__umtx_op(arg1, arg2, arg3, arg4, arg5); break; =20 + case TARGET_FREEBSD_NR_sigfastblock: /* internal */ + ret =3D do_freebsd_sigfastblock(arg1, arg2); + break; + /* * ioctl(2) */ diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h index 6552c60337..dfb22e7cc2 100644 --- a/bsd-user/freebsd/os-thread.h +++ b/bsd-user/freebsd/os-thread.h @@ -17,6 +17,7 @@ =20 int safe_thr_suspend(struct timespec *timeout); int safe__umtx_op(void *, int, unsigned long, void *, void *); +int safe_sigfastblock(int, void *); =20 #if HOST_BIG_ENDIAN =3D=3D TARGET_BIG_ENDIAN && \ (TARGET_ABI_BITS =3D=3D HOST_LONG_BITS || defined(UMTX_OP__32BIT)) @@ -593,4 +594,14 @@ static inline abi_long do_freebsd__umtx_op(abi_ulong o= bj, int op, abi_ulong val, return ret; } =20 +static inline abi_long do_freebsd_sigfastblock(abi_long cmd, abi_long ptr) +{ + void *hostptr =3D g2h_untagged(ptr); + + if (hostptr =3D=3D NULL) { + return -TARGET_EFAULT; + } + return get_errno(safe_sigfastblock(cmd, hostptr)); +} + #endif /* FREEBSD_OS_THREAD_H */ --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986078; cv=none; d=zohomail.com; s=zohoarc; b=KgGJuc6SAryxHUGPb7PT+hAp3iaih8vEFz/eWOOmkSRjPP/d796rvpMBGwurLB+QlR7IVeDIFoTsDsrwhcWY7VSO3BGXDfa8L+S696NKpyjTr8Y+Hcr0Z1Zx22zySCUvzzFixp+ucoLDduOOLbkJth3Y4jWxWTzl5UY4I7GeJsY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986078; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MU3j5DdojpDkUo+HWZbO22NdZmAOKpsWzCm5yMqrbpc=; b=kcqUsudNtqzi8lUbcEt9a9QmnTpf9cKw8rul1cMRjItCNK7vutMcxMrDs3vJlQV/wPHlRtsCMAVRNB+j7E6Sp/In1B4CRz72fptdpc1qPHNSUoftFS0cQfiaXeUk0GirFaQDMK8IkqTCfPUOtG5f3MK1pd4+xNgftp2+WXGZSck= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789986078835887.9033070477991; Mon, 21 Sep 2026 03:21:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8i-0002Wz-AI; Mon, 21 Sep 2026 06:20:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8f-0002WD-Q2 for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:45 -0400 Received: from mail-oi2-x0f.google.com ([2607:f8b0:4864:32::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8d-0002gw-ER for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:44 -0400 Received: by mail-oi2-x0f.google.com with SMTP id 46e09a7af769-81201ed7d35so715383a34.0 for ; Mon, 21 Sep 2026 03:20:43 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986042; x=1790590842; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MU3j5DdojpDkUo+HWZbO22NdZmAOKpsWzCm5yMqrbpc=; b=SMdWJwx2YfD0NGDtgV/NgscTAsk7/RbO1e1SE7qfjBB2d2vANn8Y5yLltQGfx5KhEY 1vyMr1gShsqjdqUzM6/7MwFWqMgHq8PJcUBrRPs484BbVA6I1bW8fPyvy13KDZfkGhWZ fTb/EjZwDcFsZHU7Hj3whqJodg8GZIKbsSAJTRTvDJ5Q57OVO+1nZ4pwWaJKijewKAWz tVe0Hjaq6pWcGacI3vXPYB1fxloWqGMZQzHifrxj/Xu8bXYcDWRxmombKo6diX4TY0fO FAHLeoks2V3w8y5yyT+iaQCuXrn2r1Dst5Y8Iq1XKOpVngSiOLUsa62J8NdtvllgT9tw klQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986042; x=1790590842; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=MU3j5DdojpDkUo+HWZbO22NdZmAOKpsWzCm5yMqrbpc=; b=VpJvpAsXL/tUJwJ7LJfsTqF+4xeLRM15sRPQAsOnI7ZeDQc1l+9MPZeFSfdLc6ga8w 1vCk162YKRNenoPTwUqC/Zg34f52oHYujt4Ppg55AGYZgWzEfsJqaR5V5SKJFL8N+7Bd 4Z9baxf/638nVIyYNKNb3wiUkh0fL74NgD0tA5/VrIu/c1/uxr4CGtTpsl456D+9Z8i9 QlcEcvCAK99erxaUlKrXZSCeiledrBKa87ePTIWSlNPfLRSnt33enzGYdGnRlONTEMiS SJ4qdm80wDma2kHXO7e7eE1LjIphNhcGcHYzN96+O8v8eLkOJaRa8MSf71iJ6gWQCyGB HwaA== X-Gm-Message-State: AFuF++mpwLkHUojr3Wb8T6D4KKdxmFag+/HIP15bLwYm1dkPsQaTdd1P nWiVXIem6wtC18UxWksZjw4Snwuqxs1LlPTeap64CSLJDZAy7EUGzPPhpmpcGi8/PRs= X-Gm-Gg: AYBFou2d9/hfs93iIq5pdtZTPUEW9WGHRU0wG7eAbRwyrK4dehJh2QXTk/nj+u6M4tb aVSKTo9FTYiqDM46on+MAxg9XRg4GOu7SK44AfUCmmEptlSeSA+BFKa6AG5nwrB02Tp4EpBakO+ v1cd1Jggf9hnYICgijapa3/NgT4wGrJHfkH/sGHNY+8vBnk++aIt9xbBRIpNQiBw8vfOXnPnu6b rSdvi5LhRfLe8jRT+UIF0CtXCSFsuKahK239v5UMJs8HdnkP01dAo7QE++nD9kuFJqnrf8XLtMX wbiDuVjljAbRFJE0KEFjaTXBL67IDqtcP6oSA+sdPfzhNB4bcthmQgNLgDwRSOvxwJAIt8Jigdd 3FAQ0X9HJY78QaUugfUvYdX0VegdC5Gz7fY3rveaWiNt1FhCVp4oywYPO2IbD+jFjeheeJTYFeu fBJSAbA7bOBvbiSIikjxw5Ze+wrK7/nuv+iWnj+RM1LRkwC9vEaU8Fcjb/PQ== X-Received: by 2002:a05:6830:43ac:b0:80d:8068:8930 with SMTP id 46e09a7af769-80de20c370fmr10379623a34.20.1789986042400; Mon, 21 Sep 2026 03:20:42 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:51 -0600 Subject: [PATCH v2 09/11] bsd-user: Eliminate unused regs arg in load_elf_binary MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-9-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2052; i=imp@bsdimp.com; h=from:subject:message-id; bh=Fpvf/ndW3E37GgGy7AIEbp5orFY1Ru4OJGAmXefIop4=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTe8cI6soK/+1f6RCXt+1UfSJiX5se9FWgDs YnmmpgWuu+JAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQAWfhAA3ZRsYrfgk7knPITv/e6XGzjgSB6C7QP Sn/QTiyeHdl0BN9Ht60czYgnKKNr34fuqPJlq4sKyBKLQUgDJ4SuJ6ugdwV4mjxSXK04C6gQmg5 iLPPFj6dv4Pz6CMgv6aZDoU+zAZLLRiMOMIuJ1wxqv3tXcbPnLNCQDaT4OcUccCGATVUnxlLOgF KcPdKti3NFoBniP40URHGmcXFaSg4D2pBRL4wDVDibTZ6a4I0AOn5/2CD2bzEotAIRnZd3Q/+Wa AR4+yK3ZoKr/vdWXFxrK4X26OCwLaxQnwLUJanSCRWibEU2BMYEfBqJNd95J5FpWZbWFPLweMew k/qnwDJaV4Cx6qGxYd6ZD/raQwZQ1DB+5/9Xgtv3RFj+VPt2yq4YvpJtqf5gfeAF89Bq4SIvXrp 1l3E1qPJHeKE8M2GeJkfqzHFjk/cak5GTlPMU/UQDAQVKz6yxDCG/+Isumr/QbBzab8usbbxEi4 sXVx/+siMYAAT2qEBDffMDUcPu3HPQuZzvq2TI2cve21yN2DVbtg3rDM3yRWpnWeYlo8D8k0avY G8JpTa6ZYiAmv748zAk04qGwKnexDtQZ+HDAlh0nFf2IgtuBrvt78jRfl1WndnYsXlrl+gt4Bx9 +zbbhku5LIJyrkPLDoh/isTp6hpuZrW+FSNGhpRfTx2BVcDuot3g= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::f; envelope-from=imp@bsdimp.com; helo=mail-oi2-x0f.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, DKIM_VALID=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986079918158500 Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 2 +- bsd-user/elfload.c | 3 +-- bsd-user/qemu.h | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 5b3c061a45..dcf3ca14fc 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -193,7 +193,7 @@ int loader_exec(const char *filename, char **argv, char= **envp, && bprm->buf[1] =3D=3D 'E' && bprm->buf[2] =3D=3D 'L' && bprm->buf[3] =3D=3D 'F') { - retval =3D load_elf_binary(bprm, regs, infop); + retval =3D load_elf_binary(bprm, infop); } else { fprintf(stderr, "Unknown binary format\n"); return -1; diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index a87a892eb8..295dad4643 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -598,8 +598,7 @@ load_elf_sections(const struct elfhdr *hdr, struct elf_= phdr *phdr, int fd, return 0; } =20 -int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs, - struct image_info *info) +int load_elf_binary(struct bsd_binprm *bprm, struct image_info *info) { struct elfhdr elf_ex; struct elfhdr interp_elf_ex; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 851b0c2c5f..5baaa333ed 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -167,8 +167,7 @@ int loader_exec(const char *filename, char **argv, char= **envp, struct target_pt_regs *regs, struct image_info *infop, struct bsd_binprm *bprm); =20 -int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs, - struct image_info *info); +int load_elf_binary(struct bsd_binprm *bprm, struct image_info *info); int load_flt_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs, struct image_info *info); int is_target_elf_binary(int fd); --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986088; cv=none; d=zohomail.com; s=zohoarc; b=X60eyusOkqqbIXV39petn9IalsrBKtBvB9bXgMCZ92/iD3iYsKdiYg7EnuDmK7cIcJxOMXQQXSRwfzXBtmk9KqHfPwsnnwwIvElkMIMiBDup3dF2UASA5+YPg4OeUwkXPBr2RTmuav5t8cXVQAdc2FkHNnXcJUfDnuh7Wk2CIDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986088; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mKSAZ6FBzXteRc983sECAUIs1x6XG4ddUlM3LYVt+Xo=; b=Q6ZSNECyEkoYhaWjfc2rMynOvdwIP9xOCXLn43lDV9W6RAvcjZQg4XSAJWqR1vuJaiQZa297i3eNb9dGWs8rP6qULRJO5WdxhZBzrYWFNSOdokZzrlVMwRmrwMufhjqEAVf1ZdUJZ8zlvWv1/jeqMziUWKinerSqDEuRjjstc4I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789986088011716.2241279402922; Mon, 21 Sep 2026 03:21:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8j-0002XL-DG; Mon, 21 Sep 2026 06:20:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8h-0002WV-NX for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:47 -0400 Received: from mail-oi2-x0f.google.com ([2607:f8b0:4864:32::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8f-0002hF-Iz for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:47 -0400 Received: by mail-oi2-x0f.google.com with SMTP id 46e09a7af769-8138dddb94bso316067a34.2 for ; Mon, 21 Sep 2026 03:20:44 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986044; x=1790590844; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mKSAZ6FBzXteRc983sECAUIs1x6XG4ddUlM3LYVt+Xo=; b=GwJ50/k/p7xQ2i7JnSbdO3xmAoS3u0Uxc0U8WynONHVI342m3dUycyIhMVci0dVdF4 cBzzt3IyxNiPrwlMw5W7WWtUYBc7VQ4N+AS57Nj5+AkZjaLPeoSbE+mg66y4mFO3Dprp xZ6jMG9lNKIVaf5N9XChEOat55fu16p+fPgfpNfJXCNeyJB3ZXN/w9FFbQxR4KlP9Tls sD160VUkwb7VLPolS4OMMrilD3czHH1D6f2JFMYszCSQUxki01m/0wBJwonyzugOYfMi ZPGitnAlDs8g06bDSD+QXCGrtgDRg7MtMz1HUYGQhyBu6Q+fKk+WB0HhJnl+x2SvKAEf CgKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986044; x=1790590844; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mKSAZ6FBzXteRc983sECAUIs1x6XG4ddUlM3LYVt+Xo=; b=F5tGCH+0tbN4DqSY5/3XJy/htqwvTUdLaMRqu9CfqNEEG91A75ApyDGRtWOfQ76CRM t6I/VT539EY4s3h9Irel8pK62y2PD4ba71QzZxDBaQkeKAS1wBfw4SUlqvUZPGbsF7Bi KoZwU3xXra0wwEQMoF5Z3R+oY50E8kCqQhP2i8GJb6g2hz8s7J3PsJZpGZFlL/2DUvCw je/wCcGcvMdmq6/DN5yJ4DB5oE7Zb3S3jj1w+FyOYA/yn7OjBlzpidaJcBFWnwXEUCHE PwpXCmbl6cz8oFm5RgBeEylPWBBcK+vszpCkRqvPSLBMCl/4s/rKiT4wXcipkDCcruDt 3/nw== X-Gm-Message-State: AFuF++mMpBpAL44EL1U/MYW5rA3J+upzpU+8GCRei5G5j9ap+dRbsyNx /Gs13H6AS7mRTCSj7vimSHMF4dD9Wsd0FooQokrbS+PpsQLUUQb5lZGK2A0zHln+2/zoITJ1Vnd wOHsYyvo= X-Gm-Gg: AYBFou34h4HdS1RnYnclCvVHndNa+IP7D+O3hZknZzQvFOXzpQHk0VG83/JBs1HpOtc LnTUUib1f6mP+FBBrnkY9Oh2UOy5o57rq70NYPZRIW5I8JjypPQAAFBS+RmVb4T3lC1Fz/JIw5k dFf/ANYY6QmTFtpB0zwbcvcgMZkmqMCazeAw60frvhHLelWk4yTTVyeDy/nRRiJPukM4K+E7+V8 aWraGYPaFjStrQJK/5y0I9ZwHKm8DM8Q2hUqTNZ+rQiMMla4hegEHeHZNpyyT1UxKjmAAR6VqMD rTLla2WNgJqZhRRCTSyXC9HRnxgqQMUc5xPMhOAcj0fjJcyzk1Rb774NawSNGHxKVUU+T3+/5RF R1ee/KBCY9FOszT5eLMpGcDuGHEYx+uWcxLxi8yajCFWfUPb5q9wEjGMA8ddjEh05h3Uf9J//TW GEA9yaKdPjANwU9F5xXFZDpGUuRHWe5ehLsRL2zXizzytv6dgObyJdMqAAaw== X-Received: by 2002:a05:6830:4420:b0:806:dbd8:9929 with SMTP id 46e09a7af769-80de199fademr11557446a34.15.1789986043771; Mon, 21 Sep 2026 03:20:43 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:52 -0600 Subject: [PATCH v2 10/11] bsd-user: #ifdef sockopt that aren't in 14 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-10-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1188; i=imp@bsdimp.com; h=from:subject:message-id; bh=as+TrLfnMvgZhgHOVxzgY6vI9wuwcgF9aZAh6NmFKts=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTedJR83J6C+qdl2tKBDo6ZukZX1+csOTZ77 +2jRUm2hfOJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQDe4hAAnZICareFYIGnWbmt3SNCKFqg+oR11aJ yRUJGGJJ3uGB67WU8jFHQedlrV3/qgkIIvHkscx++pqgNNxwxz90bSDQ9KRkrv44MrYzQoBN/PZ 2avgiIw3GJFBe+13mkb2xRFi1mjj8wltPmRTTzO47Omxc2o+2HGivzj072h3fZzWdvGY5d0k7f+ WqXCjFpqh7bJn/0jj9ivnM2Xml0/p9oByRu38gxz+VEC9y5K4B3+vT9dN6YkMkbaIdjzzMQIArw GdwPM4/90k6WXyBB80Yyn2roDbpv2k3zx2Cl+yTb/9HrerZ+jR+rWa2j0sg8uQeo6c/EqY45Ck4 DIsmSQ0OZUR3xRcPCiZanf6j9DsNY+uw8p64R5xuYrr5QbgIbJT0gz6jy3ZEHI9bBZhyCXZPaZo 8Kym10bm+JhAYMVocdPgjt0LHhcakq/cTO1coxz7kLhbjltlcoTtEcHqJO5vwaLKnxJdXYeb+yP YbA506i3XecPy7zIGVSdR3jO+O3ISidQHpE3RLRVfWjQooLpqQIJ2Fkk4FqmjjRUZQBiBc3NpyT LbHU3DD/dpAl8SlD28OD1imkNil3vItqSfqrj5Wd4oz24ie6i3/cS6fZ/LTNuqNKuHHVvYn2z7Q ECRENFkzqRWo+bL7DKIew/U02kG4DkI3P98oOPCc3J29XD4EVRbM= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::f; envelope-from=imp@bsdimp.com; helo=mail-oi2-x0f.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, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, UPPERCASE_50_75=0.008 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986090129158500 Signed-off-by: Warner Losh --- bsd-user/freebsd/os-sockopt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bsd-user/freebsd/os-sockopt.h b/bsd-user/freebsd/os-sockopt.h index 2f984cf8e3..55b678824d 100644 --- a/bsd-user/freebsd/os-sockopt.h +++ b/bsd-user/freebsd/os-sockopt.h @@ -281,6 +281,7 @@ static struct sockopt_entry ipproto_tcp[] =3D { { IPPROTO_TCP , TCP_RACK_PACE_MIN_SEG, { SOCKOPT_TYPE_INT, } }, { IPPROTO_TCP , TCP_RACK_DGP_IN_REC , { SOCKOPT_TYPE_INT, } }, { IPPROTO_TCP , TCP_PACING_DND , { SOCKOPT_TYPE_INT, } }, +#ifdef TCP_SS_EEXIT { IPPROTO_TCP , TCP_SS_EEXIT , { SOCKOPT_TYPE_INT, } }, { IPPROTO_TCP , TCP_DGP_UPPER_BOUNDS, { SOCKOPT_TYPE_INT, } }, { IPPROTO_TCP , TCP_NO_TIMELY , { SOCKOPT_TYPE_INT, } }, @@ -289,6 +290,7 @@ static struct sockopt_entry ipproto_tcp[] =3D { { IPPROTO_TCP , TCP_SIDECHAN_DIS , { SOCKOPT_TYPE_INT, } }, { IPPROTO_TCP , TCP_FILLCW_RATE_CAP , { SOCKOPT_TYPE_INT, } }, { IPPROTO_TCP , TCP_GP_USE_LTBW , { SOCKOPT_TYPE_INT, } }, +#endif { SOCK_LEVEL_NONE } }; =20 --=20 2.55.0 From nobody Sat Sep 26 20:01:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1789986084; cv=none; d=zohomail.com; s=zohoarc; b=WhykILSJXy8ci5zpNql1R4qg0VrSenIsFwcoPPnsViR9f/stpdphsRmRUkPXwXwCZu1Xe/0YSV3sORbod8+W0Gea0X3Gca86FqPQwSW4zFpjyE9a32pNyWjS/il9VplSvFP/QyFTRVJ3yryA+4BIXorA4MAnOVvGZLeViuDaDaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789986084; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0uaPHiYfyBVWUyfdgETnVEUJy9A5Gq5oT9ril64GUCI=; b=CRjmfr7tOqtdscAsAH7ePaXecwP+LmIOP3d6JEWWXMJx+n+orF7OdBuHT/MQdUQ5CvP98DyqcT1jQFtoiAtXAOzrU5ijvvdipxcje6r4NKKzoMGasj7abdIFt8tTKDBYGb9p1MMS4oq8np9qBwByKPgb8u1wMvQmHs+HRSn7go8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17899860848161022.4916871426364; Mon, 21 Sep 2026 03:21:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x8b8k-0002Xf-6B; Mon, 21 Sep 2026 06:20:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x8b8j-0002XK-5R for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:49 -0400 Received: from mail-oi2-x10.google.com ([2607:f8b0:4864:32::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x8b8g-0002hT-By for qemu-devel@nongnu.org; Mon, 21 Sep 2026 06:20:48 -0400 Received: by mail-oi2-x10.google.com with SMTP id 46e09a7af769-7f4f0dd550aso671063a34.0 for ; Mon, 21 Sep 2026 03:20:45 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8107dd8f425sm7613601a34.4.2026.09.21.03.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 03:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1789986045; x=1790590845; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0uaPHiYfyBVWUyfdgETnVEUJy9A5Gq5oT9ril64GUCI=; b=l56AqutmI6r3s8vY9qYGKLuH5kTL8ONseXvrsi1oGx6wzEbxYFqH2fG9ExEBeG/FO0 SsuQ/L/Gqv3oFMYxRXgZem31t0PdaoxVGndf7IwSUOJDyXLOvb0kA+YXJE95KRUAHJDC KfSaqtRBrF0+tpVSE0/bCTVQ5pCsyOyS5WyNysgRUmvKQJ9EXUyZMqt5egSDQsTWCF6A E4BRkajK7Y8BSSBHBZxTVlscIBsr6d7CtDg1XU5U1ZXTvOJip22tA88lhl9ukBYQg8mZ 0Szi6R7Z+Fjcl+n3U22zI54Gu5KpEhCgXDJEymLH8hQLlVrUMHcZIKjQyBZboVpj1mGI 0FvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789986045; x=1790590845; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0uaPHiYfyBVWUyfdgETnVEUJy9A5Gq5oT9ril64GUCI=; b=MPqEvqcqGHFU1psk4fxfU5oXcNbIDa+QQ53tdK7AeUjGMdYmf2R7p/QZaBQDPOmZnX dTrCmFIw0lXZh/HKhvSGPcmb0IG7PjCdgLQTeO/XVUq0wMomo+4wNys1fGbPTHzFveZz OmdDRERdg2W3X33PgtQ5v/ru+MhMVsj3Zba5ZQcrwjuKzjdY/8fOaCI4LxCEhEMy2dM+ oxHd3DaWTEDpr7HP3oKRVs+RpxP+txdkSeyxG7Ct4QpMOE/gfaQhMuQF6WjROayT79Zl gBmI/Zo1oa9YO6qVyYqlFxgmvPMBvl0kxVB54KDLd/zOsWNnLXSOt8AC1s8UYbLin2TE kb2w== X-Gm-Message-State: AFuF++mD44ZRy6gE2Y/aRM4R+5mRxSuWfd6W3jDvE3ehU01So4HaHgnl LfkrrnFOPOO9IdJLnk3X5OsraPpJEvN01WNBwSiDDnZRa+dMW8b1o6wCPrLoNYU9QEE= X-Gm-Gg: AYBFou3kQ0MgXO52a1FtAx71YpsiaeZHC2U0/FYVG1oRgWtOXKSOhM2MelXu3+ZYHgC 0dZmldwEVf0LuhL6qcNYiH2r0SmBO/8w7HvI4upcPPm7iJ1RGRymh/DVUOovgdQW6hR/tYF/W3u VBnQAcflbt3alBLO+9popuJA5CmqF9IZ2qcAI52WXmPfMyt3ZixXk/ch2plfX8s85KJIYaDeVZA uUOZ3LyiKN1ylOljATbX6WbGjXEC0968AkRn0zo9Crx7Qm4ByQMWvI5rnXus74r0Hz6S6IXPZmk 42orX3SnKj4XdzbdXVASvvOVK6nbsTD0Dsqx/50ghhvy64kSI7cG1+W9z5tmeqjZLvy6IftRSp4 febY6OlxHa3oqjxB/ubFiA+SH7KaLPv8m8+aSGjWgnV/VmI2k0kjWgJS2J1RLeoltWptpB1RIdV ls3EDRma/RDiFy1B45e3Hek0ftnQuFdJxQA7hPgW5LJViGYCFLfO4tJL8PdYFPkUgbJ03r X-Received: by 2002:a05:6820:2909:b0:6b7:8396:f3c6 with SMTP id 006d021491bc7-6ca9c05bde7mr9088365eaf.40.1789986045100; Mon, 21 Sep 2026 03:20:45 -0700 (PDT) From: Warner Losh Date: Mon, 21 Sep 2026 04:19:53 -0600 Subject: [PATCH v2 11/11] bsd-user: Remove host-os.h MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260921-misc-2025q4-v2-11-5eae157d31d3@bsdimp.com> References: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> In-Reply-To: <20260921-misc-2025q4-v2-0-5eae157d31d3@bsdimp.com> To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1815; i=imp@bsdimp.com; h=from:subject:message-id; bh=uYHJvnrFuD2Ozs5LUh/1bahAK5/VveRwnebgq/TMqaY=; b=owEBiQJ2/ZANAwAKAWwc0Sh9sBEAAcsmYgBqsQTeqJEN9C2Cd80SVydR5XURwOV1R8WSKc1sM kpyt76IVUyJAk8EAAEKADkWIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCarEE3hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQbBzRKH2wEQDjIQ/7BkTEOIP7hzmC0L0xPmvJbNc7gZVnp2v ONjVdtQu4wbvjlNiDDldJ4B1vylfnXWp5Fk6c+8OdI1SiIhUT154/qTUsJPx13Jbz4Ie23whuUw Tf4wuTiZ5xCe6Md00bUGQnYDGBPZTBskaYNNHd5ilO1aaro5d+A9n8wrfzbMbBfnMGopYv1UMoi 3n0KmZfoFXe5tFuRhdPQ3PLawb4Xff5Ss8GrE98B4dAQ51xks/Z7B3C7xOMTwqMLXba+29UNanV mAA2yWVdWwf2gfk8Dr1Q4ZheCpTctT33voaYk31GXJT0hNsLDmE/4qBgEPOv8MmkWpOUMyaj2qn myiAUdBQxeZoSOFDrwZoftCIHde3Mne4H392dJL3WlDHzUkeJh+cSYDhWs7m6hdkcOyZlEfNC7H ZFKrYJWfUhR+ao6igTMoreaYQ778Dfhn3tATqCk7aqdCm+Bc/S6VfJyB4ySPNPA59GHk9fRr2HA 37m+svyNfTQhaDpFV+rrQgy/anz0VEy1Ya6OBjjs2uFFDxVL+905gKANLwBbKcIj87OVtt+N2Kn 6veNSevPxMWe1mtsd1+L0RfIT0p2pmZJz54SiviCqHzdWCeP8A2UJiG93Ruoo+mj5ClTnRJeLYH 0vblcStwWVLnKZfz8pW/pJ5vtvE0qc+svHnAQS4EC3whC7tQEPHw= X-Developer-Key: i=imp@bsdimp.com; a=openpgp; fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:32::10; envelope-from=imp@bsdimp.com; helo=mail-oi2-x10.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, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20251104.gappssmtp.com) X-ZM-MESSAGEID: 1789986086094158500 host-os.h was used to just set the default bsd flavor, but it's no longer used. Retire it. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/host-os.h | 25 ------------------------- bsd-user/main.c | 2 -- 2 files changed, 27 deletions(-) diff --git a/bsd-user/freebsd/host-os.h b/bsd-user/freebsd/host-os.h deleted file mode 100644 index 40cae72ec9..0000000000 --- a/bsd-user/freebsd/host-os.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * FreeBSD host dependent code and definitions - * - * Copyright (c) 2013 Stacey D. Son - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#ifndef HOST_OS_H -#define HOST_OS_H - -#define HOST_DEFAULT_BSD_TYPE target_freebsd - -#endif /* HOST_OS_H */ diff --git a/bsd-user/main.c b/bsd-user/main.c index 13cd752b99..29ee59de2c 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -52,10 +52,8 @@ #include "exec/page-vary.h" #include "exec/watchpoint.h" =20 -#include "host-os.h" #include "target_arch_cpu.h" =20 - /* * TODO: Remove these and rely only on qemu_real_host_page_size(). */ --=20 2.55.0