From nobody Sat Sep 26 19:59:34 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=1790104959; cv=none; d=zohomail.com; s=zohoarc; b=lzTuT0NbxCTRnT25BTocALcqB++zbiJlLGgxdy/CXF/lYVmRwJ9lvwJ3Wyf3eYg+nfJ3zEGtRbaF9RaRjTQ+DlrZGa+Y0VAaOu/FU+e2OjmgcA4mA08cxeCUVsm5JmFWx+d6TocP3fwkfnLT/hMQQE+nzqU0pX+VO2u2s0ffIQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104959; h=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=d8sJC27NXyd3qQPylvoTQ8kruB5VgXx0Hct3PQ6Zi24=; b=haLrvmlkElFg7O0gvEn9GURld4aPtitE/28GWhpAh+rHvDUnqBHoaupuWoz22UicQpx9qOcUpISWpE/6Npwlcud5mcVdNKuaTVqpw0sLwVpm9GoMfqZdt9wBEdPfq59ENx1Wylj0o92taJHwGNzdnnkiVcsWxtdK35YJT0HsJS0= 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 1790104958939227.13857182557012; Tue, 22 Sep 2026 12:22:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964F-0000j0-Fi; Tue, 22 Sep 2026 15:22:15 -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 1x963Z-0000Xm-4H for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:38 -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 1x963W-0002Ns-Og for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:32 -0400 Received: by mail-oi2-x11.google.com with SMTP id 5614622812f47-4c3b639adbcso228539b6e.1 for ; Tue, 22 Sep 2026 12:21:29 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104889; x=1790709689; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=d8sJC27NXyd3qQPylvoTQ8kruB5VgXx0Hct3PQ6Zi24=; b=kMCA5jC1172xdykMUQIKFflbvmF5SIxYPHKrKkeigeiR0B1VIrv3UZrOVoVWsRY+Tj zeqKlRcQq3huboKq3YTI6GXZViLrqoqq2hKIqkWpIChVijWsC9/a+sGN7tTMw1fhCejP e6xkCbqHWcjbe7x4DTz5QjSlpJdAxlWjcr072/Or7tTfzYCtFDi6ijzyZnm8SqgArC35 6+Xf+rLyDkohmEdW/Q84ZwHVwIcxz4BQeM5PkF5cSJ9TL+ZrLqWPgDD020UQluQngj/1 pIgr6JgeU+DxcMfTIi/ugmSw3gy64XNbi2Fkj0ew4rjEFYbiwffxgiGbQw1F3XXZDFbU GRsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104889; x=1790709689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=d8sJC27NXyd3qQPylvoTQ8kruB5VgXx0Hct3PQ6Zi24=; b=Suws1nUbM0AoByRNgSBJaFbkwWTFAo92pHCF1bWMFmPrJi4/nKsxE3PeyOSDHcHh4Q CrRk4WMLBUBUqQ0oz7M2tRElPEVajDnhJhrFE9FpZYzxZZWbmaQoHqD8jNXwkoXgeiys V+DOY1D0SEThix/0ijRQX+DF0ADyyM+b4n+3ZFo2QZApI1gOYee9rxhPIyqD+FeqpnyQ QuwEvEY4+dvNxjEr/KhRfM2taMi5wR/+YdUXIS8ZJhOSJNabAg0ZabIqDDbQoSheTKqa w1otKKwt8WJ8lFUYpFp9bowT/ve4RXc4CBnSRXnmaV16X8wMRd1Nj3Tn7U0MphjYqlKT t+Uw== X-Gm-Message-State: AFuF++mJgmxch2bD66AstwuR/e7i501WbrlHqdx5NyjFNsFUWOqsIdNR aaNhZG3kETu3tbAfL29vTkGmLGMFT9eJ+8qe8Obk5ugiCCzomSwbNHLwkprpx/EdBFOnHZGF8RL A1fgZJi8= X-Gm-Gg: AYBFou0guvSEqABLgFplzIPJSsoXLRId2efFYepGhW+Tf+XtIMNaDXqffG7T0w4UhOm ZziKvXMHZT5C42xZJF7yjS7fLp4FD4QtmleWxQD2JJYm3I+LCOuxjfd7Vyz2BTpqVIBT8HV9Do0 o60X6190wzGXGZ4YgEEGjFDAmd9Fu97g3ro3RDy/vnChHCml6nR7pgoNYd3XUNeCAHBc96jkORs Gp/rwnnaprdNibkNIbK9iGQVxdnYeCQruVjKFgK0IuB6vAG+aJKS0+kwUgi4l1L4QxuDTAEmN2y Dui55naaTVLi3F8/uO6uyI0y7RSoa/38GuwjQTCHj5Fyy5l25OsMaHs13Am/eeD0eIANnLzCOT5 fu0ZvN7xwWtHV4of+QbvC3RnEDKZ1cUaqlHtnmpunTGLd+LUMOQDj7Cw0+UiOJurXiJ23miPsR+ V5OeiYzYfc3HWPI3hriVMmrTFrFmclgoQCBwXiypN+c+0o+9xO+WV+Rz+45A== X-Received: by 2002:a05:6820:3385:10b0:6cd:3fbd:1d65 with SMTP id 006d021491bc7-6d2d3017efdmr276959eaf.79.1790104888771; Tue, 22 Sep 2026 12:21:28 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Rick Richard Subject: [PULL 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Date: Tue, 22 Sep 2026 13:20:59 -0600 Message-ID: <20260922192109.98467-2-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 1790104961027158500 Content-Type: text/plain; charset="utf-8" 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 19:59:34 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=1790104951; cv=none; d=zohomail.com; s=zohoarc; b=fX9zywoIBZufuwx0UVrznvX5YTJYOkH0vXSY79FGmwpng2gidWEstZ8ufovVETM7mrn9C1JXwUlp/AGnfoWSO0SD0dZqrFPbvgIi2KGoJwlvdaJMPCLU3eO5mAD2x0JeTLa1cVQPgoHe4f2W2eDuijjqynG0l3bCd5a74WXdT+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104951; h=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=WCbS/CXY/RTWtQaFnNbXhvG/7hN5jeg2nC9MHaPKqJQ=; b=eHx6bxPuWZ4zqf9rqUzP7Bn3r4xitFmf9eIZqD+EGPsYzHotzt3Y7fPyEkf/+DVEKr1mJJOWR63VGwjQxBmJUIY8Rk9jep6/s+EAj8hjJ1XcVV9uMpfKkHMeHp8tHGK0w9Qz/rOhYt+GYS+HgbjetLRwGFxqCAU35xqL+RJJYlk= 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 1790104951322721.8866724269276; Tue, 22 Sep 2026 12:22:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964B-0000bZ-DX; Tue, 22 Sep 2026 15:22:11 -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 1x963a-0000Xn-8L for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -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 1x963X-0002Nw-GP for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:34 -0400 Received: by mail-oi2-x11.google.com with SMTP id 5614622812f47-4c6ed1de994so202049b6e.0 for ; Tue, 22 Sep 2026 12:21:31 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104890; x=1790709690; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WCbS/CXY/RTWtQaFnNbXhvG/7hN5jeg2nC9MHaPKqJQ=; b=u6Z57iTPsl1Yb+VTxtGu00fesCWLvuGR+9hcZbbXRGLD79p9ZxOEUQoY9ir68dJq4O 7ngvupwZU67B8yEw3ztVFPd3wuJoe3zzK8lAcgBqXjyOQ4fTRydzzxSTYa0TOoLefu69 noAmDz/Ejjg3CSC5Yj5hHITFvUui6drSmgAfJseyF/2yu+Nk21yAbfcDaPvH2O9glcZe nbkwejA5fdHqXdl7NQy4wA8CwTdVi8rItN1KlAywtvVO4odCiAIrWlUoC7AA8fSqrZMw JhxAZBumct6NtCjmpIVMCttElSAVzMQEedxZPV3iejy54K/C5ftCTqt2m8Tx3jft/QSG 1qMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104890; x=1790709690; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=WCbS/CXY/RTWtQaFnNbXhvG/7hN5jeg2nC9MHaPKqJQ=; b=DvXx4IoeCZ8k0bQI6mphymtMJgDeovN7HWvV+E8Xh5b8b1HZIoIw1w94wa3yw9ZF2b spaGDAHwNYDUDLPaxgr2WNEvG+/h8SP21t+4dWTGeATXLyJMAwmMKykZJ6MG/FKFaNCv JMwPL3T70mWgGNtNx3kwwT+idP4BUlfazVyOfB+qwR6kVfhS8+1rb9+VnAhagZoKKkFY l9z3icNXPMyXm6+8SeqrN9k1nrhzz8DWt9wGAsmMT1YDG2cb70CpH0zxP+ScL+pIO3XL kVbba2ks3HkTDKfkMmJEFG+qWWoQDW+VlTqwhUIqQp7iGUt63zbe073Cfaa9MAxxY2hN kHnA== X-Gm-Message-State: AFuF++nkNPLIu4naSshtbjSpJ3qWMTwG0Q9nq6l++/pddYg/ASdwvBsF dfLJo9C6SDbanOht2ncdPfMln7ExpXr0R4CpL0T6RPWDRJU3rzB2eQ37KKi+0qUb+aOPKszyeD6 8Uvhx12c= X-Gm-Gg: AYBFou38D/eqzcHEEf0HgOe6HU+WG7IIJ2NPRf1vpiRUL1K+/rWqCOTu3bAvDmwvCKm pQ/HfTicaHRN6c0SfRElsAmk6NRUvZP0iMR1JBC4ktH1AhIMM8VVrmWOsZfyyvcVyAIjE70cC9m 5kUFX4MApu/3RbHOgQ0zJ4f8KlsA9oxQu4uiB88eNTLg5MUluBt3nuaS0+VFkem9vTWlSRrPrte pVPjZnPsK7jNx2EVizPo+GfHKepPZg1R1/pcD+vmu3nrIkZ7MBXtisFO2yf/dZpzcCewB4Phdps J7S13obpNZDm467/XF6yFyo5QMLS2Woj1+umaLpjtKRq2jt9GZtLp3iSfV7wVvRFGjHQ61LrZ84 9UVw7jFT6Z42u4gIayPxxJmFMG012/kcgZiGf4s/fv82PuP+dnodBGRA2pOIjlHxgVKEBUm3m4J G/Ys7zm3050rn5ph+iNRn8cBpFsXZFDSWl5GMZKjQPwU67k9J6SnPjjIK8P+yV9YSXeC0U X-Received: by 2002:a05:6820:1ca9:b0:6b3:1874:6f21 with SMTP id 006d021491bc7-6d2cd07afedmr441952eaf.0.1790104890213; Tue, 22 Sep 2026 12:21:30 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 02/11] bsd-user: Drop support for FreeBSD 12 Date: Tue, 22 Sep 2026 13:21:00 -0600 Message-ID: <20260922192109.98467-3-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 1790104952821158500 Content-Type: text/plain; charset="utf-8" All supported branches have these, so we don't need ifdefs anymore. Reviewed-by: Pierrick Bouvier 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 19:59:34 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=1790104938; cv=none; d=zohomail.com; s=zohoarc; b=G7ZFGcvVLYkaooB01XAKkMmZO48FrFjLzAY2fUiBG9/anBZhkcXYUD/xFKyBy45X2gdyF5LpxirLf3dbip86wyXew8PoC+wrjcLYbwYGYLKfVtGWjJRoG7DJYVgmG2J34cU0qXtVM0elXoSskxO1DGWwvsrkfgEiyMFxDYoygfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104938; h=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=m7q789p/m6jOBw/fvMfhmLO8/a6GbP+IgiRNfeG/66Q=; b=bPGq5e2rXp2LHYjq7bVop0lvhR92Qm92MLUYrKN3GaeodhEssrqobMpSGCtDsAkRuPRHsFvEseYzWj8xUIYGjJf+59saLFNMftQKbUJkeXOtBq+Q9kQH9gDpUrmnNNHs79utonoMmn5GY/vBOZHwoqhO6rZBFa6e6at503Finf0= 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 1790104938728682.6656870294283; Tue, 22 Sep 2026 12:22:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x963z-0000a2-8q; Tue, 22 Sep 2026 15:22:03 -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 1x963a-0000Xo-9h for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: from mail-oo2-x0d.google.com ([2607:f8b0:4864:31::d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x963Y-0002O4-NU for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:34 -0400 Received: by mail-oo2-x0d.google.com with SMTP id 006d021491bc7-6b1ae6c9b72so51410eaf.0 for ; Tue, 22 Sep 2026 12:21:32 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104891; x=1790709691; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=m7q789p/m6jOBw/fvMfhmLO8/a6GbP+IgiRNfeG/66Q=; b=ZU+UT5aJvfIiMwQn+W2BwDfwlvMVGy0WlEuPkksjjt4s5yA+YiGfqlsXyjBzFIXkkY nJwQnVmTxqr5mzvszdtiZzKCt8xCPB2np5dZMqJ2slh2wgGGhrCls0mE9iipHhKxV3HK J3JXtf7yexGn+bJN3rEfL48j3lmq0KcQBCpxtFeo5M6zApVUdEmPdU+vzcckAsHsRWHF EDi6ffc7dvt8HL/9MgrTi6Ws4SJqtR3rqZjQBA1bVUvKdOLH3ef5XzT8UbhVa/NzQUGA ZeP9o6PVX1hJ7aPnO7HxuvkfikSBjHDVI5hV7S7yI+6dsn/U4SdWI6RpFt3qAZh6hBKB k5Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104891; x=1790709691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=m7q789p/m6jOBw/fvMfhmLO8/a6GbP+IgiRNfeG/66Q=; b=uxWrHwKPolmxmG8/PZ3noclKZTJOynEFzHHCn1+crQlPG0ddghztnVZxBJg0OZ9/Go 95jm+2lJlrnrmLjIIbru9iYJdeyLnvyRqzQ19lP/O97lB8HORtjRQ5agdZm453dSakih Ux8RPkpeIUfOLGk2vzidc2ybTJ04OY9OqUOqAOXJzVzj+I0i7Nr1aik16uk1ix2fuguu 3k/7RIvFiVy5x2SsMsduYkNtHfcEQrIxEGFDs+AVNRQ/BOzOaVdOtAdVpKab/WQXzn83 29+obYlPrTNNvFNASah9io4FMQpmDmwP+cFUKSm2NlsZyn5EX46RxsnFPVee82VRRDYV fL4Q== X-Gm-Message-State: AFuF++kKWV5joWZ60VYIE44O1ix6jYYdbg/5Sfr/HlgGLPyB71maLWqF zbVNJs7UyTX0LBei226vZ05oYYEAgWNqdDGg9ZrTWNdnrtVsZXqKJxiiuKtXF+xJyIxM1+SCAte QnEtgw84= X-Gm-Gg: AYBFou1UzzwLfmopX/lkoR+aKaszAM2qTzQLZ6OFVXAkUPqFUy8w/yfTN+sPW25NPVS 8gqKeMCKs8bdj2V7keH8UIo7zM9RbEV8MSTz8kJ+KT/Qwv9x4lgCpVIA+zmRYSqCeL6awpv7Fiz hd7aoU6aP2tthL3XAIRghwSuUfopx29bdIgHhAfUHrWw4aK9/W0kIm61pkbBDS5OFFYRGOGwZmy LsLu1GCPqxATc50uE++wrFLIUirzhYjhUEXVOrJmkFeXA7le29f+zlyw1Ho4zpEiswdXmC1tHHh U48O9HriwUg9gyZ2GG1imwUkzGSDovnGek1bgYwGuSK72KGLqR+f0og2ZFXAp8L5D3dSbUaXLiZ AF6qp38T0P/LxKCVxeyL5YNCGiwptVr++yziL3e104OmzjgRO2JvTyXIzonNPzAeizsKOH6yvyh dxO5dEf0xNE+A4lLMEEO6dmy1E9+g8pgxUdnW8lUxPjZhvU1ojsozQaN0HKP/an+anDAMSsw== X-Received: by 2002:a05:6820:4def:b0:6c1:db64:da34 with SMTP id 006d021491bc7-6d2c96b4921mr356527eaf.18.1790104891329; Tue, 22 Sep 2026 12:21:31 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Richard Henderson Subject: [PULL 03/11] bsd-user: Flag shared memory as needing atomics Date: Tue, 22 Sep 2026 13:21:01 -0600 Message-ID: <20260922192109.98467-4-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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:31::d; envelope-from=imp@bsdimp.com; helo=mail-oo2-x0d.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: 1790104941229158500 Content-Type: text/plain; charset="utf-8" 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 19:59:34 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=1790105030; cv=none; d=zohomail.com; s=zohoarc; b=V4CJOC+UNR37WVQxx1+ZSdMCN0AJoey2BfO2mXOSi180wODwjBWiplAz/4aqy1kSG8NpCxHJWh6phGVaKcp+2jcSqjCiEiG4AIajIDuNWngQwHUxIvIWbhbcD9g/TJJ7xs17f1sbFoDZW5aer9C2Kz57IR11GE/TjSIxgouSvx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790105030; h=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=CccOh/rw39PcDyv2TBNp+uDQws9Pq5eD14ZTcp8m9SY=; b=g/Xg01ajGVcrWOzHA1Y2nmD4EP7CGwL08Appu3RCz4fXYVXFd+jiBOpzpu4vkizrO6tfynSZvCA7tQkfM6UDGI4hs3VsKIPbMukRe95E6/Iek2fcKVM5Ax+zS8h+ooGJIqlKm2SwLCKIusdSEK0NUDwPWBbhAUCyVJB7SDQaeRM= 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 1790105030160603.0500948103112; Tue, 22 Sep 2026 12:23:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964I-0000qK-Li; Tue, 22 Sep 2026 15:22:18 -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 1x963b-0000Xv-1i for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: from mail-oo2-x1b.google.com ([2607:f8b0:4864:31::1b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x963Z-0002OB-H3 for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:34 -0400 Received: by mail-oo2-x1b.google.com with SMTP id 006d021491bc7-6c72bd8a02fso112465eaf.0 for ; Tue, 22 Sep 2026 12:21:33 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104892; x=1790709692; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CccOh/rw39PcDyv2TBNp+uDQws9Pq5eD14ZTcp8m9SY=; b=rJUr2zInGhwLdBtFMkVnGL9XQmBvBrp2DsC2ESy+J4egilkMwStmGxb83FbuJ7Lh8b HGfNybqCwkZeIQ4W7+r0udim39G+/oexlc68QZVFR+zI+qPISjtrTACrUBfqso9HlKXI LgioViRcoJVoIs54sQIFwru3NKCpGIE+AzLsJStwxi5IWAblcccTHHWd8QRrzLaMINkD 3V+LdykDjDeR2vE0lT4UI4cmPKGuZ/DebO75YFbiuGWR4FYi0XOZZBMtMAeQ3/0i9GFP 1ApfIMANXAb6QgfdkyQwcHOOmM5gkp9sGvmDg7yvQdemB8+syGBizLgplh4lPPMJ4K3v l41g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104892; x=1790709692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CccOh/rw39PcDyv2TBNp+uDQws9Pq5eD14ZTcp8m9SY=; b=CMm3fXvYb84sIbBO9p3gcTVMbbgUD7yPqSK8eUGyPIf0zaR6bM3tE3Yr1jzGHDQfJM 3fq+sm0zMagdQAlbdVOrwk3JERwUF07wA5ZyiLwydISk6cGM/mntbObyT3MQlSUHlMwF RuE5tCEqd431EgMqP01E9DyfMdUIJTbLOkldBn2zHFhDJw6Aj/I+1r6mNz6KNyceOTW2 kVN1kXeOYdx5a+TVmeno1cPlK7o2DP4HG/f339JpxnsIiHF/0Xp6swt1fZBhWFN/DmN/ X+p2QW3j0YxnV7x+7VqRz7bsRZZN5byF3Y7AE4G+tofr9J+jBsuDRYhG0WJe90GW04Tu DHog== X-Gm-Message-State: AFuF++mnjCmaw9+cKzkjvL2Srl1wo6Wi9JMEc2qHPddxbjnxGzdntcHi dY9wJ02cUjuDTxqB7JuIUxe/bhAgKfDKG1648RV5PIqOVfWTa1iHC+Q6S8D7Cmbjt80X3IVAihl 1REdgHxY= X-Gm-Gg: AYBFou27RCnPPEsbFrL4nQuyOpVFz/E5hKxpdR8zTvFHvKI7S4vC3UD587JIPOXtdGQ 1hWRFl2Sf5qExS30xDDgAviJxA/92OaQiscAfqMxzXEtwVp+0ZwLXU4Y7hd+loHRSfdNxETS8Qm ZztD1UrDlhbXTaGt1DOTS/4peXJP/cZFY5Us13OljB8Pr2RXpSrzNIXWbI1LwLe7PKuSIrfAIHP ZB/btY6KOWVCzx1Hg89gyUEmAhQcb3AhjdilneI/aaAsSSa/B+8HpF2ZmJDBrTTEmUdXFuxgbsw 2W2a6Tn/9EnKERG3D2kH0iWmU2bxxQivgI2Jc2JX83/N774U6FJMZL/xbkcYHSkxEzeW2BzOzof UJ+1WFNMFcvgzqRVi51FPxRluJD/fQuJ1EcJjR1UnX+Yv6aIy2kWQnCn+Lh/JqwDWrodmZdmVH4 bWQd9c4KkOyUx3bgy1XSQTvx5jOkvnQx+rJFfz4PzafdcVtJcQMtHr8s0HVblSt68daJzb X-Received: by 2002:a05:6820:1507:b0:6c9:80d8:a1fd with SMTP id 006d021491bc7-6d2d230abb6mr401015eaf.58.1790104892409; Tue, 22 Sep 2026 12:21:32 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Richard Henderson Subject: [PULL 04/11] bsd-user: Initialize per-arch child registers Date: Tue, 22 Sep 2026 13:21:02 -0600 Message-ID: <20260922192109.98467-5-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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:31::1b; envelope-from=imp@bsdimp.com; helo=mail-oo2-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: 1790105031282158500 Content-Type: text/plain; charset="utf-8" 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 19:59:34 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=1790104950; cv=none; d=zohomail.com; s=zohoarc; b=dN68Qj9nr2u78iUJ0HpKk+f7bmyW1PcnEo2jZ8KiK9cbiQSRfyZeFK+4e0XSJX12FPjWxHIkhp00Q08jKub7Y7yS8zfg4XpxelCJAwI/0yElPtjTrtiXqjOUII5wD5d47osNX86uQyFXpIA5hy/+e19cARo0IKq1af0OY3Ev8UQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104950; h=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=704xuYPyiwsoafO937XvJT++dS2Ej1acSlls9slbXsg=; b=eECWSdCXiAWT+9pJ+3KJ1CEX33WydrxlQYxBB2PTP1bP6VNZ9rgOOdL6/qFZiB5hvMpFQzTc6l0PdDbFGZb7AFbZyepIPk9yeXZuhBbvxIY+sSjvwRIk77xAoijw4ZkA4NNlf99ZKK22xzp/zX7A6/1CNNLJ0lcY063w86oG9X0= 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 1790104949963359.26802254402116; Tue, 22 Sep 2026 12:22:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964B-0000bL-Bu; Tue, 22 Sep 2026 15:22:11 -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 1x963e-0000Y6-Jk for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: from mail-oa2-x0f.google.com ([2607:f8b0:4864:30::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x963a-0002OY-U7 for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:36 -0400 Received: by mail-oa2-x0f.google.com with SMTP id 586e51a60fabf-4906fabf6deso213964fac.1 for ; Tue, 22 Sep 2026 12:21:34 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104894; x=1790709694; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=704xuYPyiwsoafO937XvJT++dS2Ej1acSlls9slbXsg=; b=0YW+Ub5drr+es/bFAubeAn1XqrkLawTe5qPPPbUkM8S79oC08Hp6EpBWWPH0dbaeFk 2WNDR6AzQU4YlbAehHKs4+hxMPimNa6vfEt7sLEtkgbqYPgGwBnvGX07VKRuQBm3x1Kb 93NeaBCMmYRpBsJf5qcBmJbX4WzQxn1gDe1PL+WI56xs+ntq27AVYfdqdCFPOOIk0/Bs DtTlyRwCjAUwP0HDGShwpvKmI05F8Rpn4/IHdFr0XSuekGAq4aMGAsfDfFlZst3SGa2u qxAt7MeUvpyk4lFjjcbzblhG4jLxD4zLJt4dwP0hgH29v8GyTN4P8ZE00uWg3u1HsjMY iZoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104894; x=1790709694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=704xuYPyiwsoafO937XvJT++dS2Ej1acSlls9slbXsg=; b=f4+oXiWUMBrkHf5XMp6mxI0ff4SJXS26Mr1uuULNmPli4YRcWa+DaWQs63CYmuWQh8 oGNBVlHI7DMqfwIc2Sdcvq+PqquZ4IADgcK2edyeOS6BvwAVrrt1dwOUbrsY/luiMMZ5 p1eP+rnSbqWJtB/joWtRt15qjkEtJOczJSa0dqUBjgMcoAReEPYwXCAfWbDOctbMfT3M tQiIhefyjjRvJs5JZ9wxGLecUD2+bug9oxBlBt/jtjKoEYx182hANoIt4bCqQZBtZnHP RZDTHIPOiyJeFXYBjnyKBd3XO6s30FUyDNULWPpv4Y62e0SzRua6ZMw9BEIkthPcdqGx m2EA== X-Gm-Message-State: AFuF++kbZpWCJBQxIHo7Xipt54cfyfhr75u5wHkhGZrJyuhpx0IQFfe2 SNbExkPFDLWDBuzr04/6rH8IND0KPVR3Yvr8cwOcQiPj0qMZSB83HTQADNqozdY2xemHQKA0Jl/ HJ49lK9w= X-Gm-Gg: AYBFou2cG2zIIthiHOOWmVB8LmsXbCiMCyQ8QIHD9upCBihWLaCbwcovIayjNtlUbAH 0+ZI8qa4hfoYzfxfd1RQTYJG2efTRKIreH29lmos7WZsyxxq1U3wcBC5rhfvzURisU74UnqIb5O qT9TPHXQA2YyEco8V+KWjlq+LuMgU7pXT532cHW7FH00kEXhXgM0eWWN8WhSfa2fghY0Cqk8xUe Jt0S20/rDvxuNGaGzJCEpjsG2E72I1JKAJKIpJ01n296i3HjW6AdxH7eFIAu9p/SG+gjI+gb9SB yda83NKC/1waBw7ri0iTKU1e4qpEJm7sRpMPC8V2q/m2BEcyULlWyOrJ8/KkwHLpuCGtqj2RuoD n7k2rq4uKtRwTJ+h9LwEX5E9I++zfftwPXQvOq0MuX5slK8n8eft93dipCozxVVVWqQp0adB5eC q+fzzltC1Av2uBwgx9SGL3z9x78PwEfP+55f5jnr6iEHTo5Jdxyk70JiinJhVe21ONQpEr X-Received: by 2002:a05:6820:809:b0:6cd:3fec:de79 with SMTP id 006d021491bc7-6d2d3702994mr301504eaf.79.1790104893577; Tue, 22 Sep 2026 12:21:33 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Richard Henderson Subject: [PULL 05/11] bsd-user: Fix crazy bug with mmap Date: Tue, 22 Sep 2026 13:21:03 -0600 Message-ID: <20260922192109.98467-6-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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:30::f; envelope-from=imp@bsdimp.com; helo=mail-oa2-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: 1790104952865158500 Content-Type: text/plain; charset="utf-8" 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 19:59:34 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=1790104978; cv=none; d=zohomail.com; s=zohoarc; b=ZXjFG+hqQz1L974j0zUytbuwmnjVA/CE92wT3SleBk4mV6i9uvs1wCtXSBenBNzHIr3WazWjssQYMnp1KsdNIwmQniXlsWz/kfwVQfEiE5I7Tl7qIyrOMF7/yLw9vSKt0MEEunv+0gKtkqjQYtt81wK5CuO1h1Qlh7GjCsVhBCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104978; h=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=3802hVch7coeY9/Oku8VrNAJ9qmzEerk66SLOd1unrI=; b=ATP7JqWEFPaTBU/zMGrND/YKw5svSD3IpG1XafhCcnSO1xwYofaiILSrLe6OuwKwp8Bhc3R8xywvSml/FtRqirT7+t44IWBMrWHd7wPl7okoE3UxiOXhdypRMDPpm5+/4oJZnDKLr1fDKRhsmbqvGCPQiwjBSL05LA3z2cufKBQ= 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 1790104978365981.9079001334461; Tue, 22 Sep 2026 12:22:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9643-0000aS-Fr; Tue, 22 Sep 2026 15:22:05 -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 1x963g-0000YF-15 for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -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 1x963e-0002Ol-6a for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:39 -0400 Received: by mail-oi2-x10.google.com with SMTP id 46e09a7af769-7fcb425fb68so205115a34.0 for ; Tue, 22 Sep 2026 12:21:35 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104895; x=1790709695; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3802hVch7coeY9/Oku8VrNAJ9qmzEerk66SLOd1unrI=; b=HaR9ij48corK7+mQy9sZdF3QTOdT28TUasWcEDC9hv2YMgqwDvAWNA6oHzDZYq6E0k RokJngVEyZ5aIH6v1po9ORDtE0CHqlhsiYtFROzFTHf9TqjzUZSSMG3N+G1aJsIbqyOw NcmfYyD8Egx/rYPYOHbEHAlQnNw+seQrskUfJlA6wysJBp9+1ZseDHURz6FXNU0KnBJA lj0+G4mQun7F3+vHALuFbiaHdr7g7UgtaWNH5yoWZZlwCTa+3b0YA+nVU70/Ezx9q2ED GjMDiWh6PHSvn2BZXGaQPCOxj+kpWOVqOgzjnMFnFDYvHOikWBnzWHFjPIb5I2BoB3Wz l3zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104895; x=1790709695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3802hVch7coeY9/Oku8VrNAJ9qmzEerk66SLOd1unrI=; b=UTR6s6S2NeHuMJpUuXJVx/RRQP1KCk+zk35u8D9MCfGk92N7jgp+z2CJ5BhYH3Q1WL MeBjyqvMhAy5J3DqGNFLo8oHSouostq1NRvy74kHz7P4V4QyWPt9IURkyuYMiQUknHtE 7dj17MKTU50p/oCudQBloUEzaGbcpDhivY/Iitu2GYb0IWB9POr0elEcEy/molo+mkgB tmjuAmjqpWb2tlBEt9+/r2pmxWCseflGKQxO8r9dGHt/ZAriv75A7PrwxQcBeKKfr9J1 B6MEatU4dyYUlwgxMu3UpMQMQX47vtjWWnMDQqIMF1rlbNLoCY34cRGJtRLQRS+QqNvX IVMg== X-Gm-Message-State: AFuF++mhNE2JDZ8GsrrryfUlAY7MLs3GfwmjDWPmhc5MOkHMoiZMPPFI FW6cuB/KccGNm0ln/hpxM15vVqLzB2CRQMkXplI7I5H5OoK4/CNbtSFPpM/rosbgeJziN9f+p8U simUstsE= X-Gm-Gg: AYBFou3bJd1XCjNjjGcp8vczgVIjZSQ9CRWjRMUcIZsWU/8rBR42J81ZmU44VAUkZLM 7HyzIDr413gpj8ZtUdJYutM9AwhvjsgDYQLj87aEt9MBRYXEuZMaA2bPGhitVhvpwurx4hPzdlc m/vxI8JB6MbpKInXvB3+U8sJ2k70wGF3fPbzKIRETF6UpFzP51Uaq3awudjLpMSoSUjtI8WSf3b Tm1FMk8GBqs0q3uNE2YWpk5Rx2AY19IA5oBlb5ob6JZLnKAB9t5ENkm6Nqqyef/lH43jUdTZjES aohrtjCeUhSPkp0WcAik+1bOBQNJyg3/7lOv7rxnVdO0FgS1JYap9VEaVDd8hOMUBNkk/nihO5W cqeAMplnhAPKcSPImyKNn+dBOOeG9/np1nLflHe16WpgiuXWC7mB+KTA+I5kVhsqxx38+Pgt0De txXlhicjp5lpnHbevSySFitmD7DqOjfnwTckVsExq7D5soS/7SFYcVTWqkzA== X-Received: by 2002:a05:6820:a07:b0:6b1:3cb7:f535 with SMTP id 006d021491bc7-6d2cce832c9mr343990eaf.0.1790104894767; Tue, 22 Sep 2026 12:21:34 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Richard Henderson Subject: [PULL 06/11] bsd-user: Move tb_flush stuff to begin_parallel_context Date: Tue, 22 Sep 2026 13:21:04 -0600 Message-ID: <20260922192109.98467-7-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 1790104979004158500 Content-Type: text/plain; charset="utf-8" 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 19:59:34 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=1790104938; cv=none; d=zohomail.com; s=zohoarc; b=Tf0u2SjkZQCsjvPwDwhG19V+893l+7VEerKZ7L9D3wM5jmWOHQujniOEc2tmr2WiMsHkPwZQi4sk4P6QD6v/xTfeQSqkjKN39rexPtP3akZlSPsmB0gyh9CBvNyHEh8D1PtugikZajvZ7Cskae19xAN9eNgFU63opjJN9fAIWqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104938; h=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=3AHaNcYXSe+cuvDtPRXSeHNhcz7D5lhdVYzDth6l0d4=; b=Vprsd/5zKQ0L9BZH3IDgNN3bVUsWfK4nd/M00UTP0/zSIalxu/ET014UrawAmGhsVS+LJ3kOhID69DiV3fLReOsspNpLVFUifWrRh/L8Hr1qBMEBt1bBjFX5ZiX6qeK86JNaWw2SGQXXMfcOpZ9Dip5vIi2x30EOz55GU+8QJCM= 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 1790104938675314.95783119918053; Tue, 22 Sep 2026 12:22:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964B-0000dU-FH; Tue, 22 Sep 2026 15:22:11 -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 1x963g-0000YW-Pw for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21: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 1x963e-0002Ot-BF for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: by mail-oi2-x0f.google.com with SMTP id 46e09a7af769-8137b129131so229529a34.2 for ; Tue, 22 Sep 2026 12:21:37 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104897; x=1790709697; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3AHaNcYXSe+cuvDtPRXSeHNhcz7D5lhdVYzDth6l0d4=; b=DDkAzdZNz/VSNbOX3/7V4rOTjhxorE6XxD+DfJKyFfXOKxi/YTZkD6HmVORgIDgAd1 L8M77i92P0ZWAIMN1HUYXvopLLamhWvuac2jZhwX+a1ytDaJg6WDZ5tx7YfI+QhydD0x pawB0XxK+dvwd4g03YZIyGIufHpysrsMMEPP4Z78B4JVZlENPzQxhhgND3JE2KAQqaZm 9fCn1oibMWuyKVR7CEV1m4T+/wN7s6ybPR9iZoYc/KBHXKtHzf6tatgmLcufoW2wB5yc FbRVEnxXRKEeGan2QfYBoo9OcEXQn452/cNidqZ+V9nr+qpiQyf1vftBqdIWv2+bq0h8 PR6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104897; x=1790709697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3AHaNcYXSe+cuvDtPRXSeHNhcz7D5lhdVYzDth6l0d4=; b=2uH+Ibf1kXEVnldcq7DLDr4JfUY2eddCbZAP6vYtOBTe7zyGgardm9sUfCRwpigayV F7t7Zz//ChCXtKgMvOCHUp/KBb+vvlPWGR60xjOXay7k707okXK9lU3IQqD3z1jgvKU+ NmWH+d0LUzjJWzA4iUM7oHXbKtR9/YgakVEGmrQzc2ZLYFqvARVH0UGLf+EZQPfq5XDc NBBIEDmyXCEHsy+IjxxEG5UTTD0lQVcPsvmvHWYCY0zf7mtAp84I7GpcBOCQmM4ofeXh z4IO2c0BKo6YwPjeHxThNTFZE2XgwvA0TBvbbtAGM8Qlo5e3cjgFdYeQySTNnasQrnfL A8jA== X-Gm-Message-State: AFuF++m0oVTHY0KTEv/0G/eH+CASre9EoaQ0ElA7IhZIWHLICL6okGgY q1TLQ/h/nXlcilJt18Oau3VNw20QWmlHs9Qgr9/Y+M+vcbgT4HgOHd64KjA8y+zikZq8dViAUY9 84aYU80U= X-Gm-Gg: AYBFou3loP9Mi4zKz09SANQJGQo5GYAdlgkZY98mOA7WCyF8idLcX421DZMPZr2zMLc mG3yxRhys253Y6kDdoUpCBjET4kwFlB9LqZMyN2CjWOSmYrjkQHqnSo+ePHuNRP4r10T3hhescZ fyy8O/nuuoctK9B/JnAdTz1Hf0M5kfMaP/H2tIonVWKvdiYjdNII5SK953X/noKxGNZAuyPZKGX vSIQkIRH00XjyLpa3DkQXSRQ/yw1uZpNOqv9qGJzb/Mi4riNlR4Ya8vAXTRn699sV7FDpf0Y5Ut yF5GGZX5pc7jSGwBgNY8uXN4vddQr9M+ic7Hhq5VehAfIUl916i/SJiWLhIGKLxekIC9dtzgGs5 x0ENAl8td/M82f/m8kNxb8Rwy88NSSkm/waCuuQ2M44O5YQeHTlRZTbZQLH8m3N6FuHfcKOVR7l d6OrQ04ugItXpb/s2SJKNIe+HIbvvcY6iGdUkyuNeypL6jxs6lkskdRb0U7CABH157hFsR X-Received: by 2002:a4a:e84c:0:b0:6cd:3fdc:a934 with SMTP id 006d021491bc7-6d2d3807d1emr333271eaf.81.1790104895825; Tue, 22 Sep 2026 12:21:35 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 07/11] bsd-user: Implement exterrctl(2) Date: Tue, 22 Sep 2026 13:21:05 -0600 Message-ID: <20260922192109.98467-8-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 1790104941218158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Pierrick Bouvier 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 19:59:34 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=1790105026; cv=none; d=zohomail.com; s=zohoarc; b=IQRsBZXYZUnNTkA7i2pAcI7ugC9DelXoN3Y4NOoRnBn9rDTXCTX5KTjy79BEvUjEELYD+JuYpuuLoI5WVbR6/Rp6eMD7a/DSZPmhKGFPYwgpCQvCBQ+T/GJuxqWD8i5f2TFvAZavTkC/iEb5sAisJFGmIhlV9IziIScmb2Ea1+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790105026; h=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=rWbNjRGMUh1mhOTZ0cR2qTpaFZU82Xi9hzlRzoXXeGw=; b=LIYJWHsSEx+g8//AdSajt/cNTHJkQ1PR1RNSBiCkaSbWBvYphohquJxWap/nS8MKK1E5AlbibSrPuQ12ZclswTiZOPtuc6epFWrm0ik6R9dT4tQxnh9uav1AamZzoCAIpFsLjEc9CZAB4Ja4Lb19u95n97CoHcY3nb8vfg3aUDg= 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 1790105026255445.0892815341326; Tue, 22 Sep 2026 12:23:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964H-0000lI-0v; Tue, 22 Sep 2026 15:22:17 -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 1x963g-0000YY-QQ for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:41 -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 1x963e-0002Or-Cc for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: by mail-oi2-x11.google.com with SMTP id 5614622812f47-4c6ed1de994so202120b6e.0 for ; Tue, 22 Sep 2026 12:21:37 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104896; x=1790709696; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rWbNjRGMUh1mhOTZ0cR2qTpaFZU82Xi9hzlRzoXXeGw=; b=w5Hyn1jugGJZAQr1SYXe57QWoESBnvdEcPjV1RcMU4kNGYjI8+CpsWbiD4kyZJ2vkE eBf4C6fUuCIkwIv2SmI6lKlrpaePLIAhzJidA9LAGByFEUAG2WPzYPoYreNOlIeaZa6/ UsQ/Hyo81MQct+84BrA702/UZBwpVNH4N17++L2kIqSUKyRLfXpN6LcAAmToDWvEt3O3 J4jU2FLh7A3HyKBzamfjSyII+P+PSJPDRGGuqJtYc45/IDY/4vakYTouM/dweJeRYxBh RGC9pBbmuyrNdJiKSmIZ5L7C/OLnH/OLYWTAI4YQSR452LqYdx2XCf9k7lYIczZSA1h6 /nSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104896; x=1790709696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=rWbNjRGMUh1mhOTZ0cR2qTpaFZU82Xi9hzlRzoXXeGw=; b=0KFE3oFM2Ehr+KH8IWhzYkECktjIfCXp8Zs8VaKN+UxLg+K1amjjREaUekhjGs9lVG 2U48gbOrgPJvkMrYtgGMqD1PKpnqqQXAsTbguXs8e3K9vNc6uIOLet+yno/9JgTh9Xqa 0eg+F1ZITWPoS62SoADLedx0vEX93jxiXXbXTKJfP5/SVLmsNbseodJtZwyLP4pbFIqe SB+KSZ8RQKIBw3AG0GUM1lyDXnHJKiqK6VE4CtP4/uecnZcttO3Z23qo+307yd5JLRRw LKZFCoaJKFxCvb06mR/PSC/PoVJJzQJgPxBZ+93q6BxcxrbP4SVgYfugmeQKZlnhSNJV VJTw== X-Gm-Message-State: AFuF++m6LoZMKI7bo0kEplJreJFbPIWq5AYo3J15wV7OdyKdI/yo9SXa rnGeN8BOr5crIEECYMXlUDaQqsI623/7oJ4hmvLlF9fYof1tCisWK3eY0n8mwIBPoNLPuMUrcUV a6nHWxWc= X-Gm-Gg: AYBFou0q7lBlHVsdsDb7wOYXsB27cR5Qkilw7lWMgKSiwv+MYc9lFYLJkWBKuDIQ4dn cQcv+eDfhaVACc2L/TOhWSZ4F+qK4qNwfmqyZ59wSO1A3ChXWBc11yBm+Ll8JImQT5pzOCC/6IU yZnRcx62WfQBaN4ruzJ8STowx6eUXKAMKWfK+7YpKqIC1HyQpd7eWphP3PLaTYalOeaIsgRo7XA R1pyw5OLaPEs/Iz62zyp0fi4JNiX7BmSmexbrQDe8VAvCQcU/w0II+bxpanZcQT/ELX2MeQc6GH oB7X+pZdodJyDwcVk0ooSXnJH1v1+1aNZVW8+664AjoZ/clREsU6iCtDVZVAuWGweOvDWTPDCxE +4YeXkO5DbBajRLXdIy3dDpY/GhlVhF4cJ2byYX1HzA/300Az7EPRIDda9jXHC6iyypdfpqQUUl lLOa6Lp8FxSqrElyQmZDZWCExlApQjKIXkrI+95CbXD0WS3HBQUrgOg4tx07LafyvrZr2/ X-Received: by 2002:a05:6820:168b:b0:6c6:6e0c:478c with SMTP id 006d021491bc7-6d2d034453amr346944eaf.20.1790104896583; Tue, 22 Sep 2026 12:21:36 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 08/11] bsd-user: Implement sigfastblock Date: Tue, 22 Sep 2026 13:21:06 -0600 Message-ID: <20260922192109.98467-9-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 1790105027261158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Pierrick Bouvier 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 19:59:34 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=1790105021; cv=none; d=zohomail.com; s=zohoarc; b=SclsAre5kc8ve2hg+7stCHgXxjSKTZAFmVbWuLxXaGEYA214FY5id9oLDNYGD8IDEF5tnNMIzLi+JCgWhQyWQSUO03+Vs8W2pnQT6b5Ai+un1kslZoKH/ILwQm8DpOR0nw+lpvE2y31A05ONHztyLPJPJ8h+IIyqyo3EA7MXaXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790105021; h=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=/gahCdwhNyoj1EzcQ2l7HrXiy+uDLWpRnTZHx44GnwI=; b=URliipy3uGiHPtBwEIwtHZRfXqWtRCcfUaJ3o/1NfWhiCyWIxvZbBFYZS8GzD4rKX0C5hEmjZJ5Eh+bfUd41+wMSU7bSAsZxd8ggoB7wOAIUW35q1DWa7slVBSTqlwbhw3Uog5QRjpIn7wrISwOlZih+p+sMz+W29ZwIeRXyYvM= 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 1790105021509517.1266076436816; Tue, 22 Sep 2026 12:23:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964K-0000sQ-0y; Tue, 22 Sep 2026 15:22:20 -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 1x963g-0000YX-QI for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:41 -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 1x963e-0002Oy-FL for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: by mail-oi2-x10.google.com with SMTP id 5614622812f47-4b37a2c0356so179166b6e.2 for ; Tue, 22 Sep 2026 12:21:38 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104897; x=1790709697; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/gahCdwhNyoj1EzcQ2l7HrXiy+uDLWpRnTZHx44GnwI=; b=N7YOLcUBg/Xvu/cJXrmEDbBJ9ptubb50V1yPzSTDSF4QZiKXFwC3gPejJqIeQT6wBt 1Je6MRGbmU1ljw8fHvS1UtwYSEWjco7oxBd7E1VyuyFOmirBO7aJJ52uxqC7gAcABKzW P0U0zv5JnFwTP2v8OILykeodiCk/Ka4Y6I3ARie/jkXzg+lDrJrGZI3ZkRgry2cNCKn/ QIVq8ePPnnzSTfKKBpqya6Bu/psp8pce/7LUqzt4PwakBF7bR494DUqibEMycqZUuy00 1icMyXZKQgFWGvo8vTcZg+13THxUc90dOZnXIQO6DygvUW+GVZeC7R79L3vv8QQAbAtH p74A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104897; x=1790709697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/gahCdwhNyoj1EzcQ2l7HrXiy+uDLWpRnTZHx44GnwI=; b=GwZJhighXb65umnutlsId5Xl2i5QeTtA8k6INLp5yWT+EKzdym6OK++QKuV6X9SPSK Lj+eh/LBjDi8PM+64TqwtciKVEcm7wSSspKaPEsfTAuOjotqLgrqp5yZW8EXkoy4gb/m cFZYLsyT5Mc0Qn9Y5x6s+s+vmtzZHdv1PEdMpmOtuqQ+tv7pPR5qxHH6R5nzAeMjbqE5 IcTa84UseYchYesO+uNJYe31BkPnP7Gm9Dss8rGatkQOCCeLVJ3w7i43uv2A/AycJlih SzqAQSSUYWMa2miKEeb0q32UvjYc7GmKfp7tJnJwQhGcCC7rt0bFnLqNeQoM0gdCRt/S vyJQ== X-Gm-Message-State: AFuF++li5pEN+77Nu3/cAAPs66orUl9TZF+zVQOoCaY8aaKOgmNEVqTq dCXhWBCQRgMQXLwcZwV2G8l0bnnBogjSkERNkHhdKKcifNSP1tKfSggt+zbLYrmqeudWWNaafQH GfQ1M4z8= X-Gm-Gg: AYBFou1V7GbmOvlUOFuUELw7jvfAtvmQagqYxxjq5dvgjk1/oj8wM8jiNNlroTJawup t2lExA98eJJ1lSNddKU8T2XcPwC98ZH7p/ghXGjavcQa8RwElFnk9JadEI4cQAE6sEAu3mCfRy5 YSsuJUzCKupL2s1MjoHeufuGb2+L/aHHmeRdALMAXGZD8dzR4q0KVlZ/Gm5gT5JUpHnKX+gtH6w Ywen21Unn0bNTE7Xjk4NfIFJdAHix2pLF6rGKZ4fPBNhpZHgNiMGujbwouxcNHXkAAbp/Hnp5gP eITwl16DYFRmd/0UxzNoRB8+Q590jIpV8USwOUqI18rvkN36smFE1L5PR/sz3aSrtfgRljXDb5c WGCWISiLEaQwMfTk/mG7/YxAD/UHhAMibqm8UiwNN7wmXsgFD50eRdcarvPCjx/Ti+93Oif/02g 0JOOf4iPM7v5JVsccYweQAUMYyGUmv/HZQiZZ2/d6hVGH9y5cBxO/cJgi/HA== X-Received: by 2002:a05:6820:290b:b0:6d2:8d32:be45 with SMTP id 006d021491bc7-6d2cff42f47mr403781eaf.19.1790104897333; Tue, 22 Sep 2026 12:21:37 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Richard Henderson Subject: [PULL 09/11] bsd-user: Eliminate unused regs arg in load_elf_binary Date: Tue, 22 Sep 2026 13:21:07 -0600 Message-ID: <20260922192109.98467-10-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 1790105023181158500 Content-Type: text/plain; charset="utf-8" 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 19:59:34 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=1790104987; cv=none; d=zohomail.com; s=zohoarc; b=NwA4w/pUAN/oe+luOln0T2SlAAfGq1aeN2WBnH+nJG8xdlXPfNOp0EUHsdsLYG3R4SHJOL4S7Ip9+mYFPcuXSS7gEq7u8JwHJdlTwztbXBsOK35ofsJbol9eIyUzbI+NkU7oen3vdtK9zYspcsMUEc6rHbu03FvNVhXe/kWkSXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104987; h=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=70b7LD7uwTl7YbiqcFI5FWkVSxRT4jcT0BQnJC/Dt4o=; b=KV1Cl/s3+N0hy1/Y0eImls/isc0BaZu5AT+HUiJWhEbn26ykgZbzYmfla2uR1AD6Kl6MvRZn3yZPjwuXtyc3SmQIS8mPZE6BGMtxlUsXzuqBlI8NJbXHeZTlB9Cldb8UYNx161gBDhEm07vWSJ1o89dcInkj5KGuEV5z1IpDMP4= 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 1790104987765195.95668401386206; Tue, 22 Sep 2026 12:23:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964D-0000eq-NV; Tue, 22 Sep 2026 15:22:14 -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 1x963g-0000YZ-UX for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:42 -0400 Received: from mail-oo2-x2b.google.com ([2607:f8b0:4864:31::2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x963f-0002P6-8l for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:40 -0400 Received: by mail-oo2-x2b.google.com with SMTP id 006d021491bc7-6c2613d80fbso133568eaf.1 for ; Tue, 22 Sep 2026 12:21:38 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104898; x=1790709698; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=70b7LD7uwTl7YbiqcFI5FWkVSxRT4jcT0BQnJC/Dt4o=; b=dT8N03C95o4BcTjJPYyQ1kHMlML19anUS6GYdULpfoau6/B+R6q7ZYv6ryDmlra9KV iy09z6Zzb7AKEB6uYXfh98PScp9yZPNTK3lkJ7uk99UVDaU+PC8RhvuwPsEivlGANNOv Dgq3r0nJhEPWD9NPHEVGtBXUienQ8EK/Kd2bfBcYkWOPIYJ2VQ/N3iO6T07VoSfbwSqe 466kpiTCWhhB634yLDzVSbX7E51qNihMLFtuBEVfrpa4rvrOCkT5hbu8kzoz4PN8seRv qqisH5tu9X5xs2fR+0JDw9yzpnne6OIdeOEXGvT3Ko3Pj7ofLAMkOBLU9vm86VQTBRIJ xkWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104898; x=1790709698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=70b7LD7uwTl7YbiqcFI5FWkVSxRT4jcT0BQnJC/Dt4o=; b=UU5Aom0HWXy8xx1SG1Y5JV5y9CVP79oX+dYGQcoJSusZVxbUzwgA+cKf8v5JkIAV3z v37i4fmco4nRs6wEPQmaRL2FfwfyXr88NTRz+bZERUveyALCqV+4cjzJgdqAASK3jUI5 QhuLSoO8Wh8GIG75/+Ff7XmijDoS4e/KxLEp0XmcmJkDRicdEsxRtJ2LyJ63yrigBpVs UJCrc9gR123JDStWOlISj3T2NItqwb2bChJ0CAtoJEAn+8hmTQV8tQ6DGYoAli9czTDS dHV1CcSHsR2i/4P6z5oucbTCKYorS5Fj7vrTnMaVLXzN4Y6SRRubqVTH+HFHE40LvkBY V9Cg== X-Gm-Message-State: AFuF++ltOLcCllS2JI/GX4A8/R9s838UwPEUMjPZOLGaxuAUTc1RyeYh obrBGA2X06l+svo7Y3Ck5fr3dVlftnwZS1vv7opi+MdXglWhPw4RiEPMhIQpTx0GmWsQKHOJMe+ KeMbj8yE= X-Gm-Gg: AYBFou2y65SlPBCX3juyXJtHOIyRW97bfdOfukfSOnsn1z4xqxbfM6gd6c89HVv/rAx IfMpsCc7qw0h8r1sWBHOBB2JAFiU7A3KwSZnYQHh8AVDeKLKrDdoQu+cfWK7wCyHYieV9D7Dzlm pAlan/gybTRThJE0l7hvQOsBH/0tRt/jPwwaDlp7qEGqRAckGO0uTypfMXzMFZY36n+eSSHUT48 /b9IYyAPpRjmMf1t9zHS/kGJhm4TbwxTgAZ9C85WSE8i8dhldAKUUH+aExTlanpnpvHNlJDUK2o tSbKWx2tBknh/kR7jfliojHp+AVQo1wKq1Rgyu/EViIBBgVG0xCKrg2/RCENHk7UMRLi/0dvEnr 8RQgbwdwYYSfJoJKyQVKt08Xw/A03mYe6YLnEBzIUbCDQi7BYu67EztibRwOFxj9MZJly4pYi2i N9W0wBFzwhjBQB6qGRkBt4SnP6zKuIjPMOGz/60lIle/ElxepgvQfBOGTINeNMFr63b/gK X-Received: by 2002:a05:6820:4c0d:b0:6cd:3ffc:e32b with SMTP id 006d021491bc7-6d2d261ca81mr352293eaf.73.1790104898092; Tue, 22 Sep 2026 12:21:38 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Pierrick Bouvier Subject: [PULL 10/11] bsd-user: #ifdef sockopt that aren't in 14 Date: Tue, 22 Sep 2026 13:21:08 -0600 Message-ID: <20260922192109.98467-11-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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:31::2b; envelope-from=imp@bsdimp.com; helo=mail-oo2-x2b.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: 1790104989274158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Pierrick Bouvier 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 19:59:34 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=1790104991; cv=none; d=zohomail.com; s=zohoarc; b=SFsVcSQSTxfH+Vrs36ssgiCeN3QB0cWuzPRaMdg8T6mB2gYLQwYq2nfcRjO3PACPHKMPoix8rkMLBdHJLEt6/FqKUzVuIhAHK1so4f0XT+G62luFTXN+lkmryaxI9AOZSBbbJLbcmS/MsNjAlnjtukuU3Nzi8Ybo0OiU/ZrwWfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790104991; h=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=Q4+lieatj6iS2uRJzWD1BUtasZ3z3npUrCZve+r0t14=; b=VyNVt5TdSCqb95HjdeQQXp0Ytws9cmAdMcKxIlXeezzj31j7ItgftzDEv+5rVlemR2MyKwC/bEm4yoaFkt3iWo9bq6qF1GfVxeI1WRTWo1xTmUa6Cj5pMREN2n1LgGjeLEH6f4J50sgmQTzryLuEhO9DLS/2SqO4yzEIgQ2Knlc= 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 1790104991684767.6248769026035; Tue, 22 Sep 2026 12:23:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x964E-0000ey-DM; Tue, 22 Sep 2026 15:22:14 -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 1x963i-0000Z4-BT for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:45 -0400 Received: from mail-oa2-x10.google.com ([2607:f8b0:4864:30::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x963g-0002PG-97 for qemu-devel@nongnu.org; Tue, 22 Sep 2026 15:21:41 -0400 Received: by mail-oa2-x10.google.com with SMTP id 586e51a60fabf-46a63c34533so247954fac.1 for ; Tue, 22 Sep 2026 12:21:39 -0700 (PDT) Received: from rebo.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6d2ce763f72sm646776eaf.7.2026.09.22.12.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 12:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1790104899; x=1790709699; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Q4+lieatj6iS2uRJzWD1BUtasZ3z3npUrCZve+r0t14=; b=EFOH67ykKqYjUUzsjAh0jXRjP1Dsg2WojczVa8A4fmS7GNrvE+rNGkRftk79e5IHnI bMood1x+UIU/i29eWOxojhjtnpezqSgFNyTY3xKpTzLp1UX6zVHe2UoXZgFjIpXE4x4i MMik+eft6nEAYAd08k3IieTfcZBUHiOGfJ5UDhzXeOuPBPwil7owpsbe6weprbjl4NIL m11FG05Tqjbye876khbJjlmnbQcGGoHw1QWcoL1Lc+7424BQ5oaSkYkqL0g34conIzCL 8iQIDQe0ZGrCNrVi2339XNQr3R5wgLEFZWz0THUXa7iD9wdSVDGxF+jiAZdYGLZ5UtIY xV9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790104899; x=1790709699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Q4+lieatj6iS2uRJzWD1BUtasZ3z3npUrCZve+r0t14=; b=IqY2kg3ee22yroDmtg8lKDGgWQSMvUbu80Q7ZWwZ0petlvAu8IBQrZhWNl5faM+lyV DAQAkXnZwQh4uJ4H/KgLlQ22cqbMVxuqdhQSxRdoZwcwj4KvoDGvmqLvznm2lhyDN19H OouhRZC1MeUwGJKouqWFZ+te3B7E8Br0xRxr23JsGY1MkVQfF5BcbpY4y2sfgztN57S3 OX25DIIXYIwbEddYp/83VYJRB6f0iB3PnPEaY8bKx0MAcpwsOMOJA3sOjTgIFqGX0kBD H8I5kaGRi2VKZIMw+fA4XdNh7FqtSwqEp9hLEVttvoK8/ERyzozsyjHu9ftPqT0AOZYi z3+A== X-Gm-Message-State: AFuF++niQz5ZfR7obmaf/2FHZ0nB6rQK9jKtZaXAKFl2XlBhaf1Uje3z r9ybhYiVnh6w/CfoCNaAnFgbmgSEwo5Zc47DsDZGpN/L1pKpVUJp67dh0U2dzSAEdM24Nb1DCMG Ns8rzbhA= X-Gm-Gg: AYBFou3UaawN2ENSeaS6iKtffClfUxTYfTLNVaYDEC1en7KsyQEs0FChV9UAU8F0fHJ Jcez//UBMoDmQCQ5Vhj3EYXdkw5uPxy8XqSHdEDgQGRZrlS8WWRVk9+SPMZ0An/ya8Ao6MJFoWK jh2+xVCjDkJNstW1zxK1l9JcouOkh9dTsaxUHnpc7XF4KJTPy33bbgKO/1MKdEp0DZaUnAhVll2 Usk6pbOitgQJ63fnz20KWkxdFuShF2qzhvDsc0ysYYGWBv/Wx7Zk54lY91yILoSbE+I7gXjjUEv 8foaU9bZ78FOdu/yG6Gq4z2wBF+y+OG2OfTFI43zHi6SjG6osDTm2N6DaLB5ejGD9rBf6F8ozlM IN+HxueLtI9WvjBPLcPeU1i+3MJ8hMoFMSVMMiYMidCurPxXxqHhN6fhI+FDHh52lGohqpY/Ewv W+RJT7wzooVF9K28VY5vRmnrCe2E9nXdP3MpFpAIWO+D08Gg9/r82TMp+ygw== X-Received: by 2002:a05:6820:2010:b0:6c1:4051:b891 with SMTP id 006d021491bc7-6d2d2b118cemr337667eaf.61.1790104898887; Tue, 22 Sep 2026 12:21:38 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Richard Henderson Subject: [PULL 11/11] bsd-user: Remove host-os.h Date: Tue, 22 Sep 2026 13:21:09 -0600 Message-ID: <20260922192109.98467-12-imp@bsdimp.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922192109.98467-1-imp@bsdimp.com> References: <20260922192109.98467-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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:30::10; envelope-from=imp@bsdimp.com; helo=mail-oa2-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: 1790104993001158500 Content-Type: text/plain; charset="utf-8" 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(-) delete mode 100644 bsd-user/freebsd/host-os.h 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