From nobody Thu Nov 28 09:42:13 2024 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=1693266199; cv=none; d=zohomail.com; s=zohoarc; b=jKAFYlpoc6Hpfp+YDd8b5vllyKQCiozhhr0QHMsSr2LwhR36AK2wZlBr8u31Puo2ywrLMs9w0MOzjCeIg0lV91karHaq4Uj0iSdibg4j5gWYMJSsDUcXh3glmweH/WRKQOy1TInPXqjk8DLogpdtaOdCWYoTXjDCy/J499Xuo2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266199; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L31NhYGodpWvvaDs32s2seCPLO3ZQUAuBDXt6+3D/x4=; b=K8w+5evycudWiwFpA+ntpnfWlH5tI0FiPUBKK5hdiDUZNgSHRZBsuGM1EsEdRBmi7Cvc7vrnxFxkVJoQr9nbOtSNGQOZcRywTqt7vP2hCGJWFpWtRATf9iy6/FKqCB7YxKejtkwwUGczuVVkYmC9c0GZ1VwdiPnH6jibzsddzRc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266199345402.7318549501433; Mon, 28 Aug 2023 16:43:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalri-0003fF-BA; Mon, 28 Aug 2023 19:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrd-0003ej-5Q for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:45 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalra-0006fy-9C for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:44 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-34ca22e3b3dso13246045ab.3 for ; Mon, 28 Aug 2023 16:41:41 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266100; x=1693870900; 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; bh=L31NhYGodpWvvaDs32s2seCPLO3ZQUAuBDXt6+3D/x4=; b=XLpK0xRYh5zayN88esiPy8ZhM3a0dNpYfSYEm4CQ3T3cS2xE+QW1XMw0Ooefh7ZWbP FjGblko855yig1U6I/xBFdwTu5O7uYhV1sROFdK0HS0YvSnAFr/OC6P6s5V1xL12+HlX EOrDnqkstOraYWz2Xjw6ACKmZXT3oS72cQc4lMT3T36v8RF9k173HSohcLnDF/NtZwcO TgxOgcaSLSuyDKHc3IWLPntmB46Bi4c/Wzp4qbMmvtvLWhaHDYzAxCuQ5U8rtMfrUISA r+9oYyJpnOdJE4MlGgdgOW25RcLbF0NI6eAE0UvPAXxX3nUPd8IZO7voGQPb+LTnhfuG vp8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266100; x=1693870900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L31NhYGodpWvvaDs32s2seCPLO3ZQUAuBDXt6+3D/x4=; b=f4i2KyteYOKpYtxKkzMURaIXDrv311XNta0P+JxYD1JorYlQjssBU3S/6oX03wjF8l M6lU/y8BqxAhLdnOdvcSyPjQPQh73LTGCVAK4z/MHKb30dea6Upg4QMNPTjbr8JDO7c+ qEy+i/ynwmpwD0eZmCbsk7pAUm0hGtcVA+ei5pTxUGwWIPyD7TJJGUHemIAFi/VBr4Jg RNkQi2Y4EQrj3hlSF83tgrx0qHfNIazoOOSuDhul1gINQBoE3bc3FSP/+eeW4XINhTWN W2NfCr0XQGlsmTmbnxOVIT+zrCfrRSMuXjRoRkitCHwcOAWi2n4StVQIapSWdIZCyzBb REJg== X-Gm-Message-State: AOJu0YwNqqk5AJ7nTwinZRTfmCLwKcz8gWf5qxDhIFJgOc8DoV3nWLf/ rRwD8Pa6J4cq5tXGdhbUtgD3OBIofIFVmtva+/Y= X-Google-Smtp-Source: AGHT+IEKxxDmX5QscihMYZcQvgwwuw8ZgoVylbolAk9jZJ8cua56WKQhlZ/4mYI9LJSLGksTMVgVmw== X-Received: by 2002:a05:6e02:1084:b0:345:6ce1:d259 with SMTP id r4-20020a056e02108400b003456ce1d259mr16261620ilj.28.1693266099953; Mon, 28 Aug 2023 16:41:39 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/36] bsd-user: Remove ELF_START_MMAP and image_info.start_mmap Date: Mon, 28 Aug 2023 17:37:46 -0600 Message-ID: <20230828233821.43074-2-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266200984100017 From: Richard Henderson The start_mmap value is write-only. Remove the field and the defines that populated it. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230818175736.144194-2-richard.henderson@linaro.org> Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/arm/target_arch_elf.h | 1 - bsd-user/elfload.c | 1 - bsd-user/i386/target_arch_elf.h | 1 - bsd-user/qemu.h | 1 - bsd-user/x86_64/target_arch_elf.h | 1 - 5 files changed, 5 deletions(-) diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h index 935bce347fc..b1c0fd2b320 100644 --- a/bsd-user/arm/target_arch_elf.h +++ b/bsd-user/arm/target_arch_elf.h @@ -20,7 +20,6 @@ #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 -#define ELF_START_MMAP 0x80000000 #define ELF_ET_DYN_LOAD_ADDR 0x500000 =20 #define elf_check_arch(x) ((x) =3D=3D EM_ARM) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 1f650bdde85..38a3439d2cd 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -738,7 +738,6 @@ int load_elf_binary(struct bsd_binprm *bprm, struct tar= get_pt_regs *regs, /* OK, This is the point of no return */ info->end_data =3D 0; info->end_code =3D 0; - info->start_mmap =3D (abi_ulong)ELF_START_MMAP; info->mmap =3D 0; elf_entry =3D (abi_ulong) elf_ex.e_entry; =20 diff --git a/bsd-user/i386/target_arch_elf.h b/bsd-user/i386/target_arch_el= f.h index cbcd1f08e2f..4ac27b02e72 100644 --- a/bsd-user/i386/target_arch_elf.h +++ b/bsd-user/i386/target_arch_elf.h @@ -20,7 +20,6 @@ #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 -#define ELF_START_MMAP 0x80000000 #define ELF_ET_DYN_LOAD_ADDR 0x01001000 #define elf_check_arch(x) (((x) =3D=3D EM_386) || ((x) =3D=3D EM_486)) =20 diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 8f2d6a3c78b..178114b4234 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -52,7 +52,6 @@ struct image_info { abi_ulong end_data; abi_ulong start_brk; abi_ulong brk; - abi_ulong start_mmap; abi_ulong mmap; abi_ulong rss; abi_ulong start_stack; diff --git a/bsd-user/x86_64/target_arch_elf.h b/bsd-user/x86_64/target_arc= h_elf.h index b2447118883..e51c2faf084 100644 --- a/bsd-user/x86_64/target_arch_elf.h +++ b/bsd-user/x86_64/target_arch_elf.h @@ -20,7 +20,6 @@ #ifndef TARGET_ARCH_ELF_H #define TARGET_ARCH_ELF_H =20 -#define ELF_START_MMAP 0x2aaaaab000ULL #define ELF_ET_DYN_LOAD_ADDR 0x01021000 #define elf_check_arch(x) (((x) =3D=3D ELF_ARCH)) =20 --=20 2.41.0 From nobody Thu Nov 28 09:42:13 2024 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=1693266197; cv=none; d=zohomail.com; s=zohoarc; b=QGZ4IigfflFqbJHSWddXY2rYQEchLfxNl1xjlVfqw5WK5Mh74Z/gioKlTFDzwdgdsIFwFzUW2RUze+OXnZxYfW4BrHs4F0xSoaryatjygd12njQSnR+QW+hZeJsCv1GUkSE9ticcH5N9eueBQThU6rJg7Rfe1+ZGTwfYFvp35vE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266197; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Zx0CReD3MzsJrQdTZvfAbBcxOrXPzRZaiHnNU4KShl8=; b=W7KaHE3/LBJAgfgSZBxRasTNk9TATElvKUm2qul2DaSVmRN7ar8XHmcctc6usqiOmCS6HgCg/QhehZ4Af+fOM6olQAIZs7cldYPKokGEbrMsS1RVoMaOyYG8+HJ601icsIqbxmhSwcfZ2QBMtabkImyuSK7yPH8sYW2I2yWgbNw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266197389876.2687430735173; Mon, 28 Aug 2023 16:43:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrj-0003gF-Mx; Mon, 28 Aug 2023 19:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalre-0003ez-Ra for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:46 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalra-0006g4-9X for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:46 -0400 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-34baeb01942so13352005ab.1 for ; Mon, 28 Aug 2023 16:41:41 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266100; x=1693870900; 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; bh=Zx0CReD3MzsJrQdTZvfAbBcxOrXPzRZaiHnNU4KShl8=; b=qNLMexHsuTaHdSA3NhJHbfkyQduVueTCWrEsSr12hsgPTRtbhrBlorYxHFbYY5GLeV TfJUaTKweQx0ZbHU1zYQ8L77D8mefKJCeTBwyHOa3CECbdhn142Pp+yJiVcJ75U1+dfh 7ug9rseB03QwHDeYPc6CTg2peA3nwISIdp5xq/0XawVpoVILKdv1nf1+gLHzFwVR5S4G GGZ5pEOn1EQPYad/wIArxhnvlrpdYeBd0GfpdsmU3+bzP8jTXmiPFtuS6habwhPAS4eE BoKJHCff3dsjQxE+Kx5ovuAtNHVq1C2Pw9K1PZtxrrzyEklXluOQtkoRGGBtijB1qRri hChQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266100; x=1693870900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zx0CReD3MzsJrQdTZvfAbBcxOrXPzRZaiHnNU4KShl8=; b=F8cOi0IDr4sGAe+YnZ0J806oHxgoOeFcqsSpydHMXe/bLK1qwa4VJ6q7lZSh1FKLz7 Bgcxz6WLw7DXSfR74fArig29CqYCwsh3hdqGlXzjtauz7T3iTH9u0sEbKO4mP6zL9ZH2 mwf07Je01AZ6JzD5sufA0XnTW7gnbkCToIi43xswo8x7aYG+SJ7zfpClbr13YMiDl/0I uvRzTVxB50ZcpNM4Kun3Tl5j4+B/eWT8o9IiQr7ESAi4OFxjAAJgkbbwnVPG6fbi7jla 9Z/2bS9t5yomepiyimo/Ycc9cWRlvcsRvi7vH8NRZdMZVmJYq4tRUM9vqrn+BIVIBmsl TE9g== X-Gm-Message-State: AOJu0Ywk97PNqx0MtZ2sIjUxcPz+uU+SEI+VrtgbtFojfpzyce70WA2X Tx5sNG/Pln9iTs2KCuR15o/C/ZoCLGNOHQWGWus= X-Google-Smtp-Source: AGHT+IEkVvyNOLgaB0tjRIiZ2GfNIMOb54q7HETEgYh0Xkj4pl3Qem0wPX9Gq93FpKW/wAbz/aweeA== X-Received: by 2002:a05:6e02:1523:b0:345:787a:cb1c with SMTP id i3-20020a056e02152300b00345787acb1cmr21402577ilu.6.1693266100699; Mon, 28 Aug 2023 16:41:40 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 02/36] bsd-user: Remove image_info.mmap Date: Mon, 28 Aug 2023 17:37:47 -0600 Message-ID: <20230828233821.43074-3-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12c; envelope-from=imp@bsdimp.com; helo=mail-il1-x12c.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266198787100001 From: Richard Henderson This value is unused. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230818175736.144194-3-richard.henderson@linaro.org> Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 1 - bsd-user/qemu.h | 1 - 2 files changed, 2 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 38a3439d2cd..2d39e59258e 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -738,7 +738,6 @@ int load_elf_binary(struct bsd_binprm *bprm, struct tar= get_pt_regs *regs, /* OK, This is the point of no return */ info->end_data =3D 0; info->end_code =3D 0; - info->mmap =3D 0; elf_entry =3D (abi_ulong) elf_ex.e_entry; =20 /* XXX Join this with PT_INTERP search? */ diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 178114b4234..898fe3e8b34 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -52,7 +52,6 @@ struct image_info { abi_ulong end_data; abi_ulong start_brk; abi_ulong brk; - abi_ulong mmap; abi_ulong rss; abi_ulong start_stack; abi_ulong entry; --=20 2.41.0 From nobody Thu Nov 28 09:42:13 2024 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=1693266303; cv=none; d=zohomail.com; s=zohoarc; b=NtZbQKcTV2jWsXo0y1RYfYGtr3lF8p42LFTzqnQzuFF4XBQzR4yKmrVhdU1P42r42yaN+x6ze7Q6fFCAZKb3j6m9PHDewaQ84bP9Y53dMpB/qk5mNp9XXVVoI1egsUxzIoHwBlOYwbOklA7VsUP8J0RYE9bXNFRZP9YMplL9B5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266303; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k4ZavMA2jKcdyYrvnJgf/oPyCKcovCggmoEgQ8d/0jQ=; b=gYH7gYgVQ1ihtOgpmnPQK7ouIDFv3qjGwdGRSACMkWkug4FCkeCUWxAFjQBauIyje1hKK08RejPrck0fFD5pryF7F1HkOwEO/SrAkpv1+8st6TdN5JUVaPIJ4UkDuF8L7RGUP+KgBpGwaTA66GfKdS2G3kHFZP9JmpeStIvXp44= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266303838276.19860056180323; Mon, 28 Aug 2023 16:45:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrn-0003h8-4E; Mon, 28 Aug 2023 19:41:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrf-0003fC-W0 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:48 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrb-0006g8-6d for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:47 -0400 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-34bad46e5a5so13079215ab.1 for ; Mon, 28 Aug 2023 16:41:42 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266101; x=1693870901; 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; bh=k4ZavMA2jKcdyYrvnJgf/oPyCKcovCggmoEgQ8d/0jQ=; b=4dUNRms57VHNVJKXLs6qNd0u4Zv0VwrEfaxMzLuE0p/YCEBoxYUXfSqt66JwlIkoh4 0wOgZfcgIQRLvcgt1U9OVFxi5cR9cQdAVkMF3lrVWYlc91YkvLWlgcne7OYaNvRWFzwT D3HFR/0vYAOA4cQO6Fky4JfrzUa5QhF2m8kWEhkCNEQxYZ4HFV4K9wT/Gf86Y4AYX546 m4MKJlo1Eg0nW16fPqP8LGef4b4Ff1uLOCe+dt7WxZFsNhfcPh5aub6P/ZBq8+IgWZWy 3E08onXtsQHdZWDdN/Lk0+0eh1foKGpJQNeKzO/D5l3HZcIE/gJ8Yx/B6a+f+zTp90zN M+yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266101; x=1693870901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k4ZavMA2jKcdyYrvnJgf/oPyCKcovCggmoEgQ8d/0jQ=; b=iM26YdRtt9ZtApjZ/n3Pf0JChVwZkPB+7hnxXl6WVtz1MNIxEeoOjL7gNWsB++9sdd u2wGj1YGCfMh6A8SK0xwDhBMJZV6AJ8MoY7XN66+1QDI1m/xuxms3w+XxMpXPmtsta05 8WIaC5M1bbHbOxQDsCByGzIuv80YbIcnCH1qqZooVPp2TXU7R5q9J1b0BjJyIRI5U1/Q TblbvRtPl471+Y4h4HW/qxg7DA6iJoUB0TyHlR5U0S6Te+ddxHjRMtvyeVQG0m8zhbif 9cYCI1mrpwJ3BdTbWa0VS1s3CKDnjyF2jQLMk5t6fFGWS2xy/8h3Fb758S7Ya/83CqfZ 1nhQ== X-Gm-Message-State: AOJu0YzsRNmWsv4m8AlbDID9ckGlRlnDIz4T5EsBaCMtXyA11xtC7Hcc jsNriiFlgzF9xGV+o7jX8fp7+y5Mnkq4OGrBXVY= X-Google-Smtp-Source: AGHT+IHXCvvJeKTQJAHJMypmBiWLrWacs0bfPPEYb2DtHj+QpVe11FskqB2J4dlIobGSnLLjApXQJw== X-Received: by 2002:a92:ce0f:0:b0:349:7663:566c with SMTP id b15-20020a92ce0f000000b003497663566cmr15484586ilo.30.1693266101556; Mon, 28 Aug 2023 16:41:41 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/36] bsd-user: Remove image_info.start_brk Date: Mon, 28 Aug 2023 17:37:48 -0600 Message-ID: <20230828233821.43074-4-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266305820100003 From: Richard Henderson This has the same value is image_info.brk, which is also logged, and is otherwise unused. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230818175736.144194-4-richard.henderson@linaro.org> Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 2 +- bsd-user/main.c | 2 -- bsd-user/qemu.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 2d39e59258e..baf2f63d2f1 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -811,7 +811,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct tar= get_pt_regs *regs, bprm->stringp, &elf_ex, load_addr, et_dyn_addr, interp_load_addr, info= ); info->load_addr =3D reloc_func_desc; - info->start_brk =3D info->brk =3D elf_brk; + info->brk =3D elf_brk; info->start_stack =3D bprm->p; info->load_bias =3D 0; =20 diff --git a/bsd-user/main.c b/bsd-user/main.c index 381bb18df80..f913cb55a72 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -553,8 +553,6 @@ int main(int argc, char **argv) fprintf(f, "page layout changed following binary load\n"); page_dump(f); =20 - fprintf(f, "start_brk 0x" TARGET_ABI_FMT_lx "\n", - info->start_brk); fprintf(f, "end_code 0x" TARGET_ABI_FMT_lx "\n", info->end_code); fprintf(f, "start_code 0x" TARGET_ABI_FMT_lx "\n", diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 898fe3e8b34..61501c321b0 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -50,7 +50,6 @@ struct image_info { abi_ulong end_code; abi_ulong start_data; abi_ulong end_data; - abi_ulong start_brk; abi_ulong brk; abi_ulong rss; abi_ulong start_stack; --=20 2.41.0 From nobody Thu Nov 28 09:42:13 2024 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=1693266318; cv=none; d=zohomail.com; s=zohoarc; b=bnwSR1VLhDkBw5CNCY7KIHp3B/EZq+Z7vIRKmsC0QHr9bVIp/Avgry+dFWQMCBTNWDmkETDOTramb03g8NmFxpnj/njXqxV9gKF5QKfB45ImeredViYnhNCA28lz7KBSWczk9RM5cSxJ7HjpiC7iNufy5o4+2rHzo5JKBMfNkyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266318; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vPIB6HdkWJYoYxy/vDMHclCeIpDJl74Je8/wClovGdA=; b=adr7JeqE0moYhcbR/5f0aFt0HODGcOWJgQfa9nY8N4U80nKXDf5TVKIZ8m8g3lpGGGNRi7KX+YYEg3xKJj1uoRfb0mvYJ9RyF8T4e5yxZU3sygauOc/Wi0g1t9Yvc9tScaGDNz9dSaihC2HHurhrYXVNmLVB98FpkneL9ATVbqw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266318610765.9167344234039; Mon, 28 Aug 2023 16:45:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrn-0003ha-D1; Mon, 28 Aug 2023 19:41:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrf-0003fD-W6 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:48 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrc-0006gC-36 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:47 -0400 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-79277cfc73bso143408639f.1 for ; Mon, 28 Aug 2023 16:41:43 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266102; x=1693870902; 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; bh=vPIB6HdkWJYoYxy/vDMHclCeIpDJl74Je8/wClovGdA=; b=J1xPAnZtbivMxziqLnNbrjl140bVNANmqOdWpJT0PrXCfq2C2Bf9RqyoHlBjiCaP3M FCk0JDTHEvnMtsmpIkBqKTVEQX04vXmgg4TApHALdSNcbuSeIP4zLpG2P99XjlfrmGtc DfbcHPXJN0L9s2bVIZRR+tDsW7EtHbvkmM31mlAnNhx4N1k+22vF/iaGC3Q+q3a1OKJH rxQiSHAVbFqcJOV8amJ3dIwUDvPAMUj6QH2T9MzCOnBws86WiqETvJcB3nEvB+MTfoqz P3r0JYG29SZRV4frkZ8GDTulsIYn8Jcp0QI0aPZcmqy0QC6v+LW9rhbsIcY/7UxXaKQu a1qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266102; x=1693870902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vPIB6HdkWJYoYxy/vDMHclCeIpDJl74Je8/wClovGdA=; b=asTMnVgkn2QpwY5X6iBM6kkmOX2u86g71BMRAzocWGt8aiUJ1zFQL6A9GrruL4TVnB Q1S/43OGZLmeoWFEG1WSrAICl5sFM1sC/nBv92ZtVMU1VxeTihDDw+WrwcQcyvHtOZMf 9bq83aG1GPBl20f4k5u8RxY1j19CQut88SjfyhpqlHY1cxSHOHAodAytrc7OeUVbQ4li 6iKo9nl3it0EUVOEN8JDctUYx33ri9OeziIKcOqQpiDWk0PRt2JvIbp6r+rqjZO6Hoc0 cRHLZyZgtuWT2hFVn2nwcADMX8XMZHvR2yFJb079LzHTCrYUzazxHUN2gwS71IsK8nWN yg5g== X-Gm-Message-State: AOJu0YzR9+rE2n+bj/eue8ee0+5qOBAojA2C0uTg9mgx9NM4z9tcjO1c nXausLOYJ9G3YTxboA3qOx40v00cGQCWh2VrjWU= X-Google-Smtp-Source: AGHT+IF0OBd/VZ6gkWjjjd0jB0Zy6wuL36Lmb0VNx/KdQtD4eybWFaQhWerKuRF9dBpEwDCV0gSnbg== X-Received: by 2002:a05:6e02:12e2:b0:34c:ecc8:98e0 with SMTP id l2-20020a056e0212e200b0034cecc898e0mr7655968iln.11.1693266102343; Mon, 28 Aug 2023 16:41:42 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 04/36] bsd-user: Move _WANT_FREEBSD macros to include/qemu/osdep.h Date: Mon, 28 Aug 2023 17:37:49 -0600 Message-ID: <20230828233821.43074-5-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266319493100003 Content-Type: text/plain; charset="utf-8" move _WANT_FREEBSD macros from bsd-user/freebsd/os-syscall.c to include/qemu/osdep.h in order to pull some struct defintions needed later in the build. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Acked-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 11 ----------- include/qemu/osdep.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index de36c4b71c6..2224a280ea2 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -17,17 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ - -/* - * We need the FreeBSD "legacy" definitions. Rust needs the FreeBSD 11 sys= tem - * calls since it doesn't use libc at all, so we have to emulate that desp= ite - * FreeBSD 11 being EOL'd. - */ -#define _WANT_FREEBSD11_STAT -#define _WANT_FREEBSD11_STATFS -#define _WANT_FREEBSD11_DIRENT -#define _WANT_KERNEL_ERRNO -#define _WANT_SEMUN #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qemu/path.h" diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 21ef8f16995..2cae135280c 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -88,6 +88,19 @@ QEMU_EXTERN_C int daemon(int, int); #define __USE_MINGW_ANSI_STDIO 1 #endif =20 +/* + * We need the FreeBSD "legacy" definitions. Rust needs the FreeBSD 11 sys= tem + * calls since it doesn't use libc at all, so we have to emulate that desp= ite + * FreeBSD 11 being EOL'd. + */ +#ifdef __FreeBSD__ +#define _WANT_FREEBSD11_STAT +#define _WANT_FREEBSD11_STATFS +#define _WANT_FREEBSD11_DIRENT +#define _WANT_KERNEL_ERRNO +#define _WANT_SEMUN +#endif + #include #include #include --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266252; cv=none; d=zohomail.com; s=zohoarc; b=EK7YBOQFMPA+t/guHYz2vhEY2Ad9H+vTBEHxgO2fIbQPeGhGlmxTLedyXqDc3MgB7UFd+it8wWCjKVw72cfo0AyFdoFEAVe0RAuCWIrXnjhMwDI5gss8ZMilxOAXgeosKVvtQhX1G1IhDjPcLdjgV4LgwzGJUmJze1Kvz9F8jHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266252; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nM7Uf06w0wMTd6N1re2AAxx7TTOheoegcX2ZAbmHQ9U=; b=GMhj29NK0DKeDvJ9yGGZ6zad0P9+tdmOSSqLPhOyqmVFkhOB1xZVTYFY6JwpIQ4HU5rkUVLLc6dyXUoxXURYXReg3Cnc3z9W0iyBNeN8xyhTt/9Ojf/YcBc9HZTtvdS3ZCJcOL0G7iKMykCf3JoJHFyyWRQ5OESPpx+vQWeyE/o= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266252905987.8999604211233; Mon, 28 Aug 2023 16:44:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrl-0003gk-1y; Mon, 28 Aug 2023 19:41:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrg-0003fE-05 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:48 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrc-0006gH-Vt for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:47 -0400 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-34bb72ffb1fso13414845ab.3 for ; Mon, 28 Aug 2023 16:41:44 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266103; x=1693870903; 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; bh=nM7Uf06w0wMTd6N1re2AAxx7TTOheoegcX2ZAbmHQ9U=; b=cxqRz7OTUKEN9CO5n0/7oJAnFZnB+zzx+AZeD3Fjs6pufaFKwsN1rKS+YhxFXnk0nH qv3pw8lSd+o7262cnKQh+fAQaRh+eOFS0GRtesS8dTmlFzNh2n3mvqHlM4KKm45lhXM2 YlZlnt3ihBqwjzm/gqGtBFfjfCWDzA3LIZezr00Pxny9y5Ldx22Oqhei/7kfjdOEcCGl GhR8mVTYj9SsSNW0nHoiMSK0Wu5I2J5P3V0OrG/Wl3AFkTlm2A4y1IlP4KSl+ZelBypV 9owbdGOvwwKqicuH5cye2XsLgBmSC10ZclH9oi3anj7r9lLgDWGt9/i/+rEXQQXfBAOQ AB9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266103; x=1693870903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nM7Uf06w0wMTd6N1re2AAxx7TTOheoegcX2ZAbmHQ9U=; b=e1OC+im5exDXqKDNoLyF9MpMD6DW+vRE3pnJ3b91kLVS3RQDnaqunjF6cuPSQc+fkb /EBxNRmyLVWMF7n7yjT89JghH0sRiv1C5sI1eKRs0pGPJ4pPr9I6u4F7yPvc+5DTXY8w skqZb4EEl36llMDQFE/TadDbs+bequPJWlLgQnsJHoStLth2ORt5svkTXbL/dXCV4Mb6 mG+jV4XuPbT3jqHk7zQ4A/aLVjeOoyqEyzcxJlMNKckaWR8bC3cLE1DiihUouvSkq/pX YCK6OFTouKxqtYKsF/BMjzcsY9MrqUEfwGhFQKL6VLFNuDoGele/2eG8vjFlkBHz2BtG 7/iA== X-Gm-Message-State: AOJu0Yxe3ZYI8+oeb3+KohvIk2h22jckv42pO32feKJyn5fOBIJrd6Rh fLi1la0FPx0oXD2y9P8k0WmPI2Ak3OLpWnp05Gg= X-Google-Smtp-Source: AGHT+IGaSMX4ldnm7pyU+qmMdi1DyJwNLjPcXxUBvOq8xNvthRoS+ZKdUBd77ojjowxinwwJK8PJIg== X-Received: by 2002:a05:6e02:1d96:b0:348:dba4:6418 with SMTP id h22-20020a056e021d9600b00348dba46418mr20913100ila.6.1693266103606; Mon, 28 Aug 2023 16:41:43 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 05/36] bsd-user: Disable clang warnings Date: Mon, 28 Aug 2023 17:37:50 -0600 Message-ID: <20230828233821.43074-6-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::134; envelope-from=imp@bsdimp.com; helo=mail-il1-x134.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266254891100010 Content-Type: text/plain; charset="utf-8" From: Kyle Evans Implement PRAGMA_DISABLE_PACKED_WARNING and PRAGMA_REENABLE_PACKED_WARNING macros in include/qemu/compiler.h. Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- include/qemu/compiler.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index a309f90c768..b0374425180 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -22,6 +22,36 @@ #define QEMU_EXTERN_C extern #endif =20 +/* + * Tricky points: + * - Use __builtin_choose_expr to avoid type promotion from ?:, + * - Invalid sizes result in a compile time error stemming from + * the fact that abort has no parameters. + * - It's easier to use the endian-specific unaligned load/store + * functions than host-endian unaligned load/store plus tswapN. + * - The pragmas are necessary only to silence a clang false-positive + * warning: see https://bugs.llvm.org/show_bug.cgi?id=3D39113 . + * - We have to disable -Wpragmas warnings to avoid a complaint about + * an unknown warning type from older compilers that don't know about + * -Waddress-of-packed-member. + * - gcc has bugs in its _Pragma() support in some versions, eg + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83256 -- so we only + * include the warning-suppression pragmas for clang + */ +#ifdef __clang__ +#define PRAGMA_DISABLE_PACKED_WARNING \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wpragmas\""); \ + _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\"") + +#define PRAGMA_REENABLE_PACKED_WARNING \ + _Pragma("GCC diagnostic pop") + +#else +#define PRAGMA_DISABLE_PACKED_WARNING +#define PRAGMA_REENABLE_PACKED_WARNING +#endif + #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) # define QEMU_PACKED __attribute__((gcc_struct, packed)) #else --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266240; cv=none; d=zohomail.com; s=zohoarc; b=Iq50DJE2TR49KWgrjNHbXtYJzEqig0MahrpUEHEAqlQgl4qZAaxd08ynpgKBQotWjzC1KsE8331ZNiBDYk8lp5bw5xfzIc7MEILmEEL5736ad3DNKKxBB33LCtdr32ubeaieGoCxdNquIerHMYalpYqoXciXE6UiT7uf5+uYOZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266240; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/MXe0Iyo//h1yjS09UWr+6Zwt8J7dJYarzHsGGngDTo=; b=SllurRrhKHEAA4lxxxGk7wzLCAm88eLXa/A7oMIdAs7dbZ1GDKdZfMS56fksUA4ecOj8bvJlfY0t0oWy83Ah2yh2MXMMVbHMYYTiSLFoSVdoiPDal6xLkoh6Uct/4K2ODkQmIguUGRpkzSj+S8rBkPHErYae2KBmsjmcOBxHR0M= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266240425287.17283822836714; Mon, 28 Aug 2023 16:44:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrr-0003jc-Kv; Mon, 28 Aug 2023 19:41:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrh-0003fH-1O for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:50 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrd-0006gW-OZ for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:47 -0400 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-34dec9c77d4so41965ab.0 for ; Mon, 28 Aug 2023 16:41:45 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266104; x=1693870904; 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; bh=/MXe0Iyo//h1yjS09UWr+6Zwt8J7dJYarzHsGGngDTo=; b=sUP81DMKiBJr/NgfNFdOrWyGlTi020p4kZgMx0GarefLBPt3/NXqUloJz8W3CpzyGz 0ZvJwBLib9gNdcTaXwzYb2klfvzu/LoKFkhB1t9qc/BlynLL/CwxJChRLUmfANaBKkEM KfKv0PQzVQgPihzx3v/dDFnBVTsIMYZUXneTpZrAKfIN3th8r6493JHrGkaolkH8td82 T0Svi8kCFxmq5AqS+8MGjnBh7kI/uifcAiIywV3Usf0HtiBV/wZwntmphPslOpvVl+QJ NEK5Fci9oanQJOs60aEDOq4NfEpDCJywqnASfUBEm6TL5A/UlBNSU1cBEA9AlTZy4K7G YD2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266104; x=1693870904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/MXe0Iyo//h1yjS09UWr+6Zwt8J7dJYarzHsGGngDTo=; b=WdxTN2eF0RC5tXRnUClnDPp380FjSL1/hRpuDiMBqDKdNJR9oFB+st8b2S6GAhmLkU +BGUnMPk7yYsHwQIxcv9M3DpGvQca8oTH8uS1/c7cB1acBl7J0cg9t4xeDE9UaW8S9gD 1mKzXRajq9xUyQ6bfPtPfagnVrNLPP4TLws4fE4mOIDkJPajfGDwgsx6HaHDsYZGXG7s zz8ZdbCAZrk2UP4olDxcOCh+HqSjDOeaK6FwxIWaGPv9EGzeYCwSFWFxzU/OLqOhtHSG 9cw2IbvMXLpaUA80wK+EVxcHLOkW1+KwAMaSPy8O/iMGf8KVts47yDmAn7jOVihshlDy 9vHw== X-Gm-Message-State: AOJu0YyPuatYKbbgtbBONgY0p+kUKoIKTgIC4GTgjsPx0x86dXxkau5J 2sAjZD5TBJFfeSMAupdPXQDmU701QSknHT9Fx3M= X-Google-Smtp-Source: AGHT+IHvhalmgzGkeG3gFagQY1T/HNYtX1OPOHUBE6BkxkYHsRKkxNWDFrPIZifk5Hr2+o/yNCIFdg== X-Received: by 2002:a92:cda6:0:b0:34c:dbeb:a2a7 with SMTP id g6-20020a92cda6000000b0034cdbeba2a7mr14444986ild.23.1693266104411; Mon, 28 Aug 2023 16:41:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 06/36] bsd-user; Update the definitions of __put_user and __get_user macros Date: Mon, 28 Aug 2023 17:37:51 -0600 Message-ID: <20230828233821.43074-7-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266242471100003 Content-Type: text/plain; charset="utf-8" Use __builtin_choose_expr to avoid type promotion from ?: in __put_user_e and __get_user_e macros. Copied from linux-user/qemu.h, originally by Blue Swirl. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 81 ++++++++++++++++++++--------------------------- bsd-user/signal.c | 5 +-- 2 files changed, 35 insertions(+), 51 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 61501c321b0..ca791e18b22 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -272,50 +272,37 @@ static inline bool access_ok(int type, abi_ulong addr= , abi_ulong size) * These are usually used to access struct data members once the struct ha= s been * locked - usually with lock_user_struct(). */ -#define __put_user(x, hptr)\ -({\ - int size =3D sizeof(*hptr);\ - switch (size) {\ - case 1:\ - *(uint8_t *)(hptr) =3D (uint8_t)(typeof(*hptr))(x);\ - break;\ - case 2:\ - *(uint16_t *)(hptr) =3D tswap16((typeof(*hptr))(x));\ - break;\ - case 4:\ - *(uint32_t *)(hptr) =3D tswap32((typeof(*hptr))(x));\ - break;\ - case 8:\ - *(uint64_t *)(hptr) =3D tswap64((typeof(*hptr))(x));\ - break;\ - default:\ - abort();\ - } \ - 0;\ -}) +#define __put_user_e(x, hptr, e) = \ + do { = \ + PRAGMA_DISABLE_PACKED_WARNING; = \ + (__builtin_choose_expr(sizeof(*(hptr)) =3D=3D 1, stb_p, = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 2, stw_##e##_p, = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 4, stl_##e##_p, = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 8, stq_##e##_p, abort= )))) \ + ((hptr), (x)), (void)0); = \ + PRAGMA_REENABLE_PACKED_WARNING; = \ + } while (0) + +#define __get_user_e(x, hptr, e) = \ + do { = \ + PRAGMA_DISABLE_PACKED_WARNING; = \ + ((x) =3D (typeof(*hptr))( = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 1, ldub_p, = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 2, lduw_##e##_p, = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 4, ldl_##e##_p, = \ + __builtin_choose_expr(sizeof(*(hptr)) =3D=3D 8, ldq_##e##_p, abort= )))) \ + (hptr)), (void)0); = \ + PRAGMA_REENABLE_PACKED_WARNING; = \ + } while (0) =20 -#define __get_user(x, hptr) \ -({\ - int size =3D sizeof(*hptr);\ - switch (size) {\ - case 1:\ - x =3D (typeof(*hptr))*(uint8_t *)(hptr);\ - break;\ - case 2:\ - x =3D (typeof(*hptr))tswap16(*(uint16_t *)(hptr));\ - break;\ - case 4:\ - x =3D (typeof(*hptr))tswap32(*(uint32_t *)(hptr));\ - break;\ - case 8:\ - x =3D (typeof(*hptr))tswap64(*(uint64_t *)(hptr));\ - break;\ - default:\ - x =3D 0;\ - abort();\ - } \ - 0;\ -}) + +#if TARGET_BIG_ENDIAN +# define __put_user(x, hptr) __put_user_e(x, hptr, be) +# define __get_user(x, hptr) __get_user_e(x, hptr, be) +#else +# define __put_user(x, hptr) __put_user_e(x, hptr, le) +# define __get_user(x, hptr) __get_user_e(x, hptr, le) +#endif =20 /* * put_user()/get_user() take a guest address and check access @@ -328,10 +315,10 @@ static inline bool access_ok(int type, abi_ulong addr= , abi_ulong size) ({ \ abi_ulong __gaddr =3D (gaddr); \ target_type *__hptr; \ - abi_long __ret; \ + abi_long __ret =3D 0; \ __hptr =3D lock_user(VERIFY_WRITE, __gaddr, sizeof(target_type), 0); \ if (__hptr) { \ - __ret =3D __put_user((x), __hptr); \ + __put_user((x), __hptr); \ unlock_user(__hptr, __gaddr, sizeof(target_type)); \ } else \ __ret =3D -TARGET_EFAULT; \ @@ -342,10 +329,10 @@ static inline bool access_ok(int type, abi_ulong addr= , abi_ulong size) ({ \ abi_ulong __gaddr =3D (gaddr); \ target_type *__hptr; \ - abi_long __ret; \ + abi_long __ret =3D 0; \ __hptr =3D lock_user(VERIFY_READ, __gaddr, sizeof(target_type), 1); \ if (__hptr) { \ - __ret =3D __get_user((x), __hptr); \ + __get_user((x), __hptr); \ unlock_user(__hptr, __gaddr, 0); \ } else { \ (x) =3D 0; \ diff --git a/bsd-user/signal.c b/bsd-user/signal.c index f4e078ee1da..4db85a3485e 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -787,10 +787,7 @@ static int reset_signal_mask(target_ucontext_t *uconte= xt) TaskState *ts =3D (TaskState *)thread_cpu->opaque; =20 for (i =3D 0; i < TARGET_NSIG_WORDS; i++) { - if (__get_user(target_set.__bits[i], - &ucontext->uc_sigmask.__bits[i])) { - return -TARGET_EFAULT; - } + __get_user(target_set.__bits[i], &ucontext->uc_sigmask.__bits[i]); } target_to_host_sigset_internal(&blocked, &target_set); ts->signal_mask =3D blocked; --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266252; cv=none; d=zohomail.com; s=zohoarc; b=TfyGGN8tttisyCXTzSfAkKRxn5s0S8Fm/5Kks3FdNAnXjDvqZF8WWUlfXQsoFIRxhfTOS2d4/727kuJ5veqT2qfhEtjQUSafPKXv39vxpU4um+fq3F1GjCvBFOHKLXhW+JywfCZaHNYmrXHACWAOzEL/U5mULuZr+kbRuCzdq4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266252; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mFUI7syWjtHkv1X7CZsv+GWXf+3QN5j9BYV4aIXY14I=; b=df3M2i/ARB2VPZbjbpLAYbbqdw03hCtN2XAUhXZIrTHuq8UA0Ud+pIdPPOx+v/PdxknrWdMTln5nIBmdngPvJheWppZDCLSc/zeas5HFCY5qZ/CyXf9Q2mAqN5VrWIyBArCxESghHnCUpZezSbNzZ73EE9yzV7mt/TW337JIy8g= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169326625266094.30951666242026; Mon, 28 Aug 2023 16:44:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrm-0003gm-OF; Mon, 28 Aug 2023 19:41:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalri-0003fI-5S for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:50 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalre-0006hx-Vu for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:49 -0400 Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-792623074edso111253839f.1 for ; Mon, 28 Aug 2023 16:41:46 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266105; x=1693870905; 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; bh=mFUI7syWjtHkv1X7CZsv+GWXf+3QN5j9BYV4aIXY14I=; b=CqDYtqjJrJTMVWSQGUUkCAonBBQDhGh/Wpf6Q0n37NzPopncUaKADzDBGUBRLnPpUs uDjRjOrTH+YL/kMjhyMPuywwFP7Xc81BHMyJptm79Gsi07QB1Fnr0+MKCNwQWVm+pI4P 8oLrlXxlSEl8EOyNBkK3Z8X9B4MGxplLmll8IG0QpFjgDrXlbpDADQTjbXMiP4UHhL9Z Rt71STsykbKShVudKYl8M6x845D1kl0aXhpl5xQbvGLjI3Z7Ui2iLFOiZbio0em9sSfi 4astNwN817+q73q02n/HTlALP56v3PJsCUVxTSGFc3ksc001RuOCDgj72VWso4QRYBgB zgmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266105; x=1693870905; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mFUI7syWjtHkv1X7CZsv+GWXf+3QN5j9BYV4aIXY14I=; b=cpRsJ62VIRKyNyt5N2Yudqic+QwFYAgYsjXOqbAoY96iT6jz0FF6+h0GmdWk289cjq kn9QYCM+BFSdK2Fpo9BckAo6iqkbypoRWYW6jNJNw6NiNgTUnRJf1HrafTv4jUxVtxxj YCxNa4Gg1rwQhh7H91i+Ex9g+1uq5mGwgc0JIRo/S5WQBqnlybb/EJIFZAyB0jpax+Vn xRMZxZ4UTazuFHw/72Vh5CKymKxsSHp4d3wOrKzYPoQdUATjcV5RUWvId717CFT4VM2A fUGg7QdgI9+dFKdzjyGSe6Kxb84Hc/PX6iHtfRlE7Bve2zZfoZegSAsqJ1viDJpxKG8m izpw== X-Gm-Message-State: AOJu0YwOp2YUR6+oUVJwjLUYXf/AqSOO0Cv1e9/R68IsjFpqxTOuRkXl IAyVHtNb9wowOla5hDjYHpqRHMWwCAGHlFiSY/Y= X-Google-Smtp-Source: AGHT+IHxrsgKppXZod3TmlbfaDGvWE1C2qxTdt3tA500m0NezN1mgJSfUjXdyHN1sOC0/PDuyOA+3g== X-Received: by 2002:a05:6e02:148f:b0:348:b086:2c4b with SMTP id n15-20020a056e02148f00b00348b0862c4bmr1292306ilk.9.1693266105345; Mon, 28 Aug 2023 16:41:45 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Michal Meloun , Karim Taha , Richard Henderson Subject: [PULL 07/36] bsd-user: Declarations of h2t and t2h conversion functions. Date: Mon, 28 Aug 2023 17:37:52 -0600 Message-ID: <20230828233821.43074-8-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266253233100003 Content-Type: text/plain; charset="utf-8" From: Stacey Son Declarations of functions that convert between host and target structs. Co-authored-by: Michal Meloun Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/qemu-os.h | 50 ++++++++++++++++++++++++++++++++++++++ bsd-user/qemu.h | 1 + 2 files changed, 51 insertions(+) create mode 100644 bsd-user/freebsd/qemu-os.h diff --git a/bsd-user/freebsd/qemu-os.h b/bsd-user/freebsd/qemu-os.h new file mode 100644 index 00000000000..12adc50928c --- /dev/null +++ b/bsd-user/freebsd/qemu-os.h @@ -0,0 +1,50 @@ +/* + * FreeBSD conversion extern declarations + * + * 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 QEMU_OS_H +#define QEMU_OS_H + +/* qemu/osdep.h pulls in the rest */ + +#include +#include +#include +#include +#include +#include +#include + +struct freebsd11_stat; + +/* os-stat.c */ +abi_long h2t_freebsd11_stat(abi_ulong target_addr, + struct freebsd11_stat *host_st); +abi_long h2t_freebsd11_nstat(abi_ulong target_addr, + struct freebsd11_stat *host_st); +abi_long t2h_freebsd_fhandle(fhandle_t *host_fh, abi_ulong target_addr); +abi_long h2t_freebsd_fhandle(abi_ulong target_addr, fhandle_t *host_fh); +abi_long h2t_freebsd11_statfs(abi_ulong target_addr, + struct freebsd11_statfs *host_statfs); +abi_long target_to_host_fcntl_cmd(int cmd); +abi_long h2t_freebsd_stat(abi_ulong target_addr, + struct stat *host_st); +abi_long h2t_freebsd_statfs(abi_ulong target_addr, + struct statfs *host_statfs); + +#endif /* QEMU_OS_H */ diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index ca791e18b22..4cfd5c63371 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -38,6 +38,7 @@ extern char **environ; #include "exec/gdbstub.h" #include "qemu/clang-tsa.h" =20 +#include "qemu-os.h" /* * This struct is used to hold certain information about the image. Basic= ally, * it replicates in user space what would be certain task_struct fields in= the --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266356; cv=none; d=zohomail.com; s=zohoarc; b=AtzDihy4jgYn54As18o6qIJImqTQiywBXsFoukoY6bEmsYx0AnttdMN6rUt3X9AuYuDiPx4XUcyO7+RAOHvLDPT2n2iCCc3UfqmkUZkPOzvd2MIV2bU/CR5JYxr5mhZgR8yhEZrfcbkARJO/zp/hY9LpsWamIpUnY2cUbR4gOY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266356; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Tdo1bhYlYELgs4yaIyLrA+/zF6S4843aF57BvFCbvZg=; b=Vp/XmbWS5/j3LVE9LyyQYifUc5pHUSVvOHQtlhp0/XZA9PYi6IHeXMDJivF9wT5BAlIMESIeTTk7gW1W0hC2NnZWYKRkeWfK6rfRAqYwKPIvmB1ecgQLDumcyllVvND9W8SQHSisDLTtgivT8IHg7m/idYxg0WhHtb48c1vo7vk= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266356899279.97085129540324; Mon, 28 Aug 2023 16:45:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrs-0003jh-0x; Mon, 28 Aug 2023 19:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalri-0003fn-HH for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:50 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrf-0006i6-NJ for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:50 -0400 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-34bbc5eb310so13068465ab.2 for ; Mon, 28 Aug 2023 16:41:47 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266106; x=1693870906; 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; bh=Tdo1bhYlYELgs4yaIyLrA+/zF6S4843aF57BvFCbvZg=; b=racalekAQtuuMnVste1mafwUT3oYz5TnHZiVruY2iQmZbJD+iIx40JDmEFvXMqyCVT XEHPPJHQKRu0GltcKy6+OQK9WNHCmUeqUubvPNRT+S+uzQ2XMLHmGR0kkm4RHY5Kiw3Z BFsjDVJe7xTW0y8nOxOKkRpUFoZhM1IdYmkMEJqNUC7l6rNvR2gNOd8Qaca1U9N/A3bM kydixixyjtdEFHky1Z8n5sSrKiPSZAF1ZASv94iC1il+y/G3dETkU2mwu7a20AH9acq1 7kX9R3U29TBSfwKmyP82cUeJUMAjRVgErD1mfjpKbK1NThU0ajByeGWjkjjHp6ewqHC0 Fghw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266106; x=1693870906; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tdo1bhYlYELgs4yaIyLrA+/zF6S4843aF57BvFCbvZg=; b=NoRgd4JclqWJs2RDa+3pd/pdY9jVr5tciWyfsTMV6xwlDiYdPOIyI8GdIgqybTy+lM Mla/OERVXuHhfnda2wqHbJWb+DBw6+CA3zb08+0go0SwQpab98HeswtGFJiHLtFNewYh IbMxHrGsiS9ybs/UUwNHVt2UtV7FQc4dmw4OdhiO6so22UW7dzyrkNv+N2sQ4TgogDQP sA3ul5dZQl1fVb9Wxj6+5QwWRFq6HQQmwzdZ+X1NEe+acKlRwz/XXf+gGGaYTbxGoyos 1Jh6+AjmokaYcRol+uUsAwKZz7Wr0DQK9Anohnu/nk9vFToPBEKzFSwRkjtEPawPFlZi HWFA== X-Gm-Message-State: AOJu0YxV9sLSnWvuA7qSjynZXa+Rjow03RpER0d9/0on0tT8/OFcDKuE 8zXuhvGvPAqAFZ7Xm2SDe1EcI7LqtNAEnADSwdg= X-Google-Smtp-Source: AGHT+IH8hwRKYmiryVkbvRC6OytkVx1ZZs2zJ09vGW9E3PFwVtD7nAHgSrrxhUm4VVska2vZQu4J5g== X-Received: by 2002:a92:d950:0:b0:34b:aef9:60d4 with SMTP id l16-20020a92d950000000b0034baef960d4mr15646837ilq.27.1693266106142; Mon, 28 Aug 2023 16:41:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 08/36] bsd-user: Add struct target_freebsd11_stat to bsd-user/syscall_defs Date: Mon, 28 Aug 2023 17:37:53 -0600 Message-ID: <20230828233821.43074-9-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::134; envelope-from=imp@bsdimp.com; helo=mail-il1-x134.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266357831100004 Content-Type: text/plain; charset="utf-8" From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Acked-by: Richard Henderson Singed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index aedfbf2d7db..56198cc6a00 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -179,6 +179,39 @@ struct target_freebsd__wrusage { struct target_freebsd_rusage wru_children; }; =20 +/* + * sys/stat.h + */ +struct target_freebsd11_stat { + uint32_t st_dev; /* inode's device */ + uint32_t st_ino; /* inode's number */ + int16_t st_mode; /* inode protection mode */ + int16_t st_nlink; /* number of hard links */ + uint32_t st_uid; /* user ID of the file's owner */ + uint32_t st_gid; /* group ID of the file's group */ + uint32_t st_rdev; /* device type */ + struct target_freebsd_timespec st_atim; /* time last accessed */ + struct target_freebsd_timespec st_mtim; /* time last data modificatio= n */ + struct target_freebsd_timespec st_ctim; /* time last file status chan= ge */ + int64_t st_size; /* file size, in bytes */ + int64_t st_blocks; /* blocks allocated for file */ + uint32_t st_blksize; /* optimal blocksize for I/O */ + uint32_t st_flags; /* user defined flags for file */ + uint32_t st_gen; /* file generation number */ + int32_t st_lspare; + struct target_freebsd_timespec st_birthtim; /* time of file creation */ + /* + * Explicitly pad st_birthtim to 16 bytes so that the size of + * struct stat is backwards compatible. We use bitfields instead + * of an array of chars so that this doesn't require a C99 compiler + * to compile if the size of the padding is 0. We use 2 bitfields + * to cover up to 64 bits on 32-bit machines. We assume that + * CHAR_BIT is 8... + */ + unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); + unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); +} __packed; + #define safe_syscall0(type, name) \ type safe_##name(void) \ { \ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266340; cv=none; d=zohomail.com; s=zohoarc; b=AG3yVThwMGpufsO1xivdGYs4VZWdAp3cZN+ow0F5Kjw+1V8JKoc+DlEweWufH5xtzU3k1297BxBBTvCYTUk9mW8WbzoJrQwedoumWXm0I8GCna8MsnVQI4xoUGLbk+6BPDSTyddf+BTWxgY3NhBxNju+JASsd2+3/dHe5+NQyus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266340; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=myWLdhC0sTpg74wmYRm8tt2zULF2VyHwrBtwz0SCxYk=; b=jsBsbUXuGtESvAHVE9aT2i7PAtbKYemrkmUf9dxKQ9p1MckPiOb5lqahxUsUz9NadWfUHNR6xFxJ21ZIKduJX7sKXrZOJL42mwFo6EAXc1Cjo6RWxYxWu/CB0uV/N4vyMo5aAxtYV0jfGsrw5eaBt1Rh0n/vUGxUi8PlK57wNcA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266340738350.50232314772177; Mon, 28 Aug 2023 16:45:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrs-0003jd-09; Mon, 28 Aug 2023 19:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrj-0003gG-OU for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:52 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrg-0006iF-QV for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:51 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-34dea77cbe6so867545ab.2 for ; Mon, 28 Aug 2023 16:41:48 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266107; x=1693870907; 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; bh=myWLdhC0sTpg74wmYRm8tt2zULF2VyHwrBtwz0SCxYk=; b=XhZQmPUmRjJqxh85RPS3Va/3dopZGU2YGx5ZaJyPF+3W2Q1cLgFaoDkeOdA0djXxyx RaVWQ7mmwKn1lFmJSYOhx3e3pYN2nzv42FMSdKtzm6u5LEq3qdSsh1QL2H+ev77ch8Dw nP+NUuZDwcWfHstRKlV9GUwsy+eq6PMVFAmXYc4QMRKxTuQf1tNS5kiEFKQ+FALldeYQ 5ptX8MwYTIRr3PUeBRIccG0uWQhPMywzGQ1OI0f0HPzSfWOqpzcGwn/oqMzvJEYUmfmq BFY1dEKsL03V1ltKJM2Nlrzn4T0sh4kTthqTJ8g7BPNgjzK5/jg83a2fLKFjgcsDKmyc ufnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266107; x=1693870907; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=myWLdhC0sTpg74wmYRm8tt2zULF2VyHwrBtwz0SCxYk=; b=iGXdUP/CsnHk1qy1L3VlDG5K7mg2JwuAbnRXaj8MwkMzkhdOmLyw7T7uj1dmX9fkG6 185+PzS3G0X8FMxQZOdk18OoH1gYuoOTBsJ63f/VSza6UGbGFE2KxS5/NHQZKyRu7OWF +jg+pTYYvdBTvHjERfDKCkJxk3DCYSZK8LN5hOBiA/TFf/BG6fyezUxwk02G/DL0kJlX 1fuKHUCfOe+fHUzowajW115ZR3GNJ/G0PzVGLxPpZt5EhF+JDHNHDtK6a7/onm0grGCQ ydhBRg7xxg6AdqXHNBscjCF1ZQjUJsLhESPBCDLuH17m6M/dNTL1AinYAG1FnAcsQLDe VU0A== X-Gm-Message-State: AOJu0YzGUnDTVTTUg5p54TY1dlTskdRVDdSB7NlvGABZzjJU53njBLJX C0HD5H+caDG5tvLmfWtJBy/s7P9q4T93qrFJNMU= X-Google-Smtp-Source: AGHT+IHIdf9FOygmwZiYUt4GRO0eMCUqU6mlnskJ4cLSEWTpOs9UYLoxlgTJd2NsqH1el382D75kfQ== X-Received: by 2002:a92:cda3:0:b0:349:785:adc7 with SMTP id g3-20020a92cda3000000b003490785adc7mr22067151ild.15.1693266106975; Mon, 28 Aug 2023 16:41:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Karim Taha , Richard Henderson Subject: [PULL 09/36] bsd-user: Add struct target_stat to bsd-user/syscall_defs.h Date: Mon, 28 Aug 2023 17:37:54 -0600 Message-ID: <20230828233821.43074-10-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266342841100003 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Acked-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 56198cc6a00..bd04b30a560 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -212,6 +212,44 @@ struct target_freebsd11_stat { unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); } __packed; =20 +#if defined(__i386__) +#define TARGET_HAS_STAT_TIME_T_EXT 1 +#endif + +struct target_stat { + uint64_t st_dev; /* inode's device */ + uint64_t st_ino; /* inode's number */ + uint64_t st_nlink; /* number of hard links */ + int16_t st_mode; /* inode protection mode */ + int16_t st_padding0; + uint32_t st_uid; /* user ID of the file's owner */ + uint32_t st_gid; /* group ID of the file's group */ + int32_t st_padding1; + uint64_t st_rdev; /* device type */ +#ifdef TARGET_HAS_STAT_TIME_T_EXT + int32_t st_atim_ext; +#endif + struct target_freebsd_timespec st_atim; /* time of last access */ +#ifdef TARGET_HAS_STAT_TIME_T_EXT + int32_t st_mtim_ext; +#endif + struct target_freebsd_timespec st_mtim; /* time of last data modifica= tion */ +#ifdef TARGET_HAS_STAT_TIME_T_EXT + int32_t st_ctim_ext; +#endif + struct target_freebsd_timespec st_ctim;/* time of last file status ch= ange */ +#ifdef TARGET_HAS_STAT_TIME_T_EXT + int32_t st_btim_ext; +#endif + struct target_freebsd_timespec st_birthtim; /* time of file creatio= n */ + int64_t st_size; /* file size, in bytes */ + int64_t st_blocks; /* blocks allocated for file */ + uint32_t st_blksize; /* optimal blocksize for I/O */ + uint32_t st_flags; /* user defined flags for file */ + uint64_t st_gen; /* file generation number */ + uint64_t st_spare[10]; +}; + #define safe_syscall0(type, name) \ type safe_##name(void) \ { \ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266199; cv=none; d=zohomail.com; s=zohoarc; b=JzNMVCoJ75f7V9zRGX6Kr6H6K3KWvqX+wyoV4Aho+he3UYcK+c92udPHsKuNwPQw95VikMQDuH1SMYssLLVR3XJvuUT9yy6gVNxWN+QzACETpk1RI4XXxzBJFbTf3kczOLulY5eadDOAAZp12yUz0V6TqMjyvKKqp2yYbugBxpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266199; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CHVIeIEsGWfKvFkl87UQKdXlAw8VkJUEJfOxAHtMyYE=; b=P1VDEVylnHye6j6Z9H5Y/hPNdNY1DPLJdFGcEpOP0TFmYwduzHGeyKnDIMCCRZ1BeckIM4ZMmSvr2w0zzsHe1in8B3q5lMjvFoy6LRTqFhEUfa93lTqFQ3RXZg6upb9iWMfjDq5jLig2RzYoaJdjvVA8vz9Wgd33CRK5H01tUxE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266199857972.6513926285488; Mon, 28 Aug 2023 16:43:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrq-0003im-Td; Mon, 28 Aug 2023 19:41:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrk-0003gH-AH for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:52 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrh-0006iW-Ek for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:52 -0400 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-34961362f67so11651375ab.0 for ; Mon, 28 Aug 2023 16:41:48 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266108; x=1693870908; 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; bh=CHVIeIEsGWfKvFkl87UQKdXlAw8VkJUEJfOxAHtMyYE=; b=Yk1jFDTL6uhPJ6Qn5NGnsUSA/ESuI3yu8KQBQNyvmpEYKLx+pIjpePxw8EFI1YjlwH zmbRrWoj/epnqbOHFaGz0ZaLmE7iJkzlNm3BadyjymxYkVjdZP/MHpBnswDBqiH1pSj6 FXaKymTkOWLkJzD/jCrQ8EsBRV8JMd832y9xuaM4XXgRreOFSZyHWmCBbcUIv76XcZrQ GOqgWcSULdVeQyGu5FX6nsff00ZmpwYMLpoJ8Oy4NhzBmmJGIsvOsGfj2sP63QonvEs7 CxG/+ol8AqKKuBXYMk2QMM+zneK7pR86R1BfaUzsJCj9OF4yFXTWUUXk9qjI8Wp4nsEL KOdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266108; x=1693870908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CHVIeIEsGWfKvFkl87UQKdXlAw8VkJUEJfOxAHtMyYE=; b=Pnq6b1zV3D8V9YtaSIG4WYVi5nUN+Tb7G6GYna5delrQkh3dVkVBxjhqlrAQkdcfaH bnDWh+nGIzPLL779BDLK5851VcAWKorClsOhFr9Ao83VEaw1ognJi06BbUAo6ACh1wf+ wuR18e1X4fm+fDEvwa07W6OdVUh14MVJJz7rIqSp/QTL8NAHry+JWwg/vEmMwwRoDmOt Ylyj8W29TEoCiVjYW5NN6OZhQx4yz9vMaR1siJSpY52qxU9DrHDu8zavBtG9DvBrALl5 et1mevjhRiKeHRQ6Qi2TsLfi6ONlb90qFajxJxLWfdDXhQLTynHuw6h1xomkPGmCtYsv f0sA== X-Gm-Message-State: AOJu0YxomtWwSXCwVpHD1UmhdFnnI0qiE1Ui/EZjW9beev1OC1U26kQ8 zR+v78JsRc4xr0BCeHeiVKibhMEV8XZuwUyA240= X-Google-Smtp-Source: AGHT+IESOx+QPRn44v1SdQ4TRuEju/P46ieCkRDkTB2bEu6xxYax/ykbmKcuIF9nZjvWJu6qVf4SVw== X-Received: by 2002:a92:cdaf:0:b0:345:873d:1102 with SMTP id g15-20020a92cdaf000000b00345873d1102mr980283ild.15.1693266107840; Mon, 28 Aug 2023 16:41:47 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 10/36] bsd-user: Add structs target_freebsd11_{nstat,statfs} Date: Mon, 28 Aug 2023 17:37:55 -0600 Message-ID: <20230828233821.43074-11-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12d; envelope-from=imp@bsdimp.com; helo=mail-il1-x12d.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266200826100012 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add structs target_freebsd11_nstat and target_freebsd11_statfs to bsd-user/syscall_defs.h Signed-off-by: Stacey Son Signed-off-by: Karim Taha Acked-by: Richard Henderson --- bsd-user/syscall_defs.h | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index bd04b30a560..51d8ff0dd8e 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -250,6 +250,70 @@ struct target_stat { uint64_t st_spare[10]; }; =20 + +/* struct nstat is the same as stat above but without the st_lspare field = */ +struct target_freebsd11_nstat { + uint32_t st_dev; /* inode's device */ + uint32_t st_ino; /* inode's number */ + int16_t st_mode; /* inode protection mode */ + int16_t st_nlink; /* number of hard links */ + uint32_t st_uid; /* user ID of the file's owner */ + uint32_t st_gid; /* group ID of the file's group */ + uint32_t st_rdev; /* device type */ + struct target_freebsd_timespec st_atim; /* time last accessed */ + struct target_freebsd_timespec st_mtim; /* time last data modificatio= n */ + struct target_freebsd_timespec st_ctim; /* time last file status chan= ge */ + int64_t st_size; /* file size, in bytes */ + int64_t st_blocks; /* blocks allocated for file */ + uint32_t st_blksize; /* optimal blocksize for I/O */ + uint32_t st_flags; /* user defined flags for file */ + uint32_t st_gen; /* file generation number */ + struct target_freebsd_timespec st_birthtim; /* time of file creation */ + /* + * Explicitly pad st_birthtim to 16 bytes so that the size of + * struct stat is backwards compatible. We use bitfields instead + * of an array of chars so that this doesn't require a C99 compiler + * to compile if the size of the padding is 0. We use 2 bitfields + * to cover up to 64 bits on 32-bit machines. We assume that + * CHAR_BIT is 8... + */ + unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); + unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); +} __packed; + +/* + * sys/mount.h + */ + +/* filesystem id type */ +typedef struct target_freebsd_fsid { int32_t val[2]; } target_freebsd_fsid= _t; + +/* filesystem statistics */ +struct target_freebsd11_statfs { + uint32_t f_version; /* structure version number */ + uint32_t f_type; /* type of filesystem */ + uint64_t f_flags; /* copy of mount exported flags */ + uint64_t f_bsize; /* filesystem fragment size */ + uint64_t f_iosize; /* optimal transfer block size */ + uint64_t f_blocks; /* total data blocks in filesystem */ + uint64_t f_bfree; /* free blocks in filesystem */ + int64_t f_bavail; /* free blocks avail to non-superuser */ + uint64_t f_files; /* total file nodes in filesystem */ + int64_t f_ffree; /* free nodes avail to non-superuser */ + uint64_t f_syncwrites; /* count of sync writes since mount */ + uint64_t f_asyncwrites; /* count of async writes since mount */ + uint64_t f_syncreads; /* count of sync reads since mount */ + uint64_t f_asyncreads; /* count of async reads since mount */ + uint64_t f_spare[10]; /* unused spare */ + uint32_t f_namemax; /* maximum filename length */ + uint32_t f_owner; /* user that mounted the filesystem */ + target_freebsd_fsid_t f_fsid; /* filesystem id */ + char f_charspare[80]; /* spare string space */ + char f_fstypename[16]; /* filesys type name */ + char f_mntfromname[88]; /* mount filesystem */ + char f_mntonname[88]; /* dir on which mounted*/ +}; + #define safe_syscall0(type, name) \ type safe_##name(void) \ { \ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266367; cv=none; d=zohomail.com; s=zohoarc; b=LB6DmA5zutcyKyTSXGoOvupK0y7TmJk+8UsujwErrOo9MbLpPDZDm3Vv3C7LcNC9xLePaKbi+a3RthC3sE4mroLS6adbSp8tF30nkZ2e2DVXJOJ/TC7UZYAsTJ+ihOPDbPI4iRwkqzIEUtIBuOEc88AqdhogxpngYsel7ZMn4RM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266367; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ck+M28e6yFMA7RarEDVs/Bl/fwVuNc5eFshlRTpFMmk=; b=dzJ58g/0uzlC3vymk7IWONT/tx0Y9fRhQ+8raNTnkmggdqsVM0e/ItCPdGjBPJIiibvZuUBXmGC6ost5NkNc0JNQ7Dhe4yjELy/6rAtEPJJ2pb7u2PrJb0wKtxqRi4mGSZmJKoXB2zPgLM6B08rdf6wvlMJtgphRQm5oUa2yTXM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266367356733.0268365818766; Mon, 28 Aug 2023 16:46:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrn-0003hq-P9; Mon, 28 Aug 2023 19:41:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrk-0003gb-ML for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:52 -0400 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalri-0006ie-93 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:52 -0400 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-34baeb01942so13352335ab.1 for ; Mon, 28 Aug 2023 16:41:49 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266108; x=1693870908; 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; bh=ck+M28e6yFMA7RarEDVs/Bl/fwVuNc5eFshlRTpFMmk=; b=wcXXeiV3s+ncnDZp+9p8i+j6xHbhF+pO5ugmVRgglZ2OcK70Z6bWS7S8/nGncOWjuC NQ3ewfnwevD2rFchVlZ65qXPEdPhoDMPs44We6NHejH9ltSAZecJD1VYhK9WkjasUK20 9jd+XTHUEgF0mt0xwlCsXeNZHU5zC2EntfArKlR7HVTYxe8JzPGK0JXvpXmEv8WKAmtl MEYodUxmsfBIiwlbjz4iHDexpIuLrTFDHpsQaW4BnTZs9MZsRcYYfy0kRlE699aCDANJ Uq6/z+3IrfStEyM+9w+CjH0LJbQSk61HSa1oUwehSWK75pO2BhOinJG6a1zNabbC9CK7 ugrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266108; x=1693870908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ck+M28e6yFMA7RarEDVs/Bl/fwVuNc5eFshlRTpFMmk=; b=X4c2QGglKIxKEy3BT1VSozW9+8FvzciBFEl0Zgvbijg4CL/9WTkoLtZiW4H+HGPQMZ 5gfiRgSxGxiDzRhj9VwXKS5XODS7Q3J/scSvurg2305b80Rjbzhqd7GpzDeyDLJ1UPK7 piScTre/40Eu2lWblpPNjJWsRLFbnoZzp+/FIIAWZM2wz8RkyiazQduoZIIJ8rjWkO0r JALTVxMYIArFY+UqEYuVUTd0jHpfsg5kBIKIneoNIIPnVwby+CQcKqhPXigkW2MsGK1G O9JKGQBaaJVquamR3l3mIh++X/G77Sjkwy/3SBNBaFIqeKgt3bDBb6P+tUuRWzmPHEfO lfKA== X-Gm-Message-State: AOJu0YzQvocQ2vW2w/XIJEj8hA3JcDrSUfwgnP8rok1Bg/fHX7vVL1mp 16h68Encg0jlHIN7R8azQnR9p+gkZF2lDAcxKd4= X-Google-Smtp-Source: AGHT+IGgXv122/ui6jIZX0bNC+lpA2R1OdCs0vbJp7/8mso5QktzJacrbwYkfdITWCAaBicLau4ydA== X-Received: by 2002:a05:6e02:1523:b0:345:787a:cb1c with SMTP id i3-20020a056e02152300b00345787acb1cmr21402832ilu.6.1693266108689; Mon, 28 Aug 2023 16:41:48 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Karim Taha , Richard Henderson Subject: [PULL 11/36] bsd-user: Add struct target_statfs Date: Mon, 28 Aug 2023 17:37:56 -0600 Message-ID: <20230828233821.43074-12-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12e; envelope-from=imp@bsdimp.com; helo=mail-il1-x12e.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266368963100007 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Add struct target_statfs to bsd-user/syscall_defs.h Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Acked-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 51d8ff0dd8e..499a80f8bff 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -314,6 +314,31 @@ struct target_freebsd11_statfs { char f_mntonname[88]; /* dir on which mounted*/ }; =20 +struct target_statfs { + uint32_t f_version; /* structure version number */ + uint32_t f_type; /* type of filesystem */ + uint64_t f_flags; /* copy of mount exported flags */ + uint64_t f_bsize; /* filesystem fragment size */ + uint64_t f_iosize; /* optimal transfer block size */ + uint64_t f_blocks; /* total data blocks in filesystem */ + uint64_t f_bfree; /* free blocks in filesystem */ + int64_t f_bavail; /* free blocks avail to non-superuser = */ + uint64_t f_files; /* total file nodes in filesystem */ + int64_t f_ffree; /* free nodes avail to non-superuser */ + uint64_t f_syncwrites; /* count of sync writes since mount */ + uint64_t f_asyncwrites; /* count of async writes since mount */ + uint64_t f_syncreads; /* count of sync reads since mount */ + uint64_t f_asyncreads; /* count of async reads since mount */ + uint64_t f_spare[10]; /* unused spare */ + uint32_t f_namemax; /* maximum filename length */ + uint32_t f_owner; /* user that mounted the filesystem */ + target_freebsd_fsid_t f_fsid; /* filesystem id */ + char f_charspare[80]; /* spare string space */ + char f_fstypename[16]; /* filesystem type name */ + char f_mntfromname[1024]; /* mounted filesystem */ + char f_mntonname[1024]; /* directory on which mounted */ +}; + #define safe_syscall0(type, name) \ type safe_##name(void) \ { \ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266298; cv=none; d=zohomail.com; s=zohoarc; b=Z/i+H4M/hOgAqEzd3AYovwtSUei+1adTeeRV6RG4Fz8S0pj709MhhYe0u5TM+gI0jICkN0KbZSC3gMtg46r82nzmNGvaQ0fS+z0sKHlotngqDCKE4DdvfBl0YBibVIC1Oq4DjwI5puyuAmL1qcMW0OTR09hPXF2frDb1L1y348Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266298; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dKikkRC80oy5DbtX2PLleQEU+3OLPjrRbS0XoUPdcnk=; b=CAtagnjMlv8drJsa3aP4xnxYL6nqomcht3JKwp8Bc4ozpZZ21hs/mCClg0Uv5Ed9EjK9ctffI3tSXDBlqyD8FnNG2ByoF6vVUDCQNVczd+noa3uyN1jszwAdATv45xsXrAvxVFXuYzECNmh6CAoqaFzvRKSFsrw2G22rRhrHzPg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266298961301.6819347226003; Mon, 28 Aug 2023 16:44:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalro-0003i5-TU; Mon, 28 Aug 2023 19:41:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrm-0003gn-Pa for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:54 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalri-0006ip-Ux for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:53 -0400 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-34bad74fb3dso14269845ab.1 for ; Mon, 28 Aug 2023 16:41:50 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266109; x=1693870909; 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; bh=dKikkRC80oy5DbtX2PLleQEU+3OLPjrRbS0XoUPdcnk=; b=XcsOsQrUl5xK4SawEHt26YusywJ+9SMxGD2OJhkYb8p+g7pzuDlHpTa2zuQ4ifYWfw kVobm7V0h2pHA3jqHQmhNkx0/xZz7wCIF1c5XD3pEGodRypA6qMbwUuBBDzxqfD+m37m Xh6dEtU9BQM+GaxByCrE7wfcyq/iyPEO01Th7qvMRCsAuwnrfnCeJ0eHO8V6c/RasGmT JJXxzr+Jb0QzOxAqH+ykOZxf/yx4H0bv9iO+Oxk4K1GW/MIVDP1rQqbwFJ2ESAzM4dr6 gaiY6OjM61XmzcE63mSlMlZX9vekTUd3BYNoLeQ3KcyXHBgYeqhXifePPuGuOaP4QIt3 cTag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266109; x=1693870909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dKikkRC80oy5DbtX2PLleQEU+3OLPjrRbS0XoUPdcnk=; b=JVNDYd9e4+WSaC6UX6ya/fPka4p4QiEqNR6wRfxn6UQ6ZxBYWT5cVVVY9509MzZIrA DgmdFc20qRraupPhDJTc/ScpCpAoIduLGoYf/wfajWZRVSoz63vkv4Bv8jhRZSO4W97p JQUO+zBidSh4RkG32G+DNijQp9WHOdIIcVGlv0ScRG3HeVEld4/bmcMRhT1Szc8R/dJA mINshQFYTFV/AE9FQGslaR/qn++ZV2gHwZHSD3KfK3Nf95AXlVT2a4faRUVd86KJGoSv KmL64NN/9CoqJioWlL50Nae7yTLGUo8nv/6lsmp6bfcPNL4ZmWsFaJG08G7oi7aX+mS+ oOXQ== X-Gm-Message-State: AOJu0YzlKLiRHlWb6rmvIxD5qaDfY+ldNrMqPU4d4VQJBwsarP0Yyrt8 n36dykACks2sVEPtnQzGKH1wiAWJU/A8f6yvUJw= X-Google-Smtp-Source: AGHT+IGUJdNbP0jEYHYDE6A4cQjK+qDzIZQIzPuN3o6TQmumXZVtk9RytTNrJ6uRkg0J5gXYtYRVnA== X-Received: by 2002:a92:cda6:0:b0:34c:dbeb:a2a7 with SMTP id g6-20020a92cda6000000b0034cdbeba2a7mr14445155ild.23.1693266109490; Mon, 28 Aug 2023 16:41:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 12/36] bsd-user: Add struct target_freebsd_fhandle and fcntl flags Date: Mon, 28 Aug 2023 17:37:57 -0600 Message-ID: <20230828233821.43074-13-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::135; envelope-from=imp@bsdimp.com; helo=mail-il1-x135.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266299405100002 Content-Type: text/plain; charset="utf-8" From: Stacey Son Add struct target_freebsd_fhandle and fcntl flags to bsd-user/syscall_defs.h Signed-off-by: Stacey Son Signed-off-by: Karim Taha Acked-by: Richard Henderson Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 499a80f8bff..96ae90b0631 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -339,6 +339,57 @@ struct target_statfs { char f_mntonname[1024]; /* directory on which mounted */ }; =20 +/* File identifier. These are unique per filesystem on a single machine. */ +#define TARGET_MAXFIDSZ 16 + +struct target_freebsd_fid { + uint16_t fid_len; /* len of data in bytes */ + uint16_t fid_data0; /* force longword align */ + char fid_data[TARGET_MAXFIDSZ]; /* data (variable len) */ +}; + +/* Generic file handle */ +struct target_freebsd_fhandle { + target_freebsd_fsid_t fh_fsid; /* Filesystem id of mount point */ + struct target_freebsd_fid fh_fid; /* Filesys specific id */ +}; +typedef struct target_freebsd_fhandle target_freebsd_fhandle_t; + +/* + * sys/fcntl.h + */ +#define TARGET_F_DUPFD 0 +#define TARGET_F_GETFD 1 +#define TARGET_F_SETFD 2 +#define TARGET_F_GETFL 3 +#define TARGET_F_SETFL 4 +#define TARGET_F_GETOWN 5 +#define TARGET_F_SETOWN 6 +#define TARGET_F_OGETLK 7 +#define TARGET_F_OSETLK 8 +#define TARGET_F_OSETLKW 9 +#define TARGET_F_DUP2FD 10 +#define TARGET_F_GETLK 11 +#define TARGET_F_SETLK 12 +#define TARGET_F_SETLKW 13 +#define TARGET_F_SETLK_REMOTE 14 +#define TARGET_F_READAHEAD 15 +#define TARGET_F_RDAHEAD 16 +#define TARGET_F_DUPFD_CLOEXEC 17 +#define TARGET_F_DUP2FD_CLOEXEC 18 +/* FreeBSD-specific */ +#define TARGET_F_ADD_SEALS 19 +#define TARGET_F_GET_SEALS 20 + +struct target_freebsd_flock { + int64_t l_start; + int64_t l_len; + int32_t l_pid; + int16_t l_type; + int16_t l_whence; + int32_t l_sysid; +} QEMU_PACKED; + #define safe_syscall0(type, name) \ type safe_##name(void) \ { \ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266280; cv=none; d=zohomail.com; s=zohoarc; b=EOMk0AC4ihX+vt14EkRkD9vbERmapEalFIzBpMl+7OPSVIDBrx/WGG4DkplcwoPYyUyWS43V5zAkUq6YaWwDBOJ2Qk3JsOZXm2GR2eOb09yzjToCwoThK7fDISeKObY8EJTpM7iXKp6PLMzmNn+86vPVSEhQRSr0qY1AXODSFjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266280; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lHhVGY2K5IoodFPGk0u454gwl2cIZz8X0aAqanzMoZE=; b=DQ8AKBh0XKHydKfeGZUJdNszSkbq5QpZ6GHcR14oOsZy4JrSlxaxA6qPAdJ44732R/Hksk87UXjbskY4DSu3DDyP7rVE0gyfrCK+MNFW0J+TDG6Os1rB7oCDCPev9fBlMV2wXLGNmUEteT8w/Xy081XdrcQWibkSwjD0HhKht60= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266280963657.3753857216107; Mon, 28 Aug 2023 16:44:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrr-0003jI-3I; Mon, 28 Aug 2023 19:41:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrm-0003go-QS for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:54 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrj-0006j4-V5 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:53 -0400 Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-34961362f67so11651465ab.0 for ; Mon, 28 Aug 2023 16:41:51 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266110; x=1693870910; 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; bh=lHhVGY2K5IoodFPGk0u454gwl2cIZz8X0aAqanzMoZE=; b=EHUb/DTVrL2xRij0Xcy8+5KFuT3uM0lpdiU7lLjo2HoxaTfl/DkXkvl2RVaS6evL3j 41Qz7EOf45COw1hD9ZPHa5ofBAKSi09J8b6gt+7a9D00wJOxjqZBbB5W5ju7qK24TY3X TVUwZZx+QADWOwvN3NyyGKJfguFQAJwFr/v868yUs4naU+JMpQgF2089AhdXQTgLC4yZ lV+0OANoIKv8sCy3jRqt5tsgfLnD2UebbBy4VO7f4HW9RFLNjexwkGz0yiWmH7i1ntYx DwN+9VwtO2nCk1n3qWHr8srIvQ2so+7uqEgjTR8oBz+QGWdE80VujBfTwXeAu7vgvFC5 9CVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266110; x=1693870910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lHhVGY2K5IoodFPGk0u454gwl2cIZz8X0aAqanzMoZE=; b=VgOxESOE9bTv39gVAtdcBHA6FMAbehu3mRj4ONvFqqBcEPNJjcYPUZA3UQum6IAqMN uQL7NtRPcJzW20ufFE/E64orhJisoDJVIZ4CqY7OUwtoH9J9nsGttDFMaO+DNU/+UYAo cU44LndrGPtkCu53N9w4KTEmc08kmOmI2aXhI+vUMPhFenGXCjA7E7o9++QtpDDDY0Xo ctCfl1CsIYqcfx6+xkZWbep9D+3mfad+LCK0xErxIJfx7FsOqYj+hTmAWCXlouIBiNcX aydTtprnVXIXfyQa5BP1eGVvbe/l7fu4AfNmjk7Qk4rLfkwVweiq7YbTo5M5Mk1XsfdV qxuw== X-Gm-Message-State: AOJu0YyJu2MtWkGInd1gIYt2h/WVYSChYj5DJzo9sEQB7brZplT40SAD uvuhITMUKtRDXSaRsn9TkAtJ+t1bc7FFYkFdXP8= X-Google-Smtp-Source: AGHT+IF8AklY3IYRaWZRy/6C7Ptv3/UiEZpmr8RoCcUk9Wg1A/SUMnO6tHG1pWyBHpD461yWtZ8poQ== X-Received: by 2002:a05:6e02:168d:b0:34c:f9c5:f375 with SMTP id f13-20020a056e02168d00b0034cf9c5f375mr1215035ila.8.1693266110270; Mon, 28 Aug 2023 16:41:50 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 13/36] bsd-user: Define safe_fcntl macro in bsd-user/syscall_defs.h Date: Mon, 28 Aug 2023 17:37:58 -0600 Message-ID: <20230828233821.43074-14-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12f; envelope-from=imp@bsdimp.com; helo=mail-il1-x12f.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266283074100003 Content-Type: text/plain; charset="utf-8" From: Kyle Evans Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 96ae90b0631..c6699c9943e 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -437,6 +437,8 @@ type safe_##name(type1 arg1, type2 arg2, type3 arg3, ty= pe4 arg4, \ return safe_syscall(SYS_##name, arg1, arg2, arg3, arg4, arg5, arg6); \ } =20 +#define safe_fcntl(...) safe_syscall(SYS_fcntl, __VA_ARGS__) + /* So far all target and host bitmasks are the same */ #undef target_to_host_bitmask #define target_to_host_bitmask(x, tbl) (x) --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266235; cv=none; d=zohomail.com; s=zohoarc; b=XRolcl3K/yC4rU0fdvSRqHfHApTw5cRLdzXLWgBfANEMsEPJi3xFmIRZCOpfZUe5aDtr31NZYmrRX3Otv7Fbj7IcL+G0Os3DP6mL7c5BM+bfUTZ2sr6JzoRjuXOs2FDO91fYzfCJlaMo1GQIgR+W95BzXb5+Q8FLHwNDNtg9yjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266235; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CWjexX3tTM1dvknP8K4al217e8HKfI6QYA9Z4MD5OIU=; b=bIl4+lwlMAIJc56r92VEJ2nsn+l+YhJCXV6kAOSoNTyrwb6kHDLcWZ61UiWJgeH2Z+Tgnb+1OKBQpPOf9sPTYQaGmK8qsibRTPAh4CvURyNQvXEv0I8PtGcEX0NVEpngSfMYzJLaez9Og4e0nLi+0/jR6kaOePxiyLuml4BKgLc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266235461149.06550778269195; Mon, 28 Aug 2023 16:43:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalro-0003i1-Rg; Mon, 28 Aug 2023 19:41:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrn-0003hn-Ie for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:55 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrl-0006jJ-CH for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:55 -0400 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-794e0e8b588so43865939f.1 for ; Mon, 28 Aug 2023 16:41:52 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266111; x=1693870911; 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; bh=CWjexX3tTM1dvknP8K4al217e8HKfI6QYA9Z4MD5OIU=; b=FaWRy8/3kmnFNhTXtcRqjnB5v8pdqrZD+jxr2TfE6hApaacTSG95ixoEdibZHUqQ9S cKSaAJnN41w802lxxsQxTWNXXptne4O94JWpTCa5KuF/0XCPthJBgC0eBYN0qiLGq2A3 jDoWshXr9Asn+nTp0G6NlRyMXNIVSCf8RwrGyBwFZsvTnYXvgMze52xyeHMKV9DOzF+D ecKTVGFw1JLU65+8CbZ6dU9Oh308xX5Tr5HhwzQ/dJZYC8IA+ulXER9hD0KUms7+B0uH v+EuwFd2Mfoft4fEUQ+T81rQ9WxmoyBsKCK8cyYo3+R3j/Jlz+DShEz5xPeXQaBaKSjX dhIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266111; x=1693870911; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CWjexX3tTM1dvknP8K4al217e8HKfI6QYA9Z4MD5OIU=; b=CU9kNXXOtlzx98N/ckZI1znJvQnMABwqqNgAzxXOJjsrroXWefJrH+Ku6KiuPryp6t zuEOvjUjxtPFyze6Z1ymYYx9tITpVjLYJi8DD0Ull6ka+nkvKcI4p9FLimipk5Mue5jj affih1/G6yUlTAANgdwXMsRt78hGjqciUhvVYuesJ1oM5YLG6sufzTHEby9qPfdVc2TJ qo6XaYmQg6SbPA+IGp6RqXJ1045B7JiOiZDq6cYHgMhpelEd9R456u48Hjn5drkVnxVv 2dka1YWqCVm7+nMDRL/iqecijd0W3ILiv3AWgoIPZfPW3Ndjyn8dKHoRHu2hPLxw/3K5 b0Wg== X-Gm-Message-State: AOJu0Ywj3hVZwl//sET9PH5WxXJuYt2qW8g0Ue+FTmg+d4eu8hrWTlxa BmWuHikxJaQsQav2+YjCcCIbYUKxeBVdHv9L3Fg= X-Google-Smtp-Source: AGHT+IHstBNGu6l6iEnsu5Bea8DGg5jcKUtsG9kbaKmcjDGgon7vaZvhNpqODuhFr342sxYiLpPGUw== X-Received: by 2002:a05:6e02:1607:b0:349:978e:78d8 with SMTP id t7-20020a056e02160700b00349978e78d8mr23679182ilu.2.1693266111447; Mon, 28 Aug 2023 16:41:51 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 14/36] bsd-user: Rename target_freebsd_time_t to target_time_t Date: Mon, 28 Aug 2023 17:37:59 -0600 Message-ID: <20230828233821.43074-15-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266236972100005 Content-Type: text/plain; charset="utf-8" This is necessary for future code using target_time_t, in bsd-user/syscall_defs. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/syscall_defs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index c6699c9943e..9c90616baae 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -45,9 +45,9 @@ * */ #if (!defined(TARGET_I386)) -typedef int64_t target_freebsd_time_t; +typedef int64_t target_time_t; #else -typedef int32_t target_freebsd_time_t; +typedef int32_t target_time_t; #endif =20 struct target_iovec { @@ -102,7 +102,7 @@ typedef abi_long target_freebsd_suseconds_t; =20 /* compare to sys/timespec.h */ struct target_freebsd_timespec { - target_freebsd_time_t tv_sec; /* seconds */ + target_time_t tv_sec; /* seconds */ abi_long tv_nsec; /* and nanoseconds */ #if !defined(TARGET_I386) && TARGET_ABI_BITS =3D=3D 32 abi_long _pad; @@ -120,7 +120,7 @@ struct target_freebsd__umtx_time { }; =20 struct target_freebsd_timeval { - target_freebsd_time_t tv_sec; /* seconds */ + target_time_t tv_sec; /* seconds */ target_freebsd_suseconds_t tv_usec;/* and microseconds */ #if !defined(TARGET_I386) && TARGET_ABI_BITS =3D=3D 32 abi_long _pad; --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266331; cv=none; d=zohomail.com; s=zohoarc; b=jCnGaTmcawXRCxUHgE4wFAOGA7tMsRo3UzBXPHKZoZtSgJrjkVHAid604Nb8M2JgzLZc3xytMbs5L5FJ6gIkHNqGR2jjfbdUjCmUbLHyTaGEF8YzZFp+DH0YYMn1SRoo3/tZ1dWa0EAq8LaL3ZjMhGhGoGnhvZ4fkU2G5VbbzsY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266331; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9OfqJxry5f581sIZWAhIjAoRAlIB/L3PO5LHdIfc+KE=; b=gYLDje2P2ObVv/KDy97Ojs3hl/s27qAweIWaIJkxDA4YxJpsxetDh9T9xKExziWPv+qA0BXwrvLMf7cbEsxnn6kdTYobwwsXT20k6gS1Wu6/D0OdnGkJFxWImJbrUIigBLtNSiLzYgplx4p5k2/QBh6KchN3qxRrTw6oD4AS6wY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169326633159169.28012470095064; Mon, 28 Aug 2023 16:45:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qals3-0003nx-6l; Mon, 28 Aug 2023 19:42:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrp-0003iT-6u for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:57 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrm-0006jU-GF for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:56 -0400 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7927611c54bso125399139f.2 for ; Mon, 28 Aug 2023 16:41:53 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266112; x=1693870912; 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; bh=9OfqJxry5f581sIZWAhIjAoRAlIB/L3PO5LHdIfc+KE=; b=114nOv6dhvQcq1M0O3Us0vXefMq598vpSzvb3qiFBESBkGgXD1YaSa+PXL4s1gOKsl jtNE05XKw4xD3BvQq8XEKGY7z2I93LgkIKy2HquGoJEQax0B+AdkXl4QZEEuqJK6BcC/ wCRkGhnP2vTKbB+V/Crr27uFuSl+tRhemveK89ybk+Fsb/PXdNyGz0Ka+J8Ain8nB7Nk FtDhf08pKvnpojkpPeWQmGBhfCRuVyNOccJHhWTajk/+2GZMglCBlG5xkZEJp0x8UbTH kEo816mDo0LIsszzOEYQV+kq6HintGYGYcE0LrD69I6hLnGe+o6NXQFXKrnZvjPMhfFR dbWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266112; x=1693870912; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9OfqJxry5f581sIZWAhIjAoRAlIB/L3PO5LHdIfc+KE=; b=URuh+7lRY9B5l3qFqhzG0Gd1WOXTgR2UK3upH8/Fp1ejxrg0u9EdmPdp7OtZg2Pe/n KO9JY27n/Qog8qq+FlGLDM7LZ9JwEhfS6zShrkVPZwZxT0JsjQKJm+Z5FES+BHBXKCKb jelX+SknA6Y6n+opE9jz6hwXNytuGmQEVwLjxnsHIrUcCI9HGfTb++u3nR8c9OD1HYn3 ts0lw5jZ2w0oRN2VUoV0cj8VpW7vSq1EwsKGDfC8DWY5ZGvvqJmgepS5P8GBf4ruRTK2 +pSFnUsWRwHFsZ6vrQHQYktYs7UVqqQCClXaerJFypMVQ7IF0JYyioBuoA2oGATGiUyv 7cJQ== X-Gm-Message-State: AOJu0YyrCq8+nDglPNFOtXnkDPsnCGfafuZ/C3Xrk0Ar8YfH/k4gjafB 4O8DFaQTqQzOAUQNkGQB8UOI36YWBxoIDwdTQrA= X-Google-Smtp-Source: AGHT+IGqTvX2onqzQhiRQahvRhmkM9GJcVcwHp+9WT3NLfhSrH3ligYmxIMaIL/cib2tlygUYKwsEg== X-Received: by 2002:a05:6e02:1ca8:b0:349:36e1:10fb with SMTP id x8-20020a056e021ca800b0034936e110fbmr20198717ill.18.1693266112306; Mon, 28 Aug 2023 16:41:52 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 15/36] bsd-user: Implement h2t_freebsd11_stat h2t_freebsd_nstat Date: Mon, 28 Aug 2023 17:38:00 -0600 Message-ID: <20230828233821.43074-16-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266333649100002 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the stat conversion functions: h2t_freebsd11_stat h2t_freebsd_nstat Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.c | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 bsd-user/freebsd/os-stat.c diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/freebsd/os-stat.c new file mode 100644 index 00000000000..8c73f7402c2 --- /dev/null +++ b/bsd-user/freebsd/os-stat.c @@ -0,0 +1,94 @@ +/* + * FreeBSD stat related conversion routines + * + * 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 . + */ +#include "qemu/osdep.h" + +#include "qemu.h" + +/* + * stat conversion + */ +abi_long h2t_freebsd11_stat(abi_ulong target_addr, + struct freebsd11_stat *host_st) +{ + struct target_freebsd11_stat *target_st; + + if (!lock_user_struct(VERIFY_WRITE, target_st, target_addr, 0)) { + return -TARGET_EFAULT; + } + memset(target_st, 0, sizeof(*target_st)); + __put_user(host_st->st_dev, &target_st->st_dev); + __put_user(host_st->st_ino, &target_st->st_ino); + __put_user(host_st->st_mode, &target_st->st_mode); + __put_user(host_st->st_nlink, &target_st->st_nlink); + __put_user(host_st->st_uid, &target_st->st_uid); + __put_user(host_st->st_gid, &target_st->st_gid); + __put_user(host_st->st_rdev, &target_st->st_rdev); + __put_user(host_st->st_atim.tv_sec, &target_st->st_atim.tv_sec); + __put_user(host_st->st_atim.tv_nsec, &target_st->st_atim.tv_nsec); + __put_user(host_st->st_mtim.tv_sec, &target_st->st_mtim.tv_sec); + __put_user(host_st->st_mtim.tv_nsec, &target_st->st_mtim.tv_nsec); + __put_user(host_st->st_ctim.tv_sec, &target_st->st_ctim.tv_sec); + __put_user(host_st->st_ctim.tv_nsec, &target_st->st_ctim.tv_nsec); + __put_user(host_st->st_size, &target_st->st_size); + __put_user(host_st->st_blocks, &target_st->st_blocks); + __put_user(host_st->st_blksize, &target_st->st_blksize); + __put_user(host_st->st_flags, &target_st->st_flags); + __put_user(host_st->st_gen, &target_st->st_gen); + /* st_lspare not used */ + __put_user(host_st->st_birthtim.tv_sec, &target_st->st_birthtim.tv_sec= ); + __put_user(host_st->st_birthtim.tv_nsec, &target_st->st_birthtim.tv_ns= ec); + unlock_user_struct(target_st, target_addr, 1); + + return 0; +} + +abi_long h2t_freebsd11_nstat(abi_ulong target_addr, + struct freebsd11_stat *host_st) +{ + struct target_freebsd11_nstat *target_st; + + if (!lock_user_struct(VERIFY_WRITE, target_st, target_addr, 0)) { + return -TARGET_EFAULT; + } + memset(target_st, 0, sizeof(*target_st)); + __put_user(host_st->st_dev, &target_st->st_dev); + __put_user(host_st->st_ino, &target_st->st_ino); + __put_user(host_st->st_mode, &target_st->st_mode); + __put_user(host_st->st_nlink, &target_st->st_nlink); + __put_user(host_st->st_uid, &target_st->st_uid); + __put_user(host_st->st_gid, &target_st->st_gid); + __put_user(host_st->st_rdev, &target_st->st_rdev); + __put_user(host_st->st_atim.tv_sec, &target_st->st_atim.tv_sec); + __put_user(host_st->st_atim.tv_nsec, &target_st->st_atim.tv_nsec); + __put_user(host_st->st_mtim.tv_sec, &target_st->st_mtim.tv_sec); + __put_user(host_st->st_mtim.tv_nsec, &target_st->st_mtim.tv_nsec); + __put_user(host_st->st_ctim.tv_sec, &target_st->st_ctim.tv_sec); + __put_user(host_st->st_ctim.tv_nsec, &target_st->st_ctim.tv_nsec); + __put_user(host_st->st_size, &target_st->st_size); + __put_user(host_st->st_blocks, &target_st->st_blocks); + __put_user(host_st->st_blksize, &target_st->st_blksize); + __put_user(host_st->st_flags, &target_st->st_flags); + __put_user(host_st->st_gen, &target_st->st_gen); + __put_user(host_st->st_birthtim.tv_sec, &target_st->st_birthtim.tv_sec= ); + __put_user(host_st->st_birthtim.tv_nsec, &target_st->st_birthtim.tv_ns= ec); + unlock_user_struct(target_st, target_addr, 1); + + return 0; +} + --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266355; cv=none; d=zohomail.com; s=zohoarc; b=G2QQ0OM+QW/0HVESXsF1WnHp2L07VU0FzOGEO4cd74FMAB7wovGZTrbCySgLDSXjLW8SPmXy4q6a4oZAwqBsDHlQzKsVWbZFgNb+7F5FFa6vjyZLZEt0A99/HmGrymYTjWyrIHJp95sVeR4oT+X9xXUdfel1v3TMn/BKAxDfJDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266355; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PwFVwEC3aiItv5/cugiAZJ9x7ROCgkBOW62fSEi/E4U=; b=YYLCFLDNAkJt4nbykOs0jaWVxk5zu6A0XsW9+NA/jSBZSINyKLh4HkK94IgsI9WDysIFtlAnTJ2o4sB3X8fZX656RkGsCM4Zl1CT8IWq7Wb5v+XLYCWO+QUyw2umVjkyNmStcNybyxqLpNLUjVRXNFsdaYU5o7xp50GkZAUeBFo= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266355696324.0237716589113; Mon, 28 Aug 2023 16:45:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrs-0003kU-LI; Mon, 28 Aug 2023 19:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalro-0003hz-OG for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:56 -0400 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrm-0006jc-GV for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:56 -0400 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-34cc0ad6f61so13464095ab.0 for ; Mon, 28 Aug 2023 16:41:54 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266113; x=1693870913; 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; bh=PwFVwEC3aiItv5/cugiAZJ9x7ROCgkBOW62fSEi/E4U=; b=yhPOy3eIn6Qtbvr/4KxFFqqBkejfa2I1uwiA42kPfnY+DG3oYaDXLd6G3xRkV9q/tD KlmGvTQv3g9d5Uwm/8l+U4B5fHt+XpGP2XacJ/fL4xjNb0FmM3UFDRs+RgtmHdqgxEwY gXy9bLGcWxqa3ATL8aO7G4iU1Qt0Kw1cYSEOtq8Brs6nELzshmcvvplVzyXpIhCoPTU3 LOmrH5lNGoar0DthU/vOsxDwu2vRuyihRzNUWM2jWZV5UxCELrqIhnPL/4lClGNa/mPh cPEkoJaIZp2alXm1loghrURY0qZ5Y7Oh3gKOVz22lB3gwJmRGg9iOXfN9YoW7VGqM3U/ sG1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266113; x=1693870913; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PwFVwEC3aiItv5/cugiAZJ9x7ROCgkBOW62fSEi/E4U=; b=IKstrbXmLAiyBrxQPltYikmlAURl0oz6eCDYHqeYmysCXdyTlkern3v+z1GSnQ/L66 ReZGUJobzaQFPljMvuw5CgfSdUKCU2RZRH+n8DRrWGf9NsrOIv5AZWZ9RFZYDI3ZVNZM Ndo5Amm8TaueMMPhAJY8B0dNCIta33LU2nQ+dNVmLA2mxnrNBqmYvYUOj27OsMhF68nv 43yUWIGP94LunE/hRxxEojW+Fo/ZZpQHSd3AkukLIAdXIS0D5EInGTDiqnPxuhLjKNCu kMqyRE2DOi2lNBw8Z9u7KnuZ0bod5DW9s0RfTGoJ/73pZXKwiminWQ4aTPQmyrraEmBd bT3g== X-Gm-Message-State: AOJu0YyQfGeD1h9LLHDcTm11vZHuFu2dSO1WBOKiDNmDmYilE9ACdSUR iX7tl0/Cc1SlzP0V2APeEPX3J1bufOjWV4Hkyds= X-Google-Smtp-Source: AGHT+IHLozdniee7dOXjznCOGGBV5R68VXtxYWsj0adTokD50Ilw/UiTPNRYa8vjhvnhlK+uTEStkA== X-Received: by 2002:a92:505:0:b0:34c:cee5:4bf5 with SMTP id q5-20020a920505000000b0034ccee54bf5mr14999391ile.5.1693266113071; Mon, 28 Aug 2023 16:41:53 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 16/36] bsd-user: Implement h2t_freebsd_fhandle t2h_freebsd_fhandle Date: Mon, 28 Aug 2023 17:38:01 -0600 Message-ID: <20230828233821.43074-17-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::131; envelope-from=imp@bsdimp.com; helo=mail-il1-x131.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, TVD_SPACE_RATIO=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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266357466100001 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the stat conversion functions: h2t_freebsd_fhandle t2h_freebsd_fhandle Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/freebsd/os-stat.c index 8c73f7402c2..6716cee3e22 100644 --- a/bsd-user/freebsd/os-stat.c +++ b/bsd-user/freebsd/os-stat.c @@ -92,3 +92,40 @@ abi_long h2t_freebsd11_nstat(abi_ulong target_addr, return 0; } =20 +/* + * file handle conversion + */ +abi_long t2h_freebsd_fhandle(fhandle_t *host_fh, abi_ulong target_addr) +{ + target_freebsd_fhandle_t *target_fh; + + if (!lock_user_struct(VERIFY_READ, target_fh, target_addr, 1)) { + return -TARGET_EFAULT; + } + __get_user(host_fh->fh_fsid.val[0], &target_fh->fh_fsid.val[0]); + __get_user(host_fh->fh_fsid.val[1], &target_fh->fh_fsid.val[0]); + __get_user(host_fh->fh_fid.fid_len, &target_fh->fh_fid.fid_len); + /* u_short fid_data0; */ + memcpy(host_fh->fh_fid.fid_data, target_fh->fh_fid.fid_data, + TARGET_MAXFIDSZ); + unlock_user_struct(target_fh, target_addr, 0); + return 0; +} + +abi_long h2t_freebsd_fhandle(abi_ulong target_addr, fhandle_t *host_fh) +{ + target_freebsd_fhandle_t *target_fh; + + if (!lock_user_struct(VERIFY_WRITE, target_fh, target_addr, 0)) { + return -TARGET_EFAULT; + } + __put_user(host_fh->fh_fsid.val[0], &target_fh->fh_fsid.val[0]); + __put_user(host_fh->fh_fsid.val[1], &target_fh->fh_fsid.val[0]); + __put_user(host_fh->fh_fid.fid_len, &target_fh->fh_fid.fid_len); + /* u_short fid_data0; */ + memcpy(target_fh->fh_fid.fid_data, host_fh->fh_fid.fid_data, + TARGET_MAXFIDSZ); + unlock_user_struct(target_fh, target_addr, 1); + return 0; +} + --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266269; cv=none; d=zohomail.com; s=zohoarc; b=D4kav09+QbNwyPyhrLE71J9bPFDSdNxVc01Jp5lZZD+uIodc+kgAKFCTXzkanOfsauiE30/urSxEDjay4SokPhtK2Quf76/CoNnqtQv73iq8GnFePv24J2ch3bWm5Wrel7BrtqwQ6u77/nw4GLGKZEe6f0iJjMGofmxap4yTxbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266269; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ahz0nYuBhqMzF4IyHISo9kKm5Ghws15NUUh9cgiocLs=; b=RCmhetO3eJxlcQLTOPoaxmWGY91eBP6OgEFYnQD04P3Pyn5qOOh5S3cRZdA6wufNSSvVUCnLh1x2OcpCc35ZMyvRVr3pRUVq4LZI3pskg2juQLsQ0M6vx+Ld1eMpfH9yZRLXXD2KoBEu9AWmty7SwGBdRA3ACxc4F280OImadoc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266269848353.8409429307055; Mon, 28 Aug 2023 16:44:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrs-0003kc-O7; Mon, 28 Aug 2023 19:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrp-0003io-JZ for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:58 -0400 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrn-0006jp-9n for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:57 -0400 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7927611c54bso125400039f.2 for ; Mon, 28 Aug 2023 16:41:54 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266114; x=1693870914; 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; bh=ahz0nYuBhqMzF4IyHISo9kKm5Ghws15NUUh9cgiocLs=; b=z6oiQhnqL/WVC2NM0sDy4hCPii1llJ2LrGo7RRoTa9cjPd49WTFTyxQkOFjk7rhcGG N20VfpqxWekAGKXAO7r6wNwaTllohuucl7AVggqhhvtIBjSevpIgcqKtdH94mW4ytGPt nZ3sScLwrx6fFaKtnj30GHJ68+Ovyk5YrUXz0xK7NbHKG0/UzIgKOcI7duRkasYRU90u RanqXzgpRSnuuXJqkJM643d4rGz7uVCT6mODZzamrE2O1OZ+cXUtwj2Z3ur78b7Y/xtw Mr03Txg/ONHQQ2jhjuB7/MdJrzOAWHHHcap6W8sQrq71yNfCz7kv9DJ7t+1/CdoI1TyV Y1jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266114; x=1693870914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ahz0nYuBhqMzF4IyHISo9kKm5Ghws15NUUh9cgiocLs=; b=ZBjx9mtxgMpTqy10j7nrsD6i+7tdHT7RZV0yXVZjC1xH4zhUnmbRt+EFT5/MSV/l9A jg1mFXbMpIBZ6wB3O7+KDQnHouxa+N4nEuWQfzqNsHp4IwUV3Z6OYJLIW5kZ8IUVFYJu NQbhWU5KsAbJe5c+0NeUVSXdK1mjxScnlWzZ+gMWItK1QKUtoRL9z8dNw4Z0mPZikF04 X23NUgOXfsAmb4xwhXSIIIWzoxi4u//Po5HIekyXmA9NakeEFBcb5h5Ucp0I+UQaj2/v 3qkrVITMPTOMVQ5ZXXtNBbEAxquQYaiDcHmYoZsq1pq8GbukYDccA3imtpO0kKbs+sSe RClQ== X-Gm-Message-State: AOJu0YyvsBgfiU40I+qZi1X2ayn17kOzbR3I2qM/fEfpK1hZDdM6M7qY +GUqC4lTrhyEDWj0l5o4IQLEdpuU9ijQSu30l1g= X-Google-Smtp-Source: AGHT+IFsdzhfF23Ukale+lqzvllN9cIyntWOT0apqtBohsiUZhH3WTI5GfUVLORVXR/yuCOIOZ2eEQ== X-Received: by 2002:a05:6e02:1a2e:b0:345:3378:4251 with SMTP id g14-20020a056e021a2e00b0034533784251mr6307879ile.23.1693266113903; Mon, 28 Aug 2023 16:41:53 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 17/36] bsd-user: Implement h2t_freebds11_statfs Date: Mon, 28 Aug 2023 17:38:02 -0600 Message-ID: <20230828233821.43074-18-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.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, TVD_SPACE_RATIO=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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266270599100001 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the stat conversion functions: h2t_freebds11_statfs Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.c | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/freebsd/os-stat.c index 6716cee3e22..9eb01bf6645 100644 --- a/bsd-user/freebsd/os-stat.c +++ b/bsd-user/freebsd/os-stat.c @@ -129,3 +129,44 @@ abi_long h2t_freebsd_fhandle(abi_ulong target_addr, fh= andle_t *host_fh) return 0; } =20 +/* + * file system stat + */ +abi_long h2t_freebsd11_statfs(abi_ulong target_addr, + struct freebsd11_statfs *host_statfs) +{ + struct target_freebsd11_statfs *target_statfs; + + if (!lock_user_struct(VERIFY_WRITE, target_statfs, target_addr, 0)) { + return -TARGET_EFAULT; + } + __put_user(host_statfs->f_version, &target_statfs->f_version); + __put_user(host_statfs->f_type, &target_statfs->f_type); + __put_user(host_statfs->f_flags, &target_statfs->f_flags); + __put_user(host_statfs->f_bsize, &target_statfs->f_bsize); + __put_user(host_statfs->f_iosize, &target_statfs->f_iosize); + __put_user(host_statfs->f_blocks, &target_statfs->f_blocks); + __put_user(host_statfs->f_bfree, &target_statfs->f_bfree); + __put_user(host_statfs->f_bavail, &target_statfs->f_bavail); + __put_user(host_statfs->f_files, &target_statfs->f_files); + __put_user(host_statfs->f_ffree, &target_statfs->f_ffree); + __put_user(host_statfs->f_syncwrites, &target_statfs->f_syncwrites); + __put_user(host_statfs->f_asyncwrites, &target_statfs->f_asyncwrites); + __put_user(host_statfs->f_syncreads, &target_statfs->f_syncreads); + __put_user(host_statfs->f_asyncreads, &target_statfs->f_asyncreads); + /* uint64_t f_spare[10]; */ + __put_user(host_statfs->f_namemax, &target_statfs->f_namemax); + __put_user(host_statfs->f_owner, &target_statfs->f_owner); + __put_user(host_statfs->f_fsid.val[0], &target_statfs->f_fsid.val[0]); + __put_user(host_statfs->f_fsid.val[1], &target_statfs->f_fsid.val[1]); + /* char f_charspace[80]; */ + strncpy(target_statfs->f_fstypename, host_statfs->f_fstypename, + sizeof(target_statfs->f_fstypename)); + strncpy(target_statfs->f_mntfromname, host_statfs->f_mntfromname, + sizeof(target_statfs->f_mntfromname)); + strncpy(target_statfs->f_mntonname, host_statfs->f_mntonname, + sizeof(target_statfs->f_mntonname)); + unlock_user_struct(target_statfs, target_addr, 1); + return 0; +} + --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266252; cv=none; d=zohomail.com; s=zohoarc; b=LWNDoMCS4RjDyTmw/IPIIkkm36EdCBM0GIlNY34B8fOpjD4lwulHZ8ywTyAyY3mOZkkn8AMcaX2yno12aI4SJzdCOt/aDEgVXwezHPLBrR2HAJEdD4AP5aLxIwX99pBRftcctkerD4uEZ7/QDX7CdO9PanfSniDiVTcKAgntw1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266252; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WFs67P4F2+8DZwkOjNHRiidMV7RJJmR/6f17KsE7NYA=; b=Yp/8vJ688kZ8CxKtSn6Hi3sGoTkR6GuznYztLsZ6yI+/KXaGfTrThfaZXIHRzql7OcHsjlouhzEWWPABXrF+ulQqFRcJ0DQtEmJagQV5I/7NfDrAhPMJPUcOAh8y2K1rnfPAARG2cIZpWwqyYehS6zGAuJ+LWbwpRklqb1OCUTU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16932662526461000.748343917424; Mon, 28 Aug 2023 16:44:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrt-0003lG-Ce; Mon, 28 Aug 2023 19:42:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrq-0003j9-PF for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:58 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalro-0006k6-HP for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:58 -0400 Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-34deab8010dso761795ab.3 for ; Mon, 28 Aug 2023 16:41:56 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266115; x=1693870915; 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; bh=WFs67P4F2+8DZwkOjNHRiidMV7RJJmR/6f17KsE7NYA=; b=M5r+DFuzYZqZw0r8/WF5CMRXccpHYygwQYlvL4hzG8+pb6S+mWXAYKxvhmUbomvH/A rsaWEVh0QYiE8jdndPATI77GS6ILc+yGvLiMX0T3IyvWN7/olHziXKVoPmcB/HwXvQ+2 iLbu026MbyjiXxgGqrsNT8fURdXDZ+zvrCqfgD+Hb7C/9a/LTn7dCqTpZ/A95Xe1l7Oc OOlCW3Kf8dDMt5I7swRjX9F0p+Pb+/sLD7gNZqPA2uw5Rdi++CJvLzV8Kx5ILqpGijpK vSeaa1Uub4Metb1a4fiXtXpcyM5G7Ofnz0vnDXFrugGAEtgIZimxUYGFBiTnIWUSLCwy RdRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266115; x=1693870915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WFs67P4F2+8DZwkOjNHRiidMV7RJJmR/6f17KsE7NYA=; b=EjjjItgfJLBX2N8naGXUftoCLTja4TBtvQ+yHzfxklHQXNjXF29Lfuxnu9NCXRP2Px /On46cUCEzbOoW16QC5dRndJYqnOHG9lUEhHERh4Qx3uyh4KQ360K8BimF49sXR6pz8x OX7To1EvNB1m75xcBQclqrBHbq7/JkGvMH7id/ztACs100H3PWirWBjNk10rd7RpbDGU dxN6Qvb/XapqFnrfrYVIeTyI32xZX+ILjeGGBMIJHAK9VT0T1ThGKLOrG80C8Q8D2DU2 wqXvuv4XYUu607JfWAxejgXyqm78ojXAIr12Q+ibw7xYUOGf7gHIwz2sRoesSi6/BFN1 faAw== X-Gm-Message-State: AOJu0YyEStZDAKnteiZnnZLe7mH6jsDmtx3986MSSMCoaDXIpiBsBSrK nLEvqx4GrLGVFproPmbH4uMs+MMLuZKTSSXwbtA= X-Google-Smtp-Source: AGHT+IHH8g609/B719CGmTKCHMgPKgnRQPkHzw7keKKtDapYRSDs8eaOUTYLIPCjdPnrStOLCtfvXQ== X-Received: by 2002:a05:6e02:1b0d:b0:348:ba80:5a37 with SMTP id i13-20020a056e021b0d00b00348ba805a37mr21865958ilv.0.1693266114794; Mon, 28 Aug 2023 16:41:54 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 18/36] bsd-user: Implement target_to_host_fcntl_cmd Date: Mon, 28 Aug 2023 17:38:03 -0600 Message-ID: <20230828233821.43074-19-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12a; envelope-from=imp@bsdimp.com; helo=mail-il1-x12a.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266252884100001 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the stat conversion functions: target_to_host_fcntl_cmd Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/freebsd/os-stat.c index 9eb01bf6645..2ce235d5dae 100644 --- a/bsd-user/freebsd/os-stat.c +++ b/bsd-user/freebsd/os-stat.c @@ -170,3 +170,11 @@ abi_long h2t_freebsd11_statfs(abi_ulong target_addr, return 0; } =20 +/* + * fcntl cmd conversion + */ +abi_long target_to_host_fcntl_cmd(int cmd) +{ + return cmd; +} + --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266199; cv=none; d=zohomail.com; s=zohoarc; b=TtN0rCCLnVbv9Z98c3Pe2SuIM/lcLiswWfAYeYEpeBa8PgHfIIL4PHjQcnQvYvpCSLuCmvRgcLlcS5SGx137AF0Pr2P7FxS+I5NgpoevIwsTaZJO369rVzbff0C2bIYnquqWSAPiOi0loV8pGXphfSyTf/vXnL/moiPZDg1ZUq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266199; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vNhh9+MBHOyqqlgYFbkX8f4P9c6wy/M5jr+0vrvfSDo=; b=JyERu2ZeVKnK45ipE9McpnOYPtKSt8oL4dpFvaym5/FfGcBpZi4NSnpZ53Lr2Bvq5qi5AGcIMRs4XRR3rXCyfWgRPpfmerPU8Enavu5GTCpqQ7jts+G2C5W1Yb+krAv1CQbqncCsW3u5hSPzJg1wSeuU/3AQsjoW/5R1yhC2pLc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266199010942.0286284810792; Mon, 28 Aug 2023 16:43:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrz-0003nj-6N; Mon, 28 Aug 2023 19:42:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrs-0003jw-82 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:00 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrp-0006kG-C3 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:41:59 -0400 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-34cc0ad6f61so13464405ab.0 for ; Mon, 28 Aug 2023 16:41:57 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266116; x=1693870916; 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; bh=vNhh9+MBHOyqqlgYFbkX8f4P9c6wy/M5jr+0vrvfSDo=; b=HcOtgRDvx1x8ZU5Y/BNaqubdpsQrx2DwfkcDXjHBHIal8uQwxzjo8nrk776QzLCtEx FAFZJagMeHdp6twtqW1Boom4y39CTD1i7mBRsA8IY0xhvIsh/bNFd2vHZUoBwFfkCCdO 0ErWSzPuZX4XygCl4PX3DWX5mdHM5jjo5fTCk/gaYDkgQ75XZPBs0Ax6U3Ws7GlGV7a9 yHupuZ++v4aFkM1evAI1UANkUDODlYRAZA6NfKuR8/0f7m0exmySc0oaXYRwjxyZVM+J CKpqrmSBVUvrrDsw2/C+c/L+WAZPHkcKl3+QtX4iSi+oMcF/Rrml46zFF1zoZyq/xg6t 6IFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266116; x=1693870916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vNhh9+MBHOyqqlgYFbkX8f4P9c6wy/M5jr+0vrvfSDo=; b=LWH1gBS7bk1YHhfV2c3Uu3Qk6o/rA3/tZFKB0gTpDVNS6gASKvPxq0csvPWoLCaQZO OUfDcMx88nypWO/qfgVDgdG4pZYypSwvkT8XMpa00Zh01KLg9Bv/V8QS+Kh2C8bN2jCw mPaRpW7UU0aUTOJMXcEmRcd0AodQRWcKSqoMPyMLyy4/veFgpRW7hwbi4fxMqZZhYhny B2Tdhrimw0kxBXF4BXGIkGVp2oMF2bcgyANsPvhmv5yNHKzZG/291Icjf3Pc31o8Qs4U CyH2MfeeLKsDb4ImhHTbSpWed0CnUJqzOotCvRA+jy3AmAkiFkudsCbDMu3e52NMsUXH swWQ== X-Gm-Message-State: AOJu0YwMle2nJh2G93FyR7aTWndyb+NnK+ijBVqvnjzFaMrySoA5JSDs 93nHD0dfKYTBQo2XPZPFo9KPYuPuh2VtWSbvjsA= X-Google-Smtp-Source: AGHT+IHPZz3R/crxK4s7CcqurxjWl8KABd+QYsly64Inec8nAnSsKSjszJLLFvsminUEX2PIA6oOKQ== X-Received: by 2002:a05:6e02:2198:b0:34c:e84b:4c5d with SMTP id j24-20020a056e02219800b0034ce84b4c5dmr9961592ila.26.1693266115965; Mon, 28 Aug 2023 16:41:55 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Karim Taha , Richard Henderson Subject: [PULL 19/36] bsd-uesr: Implement h2t_freebsd_stat and h2t_freebsd_statfs functions Date: Mon, 28 Aug 2023 17:38:04 -0600 Message-ID: <20230828233821.43074-20-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::134; envelope-from=imp@bsdimp.com; helo=mail-il1-x134.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266199525100005 Content-Type: text/plain; charset="utf-8" From: Michal Meloun They are the 64-bit variants of h2t_freebsd11_stat and h2t_freebsd11_statfs, respectively Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.c | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/bsd-user/freebsd/os-stat.c b/bsd-user/freebsd/os-stat.c index 2ce235d5dae..f0f9e609c3b 100644 --- a/bsd-user/freebsd/os-stat.c +++ b/bsd-user/freebsd/os-stat.c @@ -58,6 +58,50 @@ abi_long h2t_freebsd11_stat(abi_ulong target_addr, return 0; } =20 +abi_long h2t_freebsd_stat(abi_ulong target_addr, + struct stat *host_st) +{ + struct target_stat *target_st; + + if (!lock_user_struct(VERIFY_WRITE, target_st, target_addr, 0)) { + return -TARGET_EFAULT; + } + memset(target_st, 0, sizeof(*target_st)); + __put_user(host_st->st_dev, &target_st->st_dev); + __put_user(host_st->st_ino, &target_st->st_ino); + __put_user(host_st->st_nlink, &target_st->st_nlink); + __put_user(host_st->st_mode, &target_st->st_mode); + __put_user(host_st->st_uid, &target_st->st_uid); + __put_user(host_st->st_gid, &target_st->st_gid); + __put_user(host_st->st_rdev, &target_st->st_rdev); + __put_user(host_st->st_atim.tv_sec, &target_st->st_atim.tv_sec); + __put_user(host_st->st_atim.tv_nsec, &target_st->st_atim.tv_nsec); +#ifdef TARGET_HAS_STAT_TIME_T_EXT +/* __put_user(host_st->st_mtim_ext, &target_st->st_mtim_ext); XXX */ +#endif + __put_user(host_st->st_mtim.tv_sec, &target_st->st_mtim.tv_sec); + __put_user(host_st->st_mtim.tv_nsec, &target_st->st_mtim.tv_nsec); +#ifdef TARGET_HAS_STAT_TIME_T_EXT +/* __put_user(host_st->st_ctim_ext, &target_st->st_ctim_ext); XXX */ +#endif + __put_user(host_st->st_ctim.tv_sec, &target_st->st_ctim.tv_sec); + __put_user(host_st->st_ctim.tv_nsec, &target_st->st_ctim.tv_nsec); +#ifdef TARGET_HAS_STAT_TIME_T_EXT +/* __put_user(host_st->st_birthtim_ext, &target_st->st_birthtim_ext); X= XX */ +#endif + __put_user(host_st->st_birthtim.tv_sec, &target_st->st_birthtim.tv_sec= ); + __put_user(host_st->st_birthtim.tv_nsec, &target_st->st_birthtim.tv_ns= ec); + + __put_user(host_st->st_size, &target_st->st_size); + __put_user(host_st->st_blocks, &target_st->st_blocks); + __put_user(host_st->st_blksize, &target_st->st_blksize); + __put_user(host_st->st_flags, &target_st->st_flags); + __put_user(host_st->st_gen, &target_st->st_gen); + unlock_user_struct(target_st, target_addr, 1); + + return 0; +} + abi_long h2t_freebsd11_nstat(abi_ulong target_addr, struct freebsd11_stat *host_st) { @@ -170,6 +214,44 @@ abi_long h2t_freebsd11_statfs(abi_ulong target_addr, return 0; } =20 +abi_long h2t_freebsd_statfs(abi_ulong target_addr, + struct statfs *host_statfs) +{ + struct target_statfs *target_statfs; + + if (!lock_user_struct(VERIFY_WRITE, target_statfs, target_addr, 0)) { + return -TARGET_EFAULT; + } + __put_user(host_statfs->f_version, &target_statfs->f_version); + __put_user(host_statfs->f_type, &target_statfs->f_type); + __put_user(host_statfs->f_flags, &target_statfs->f_flags); + __put_user(host_statfs->f_bsize, &target_statfs->f_bsize); + __put_user(host_statfs->f_iosize, &target_statfs->f_iosize); + __put_user(host_statfs->f_blocks, &target_statfs->f_blocks); + __put_user(host_statfs->f_bfree, &target_statfs->f_bfree); + __put_user(host_statfs->f_bavail, &target_statfs->f_bavail); + __put_user(host_statfs->f_files, &target_statfs->f_files); + __put_user(host_statfs->f_ffree, &target_statfs->f_ffree); + __put_user(host_statfs->f_syncwrites, &target_statfs->f_syncwrites); + __put_user(host_statfs->f_asyncwrites, &target_statfs->f_asyncwrites); + __put_user(host_statfs->f_syncreads, &target_statfs->f_syncreads); + __put_user(host_statfs->f_asyncreads, &target_statfs->f_asyncreads); + /* uint64_t f_spare[10]; */ + __put_user(host_statfs->f_namemax, &target_statfs->f_namemax); + __put_user(host_statfs->f_owner, &target_statfs->f_owner); + __put_user(host_statfs->f_fsid.val[0], &target_statfs->f_fsid.val[0]); + __put_user(host_statfs->f_fsid.val[1], &target_statfs->f_fsid.val[1]); + /* char f_charspace[80]; */ + strncpy(target_statfs->f_fstypename, host_statfs->f_fstypename, + sizeof(target_statfs->f_fstypename)); + strncpy(target_statfs->f_mntfromname, host_statfs->f_mntfromname, + sizeof(target_statfs->f_mntfromname)); + strncpy(target_statfs->f_mntonname, host_statfs->f_mntonname, + sizeof(target_statfs->f_mntonname)); + unlock_user_struct(target_statfs, target_addr, 1); + return 0; +} + /* * fcntl cmd conversion */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266255; cv=none; d=zohomail.com; s=zohoarc; b=JlsGRKKDL+HbA8BIkSp9/srd0N7NiFYeH7YOjAjohjLMPawsiNuS+iHJ/GybijssCnRR4iHH4H40Ztbl8z0nPiKREhcNJXcRo8t+w8HdlF9k5dqJIbZeJBteN36Md5A1UjAM8Vr6gExPUlRcMugsZpDb8xqPXETjt7UnmuJH8Cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266255; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xbJD17By5G8l1NVxB3u7W0fI1sN/049DHukEFpqYia8=; b=hYpraGz+2M/IAAm0eKc0ehVqj29zAM/cEwxp9WjTg6nzGbQeiOQT4TsFKpLBfWdp4FehQ+ug0mjZmiXI35lJowzXaYGTg4cwDXGokqWSJP8608u0cWkQfbwnFMqacOU8FkvNwEu6EBofwNGy9VN421xqHvVx8VhwmDLDZFt4T40= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266255606422.6940570215944; Mon, 28 Aug 2023 16:44:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrv-0003ml-5k; Mon, 28 Aug 2023 19:42:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrt-0003lJ-Ei for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:01 -0400 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrq-0006kW-IA for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:01 -0400 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-79275d86bc3so137592239f.0 for ; Mon, 28 Aug 2023 16:41:57 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266117; x=1693870917; 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; bh=xbJD17By5G8l1NVxB3u7W0fI1sN/049DHukEFpqYia8=; b=uZXbwp4xJjfxjy3hVE9MmIw40HSjIXNJx/8OFWbl2tWah5G6PuNOkc5vG1e04Ffh15 oXpNquvHU63GLZf5q5V8ovVa3fHsMGXqtAEcLNyTrYlhzpfyZWZqiZ6Bpqe5XZ2xlNcA vhPDHQVKKXEMqAyiL5+oHZoUzsIeMLBM4j2m5vUmAwvjwUwL0kSvkPBuwCwZzcpAVMV0 sWAL2FgYGTRgsUYZEQFFO718YBp3BmOvYFXLMkwNwcDRcfa6KhVNGNx85qGD8H0w+OPT 0eXeQRya3f6WNd8lHbjxCxv5gyjLxChukQ9/5RhLVEEEnx+t4+kK4/q1SeNsc8CzmngH B/Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266117; x=1693870917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xbJD17By5G8l1NVxB3u7W0fI1sN/049DHukEFpqYia8=; b=C7SiEXqMgDgDttTPd0LeSJVXdRS/ebEul5/Gu5HrkchQonYN5jZfBDEs+/01AFELaF N2rvnJ5LJONIAP4rTIsOV7+kS0hj+EI5bVjEUsXH1azAaBKRZaBkraDbtvJznzUTy/DH eKkCELBaV+Hde3NCiV9WIkwACyrDo+e+61+CU7RCb451m1rxXzxshzeJNJ7iMJb0CADI Np0Q/rp14rq+2jg9cucWGqWqAN3V9LqOSA87IAueWlmv3YAA6iezn8soQsZL88LIqhrE a3Il97eVe6MYhrTjd3lebKzbW5GECrEEix3XR0gPhRgT3kxdXG7dr2t6s1cck2+PO42z TqOA== X-Gm-Message-State: AOJu0YxjU9i5K0IXXmdqQuUu/ZxMzoievGSZ9/t96izv8528qnY6iQSE 11B8EmbmjscjcwPH22kmkxjlyVuJEn2It2xTcrE= X-Google-Smtp-Source: AGHT+IFhocWTAI6wkXuytXOeACMZynnNJv/yoe9N6UNdyVGUQTpyDdGSOaYQ2r0+IqpE935jIghxmg== X-Received: by 2002:a05:6e02:13cc:b0:349:92d4:bfed with SMTP id v12-20020a056e0213cc00b0034992d4bfedmr15794350ilj.18.1693266116773; Mon, 28 Aug 2023 16:41:56 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 20/36] bsd-user: Implement stat related syscalls Date: Mon, 28 Aug 2023 17:38:05 -0600 Message-ID: <20230828233821.43074-21-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2a; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2a.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266256926100015 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the following syscalls: stat(2) lstat(2) fstat(2) fstatat(2) nstat nfstat nlstat Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 130 +++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 bsd-user/freebsd/os-stat.h diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h new file mode 100644 index 00000000000..f8f99b4a723 --- /dev/null +++ b/bsd-user/freebsd/os-stat.h @@ -0,0 +1,130 @@ +/* + * stat related system call shims 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 BSD_USER_FREEBSD_OS_STAT_H +#define BSD_USER_FREEBSD_OS_STAT_H + +/* stat(2) */ +static inline abi_long do_freebsd11_stat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + struct freebsd11_stat st; + + LOCK_PATH(p, arg1); + ret =3D get_errno(freebsd11_stat(path(p), &st)); + UNLOCK_PATH(p, arg1); + if (!is_error(ret)) { + ret =3D h2t_freebsd11_stat(arg2, &st); + } + return ret; +} + +/* lstat(2) */ +static inline abi_long do_freebsd11_lstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + struct freebsd11_stat st; + + LOCK_PATH(p, arg1); + ret =3D get_errno(freebsd11_lstat(path(p), &st)); + UNLOCK_PATH(p, arg1); + if (!is_error(ret)) { + ret =3D h2t_freebsd11_stat(arg2, &st); + } + return ret; +} + +/* fstat(2) */ +static inline abi_long do_freebsd_fstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + struct stat st; + + ret =3D get_errno(fstat(arg1, &st)); + if (!is_error(ret)) { + ret =3D h2t_freebsd_stat(arg2, &st); + } + return ret; +} + +/* fstatat(2) */ +static inline abi_long do_freebsd_fstatat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4) +{ + abi_long ret; + void *p; + struct stat st; + + LOCK_PATH(p, arg2); + ret =3D get_errno(fstatat(arg1, p, &st, arg4)); + UNLOCK_PATH(p, arg2); + if (!is_error(ret) && arg3) { + ret =3D h2t_freebsd_stat(arg3, &st); + } + return ret; +} + +/* undocummented nstat(char *path, struct nstat *ub) syscall */ +static abi_long do_freebsd11_nstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + struct freebsd11_stat st; + + LOCK_PATH(p, arg1); + ret =3D get_errno(freebsd11_nstat(path(p), &st)); + UNLOCK_PATH(p, arg1); + if (!is_error(ret)) { + ret =3D h2t_freebsd11_nstat(arg2, &st); + } + return ret; +} + +/* undocummented nfstat(int fd, struct nstat *sb) syscall */ +static abi_long do_freebsd11_nfstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + struct freebsd11_stat st; + + ret =3D get_errno(freebsd11_nfstat(arg1, &st)); + if (!is_error(ret)) { + ret =3D h2t_freebsd11_nstat(arg2, &st); + } + return ret; +} + +/* undocummented nlstat(char *path, struct nstat *ub) syscall */ +static abi_long do_freebsd11_nlstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + struct freebsd11_stat st; + + LOCK_PATH(p, arg1); + ret =3D get_errno(freebsd11_nlstat(path(p), &st)); + UNLOCK_PATH(p, arg1); + if (!is_error(ret)) { + ret =3D h2t_freebsd11_nstat(arg2, &st); + } + return ret; +} + +#endif /* BSD_USER_FREEBSD_OS_STAT_H */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266259; cv=none; d=zohomail.com; s=zohoarc; b=gKXRXHl6DEU2xEAaJcEhpmNGf2xSRGUhF8ex++EU30cV9FUcvzMVb0Q1PRb/UxEGlYUdL3ouA0DUCclqt50m1mlmP168Yw2U11suPOPY3uWexOHPDJ+aa5XpGB3lpymrWaOOdBhhGkpflY1qlcg1VFP+g8EKT/ARQ5SwbBVZaVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266259; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=js5uGTNiL5OfrpH4rvtEP/KDQaXnj1Ew+khBSJh9KNc=; b=LVq6uAdXhscKowhUlt9DPIQY0dhni14RfylVv3mroSxJpEA9bEyiH6j1RfOjVxnDO84Sq5jNqwRIEGHkwoyqhRSa1WFIw6GtrOS6rC9WrMuwQ+qWatqtvMqFqS2TWwUuD3SkMxubkohiwc7i22Q/hhRdEKOFxtZuBdwwzXRSZT8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266259479588.2649525306421; Mon, 28 Aug 2023 16:44:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsI-0003sC-NW; Mon, 28 Aug 2023 19:42:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrt-0003lI-EZ for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:01 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrq-0006kf-Tm for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:01 -0400 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-34992fd567bso9188545ab.1 for ; Mon, 28 Aug 2023 16:41:58 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266117; x=1693870917; 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; bh=js5uGTNiL5OfrpH4rvtEP/KDQaXnj1Ew+khBSJh9KNc=; b=q2IfnPHWJjq5kLUeYbxkHAYNUVe9SrgL4/OvTHTkF7psvNK7LCuwte6y9zBuCUl5ji 1CBf81hzwryx1zXS5NJgP2Nj70Qkxh6rlA+rQin5OfrhhCCwMkSSWG4j3RjjsA+T/wIh 6sd00rk4yEH9NFGk296eUAM8hHZ062iEUc/L9tpEN27ELk4+rkiT93v4LSZvn89FXbt/ iRWHvnKa76Ld9RW8EaTY1oQhrJlnGewFoNXnX/Mr+jhg0s2Q90AQkffN5MaIQNu4VFYb bFrignfLCwTKuGO1MePYCRpIYcIQVrZvYDU9iqCJn9Gm4wcWzdzLp0BLlDHKgbZPtASe soEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266117; x=1693870917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=js5uGTNiL5OfrpH4rvtEP/KDQaXnj1Ew+khBSJh9KNc=; b=Vki9C0K6iiHCERfaGZOPdnxyhDJc7xgHYWRd9tts0y9dYvGNbJXExOXJRzdVDZhIfP kodIgtwI4fMV8tKbgzwo96qXe+ER4av8wDR4y9hPJrbdWI0EIumeuW5Pd8qZFdIX7kl7 od9rynGxf/EXIDlLBPLlwRVH0+023Oe3RxYMZguhGPDm2GiT2SHVhlRANgNnkNqkMihH 3gVS5oZUGEFKrE7JThtZxI/P9u/qA87vdGOJAG8aCtnFQolQzTlnp8eDCoew8OA5Pm4Y tEq1lKJD9xGX4hPI9q5urcdFi0jTCUpY8Hkfs5xhtAixA4wr+gV5yPqrCPT2EhlCdkAn N/JQ== X-Gm-Message-State: AOJu0Yz/+VOSsn94tR0IKdFx9/mMqlzi2tpTW/3Sq2D/uOQEPYXVsrFp lj7vDxQsxW0KWUMUfDG9iqt75TMN3rVUF4Uf1BA= X-Google-Smtp-Source: AGHT+IGhTk7rdbR0atqNqbDDSY7QlaWAgDkymosblAywPMC29EJjPwix+VJ3/gdIc9ur6N9JlKsmPQ== X-Received: by 2002:a05:6e02:2184:b0:348:b07e:fdac with SMTP id j4-20020a056e02218400b00348b07efdacmr1175383ila.3.1693266117513; Mon, 28 Aug 2023 16:41:57 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 21/36] bsd-user: Implement statfh related syscalls Date: Mon, 28 Aug 2023 17:38:06 -0600 Message-ID: <20230828233821.43074-22-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12d; envelope-from=imp@bsdimp.com; helo=mail-il1-x12d.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266261669100007 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the following syscalls: getfh(2) lgetfh(2) fhopen(2) fhstat(2) fhstatfs(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index f8f99b4a723..935663c0713 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -127,4 +127,87 @@ static abi_long do_freebsd11_nlstat(abi_long arg1, abi= _long arg2) return ret; } =20 +/* getfh(2) */ +static abi_long do_freebsd_getfh(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + fhandle_t host_fh; + + LOCK_PATH(p, arg1); + ret =3D get_errno(getfh(path(p), &host_fh)); + UNLOCK_PATH(p, arg1); + if (is_error(ret)) { + return ret; + } + return h2t_freebsd_fhandle(arg2, &host_fh); +} + +/* lgetfh(2) */ +static inline abi_long do_freebsd_lgetfh(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + fhandle_t host_fh; + + LOCK_PATH(p, arg1); + ret =3D get_errno(lgetfh(path(p), &host_fh)); + UNLOCK_PATH(p, arg1); + if (is_error(ret)) { + return ret; + } + return h2t_freebsd_fhandle(arg2, &host_fh); +} + +/* fhopen(2) */ +static inline abi_long do_freebsd_fhopen(abi_long arg1, abi_long arg2) +{ + abi_long ret; + fhandle_t host_fh; + + ret =3D t2h_freebsd_fhandle(&host_fh, arg1); + if (is_error(ret)) { + return ret; + } + + return get_errno(fhopen(&host_fh, arg2)); +} + +/* fhstat(2) */ +static inline abi_long do_freebsd_fhstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + fhandle_t host_fh; + struct stat host_sb; + + ret =3D t2h_freebsd_fhandle(&host_fh, arg1); + if (is_error(ret)) { + return ret; + } + ret =3D get_errno(fhstat(&host_fh, &host_sb)); + if (is_error(ret)) { + return ret; + } + return h2t_freebsd_stat(arg2, &host_sb); +} + +/* fhstatfs(2) */ +static inline abi_long do_freebsd_fhstatfs(abi_ulong target_fhp_addr, + abi_ulong target_stfs_addr) +{ + abi_long ret; + fhandle_t host_fh; + struct statfs host_stfs; + + ret =3D t2h_freebsd_fhandle(&host_fh, target_fhp_addr); + if (is_error(ret)) { + return ret; + } + ret =3D get_errno(fhstatfs(&host_fh, &host_stfs)); + if (is_error(ret)) { + return ret; + } + return h2t_freebsd_statfs(target_stfs_addr, &host_stfs); +} + #endif /* BSD_USER_FREEBSD_OS_STAT_H */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266216; cv=none; d=zohomail.com; s=zohoarc; b=AehB9viJUPwxawqY1pYSPIszmvDPf1XGi4o16uvR1mA8Q5BPQIzuPCWR7BXkdXTfdXdB9EDpHJMSlx+I2VtmlMI7laqWenedAnyarO9vdy8ON0nGrlV80vWwwfLH5gX9hmTHmhvL8//Ukn+VstFguHz3k/F98rQI94O3nDvRfLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266216; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BR5YhtuiGQc8+lAV/Cmy0fJIijItE+RF+CzfrwWn6Ik=; b=L0grefnUze/pIJuNKuWZvt2EUBZI4cls2CtvEDZ59sPSS+jofMGnehzZwHMx2iNiPNqQowf8cG+ev7Ns7MiaTheUzkQ/5pc9zWZlBib3/DvR+xUR03bGAWirnEFH3nTxpNaqtIZxJ7qcjlV+MkkZNI8ku7FvK8CtLYdWEEyCaek= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266216242933.6578733597479; Mon, 28 Aug 2023 16:43:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalrw-0003nF-U9; Mon, 28 Aug 2023 19:42:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalru-0003mb-NT for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:02 -0400 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrs-0006kw-Dt for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:02 -0400 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-34961362f67so11651665ab.0 for ; Mon, 28 Aug 2023 16:41:59 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266119; x=1693870919; 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; bh=BR5YhtuiGQc8+lAV/Cmy0fJIijItE+RF+CzfrwWn6Ik=; b=AR/PeWVdMiuGVgEn9kVUjDJ9TT7R9xXLWODTCSffqP9bAipleaPbQ5FJypviwUsxZE wdyJno9ANQtC+ad9nXS8YuQO955CoyRQiT/n7afeJK5KA48jmYBcoFtdr4goZSdSwWGf vcvqzmj/6q5nZkWQuFZMLDSA4QuVmnUw894C1Qr3CCeATQiq2erElYKhpQn2+785ixe0 mVOOw6ylDvxK77/D4rGzWbZmHfO4zdIUvF82Wo1si03tWAxnlCnhZEHf2SLMx29k80WS u8/xlmkL1MRVPsUzMDMH5eqdMHqe56MY2Y+utosG68f7BLVpvgCwGOvV9W704/KAQVRO sTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266119; x=1693870919; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BR5YhtuiGQc8+lAV/Cmy0fJIijItE+RF+CzfrwWn6Ik=; b=gZv7Dv7ZTpGLEcG/ZDWqPdRWFVTugfP77rrBJwfKQze0d4Wu11H0Kt2Ih76zzBoBDp /xzGBZ9P5NfN7KeocA1UUjeWREBERRXfTR0+b3k1soVO/PgtJTvImiUQthWcGFejJwpr NIinCo40H6iF3mO/X4OQjFaJ7zJjbVTtLbQkHUvLIFQjY9pUJ8Re0yoR5syZg5pFFLrW F909jPTu5RlJylFL04/2U2EatEN81WkYEA0OIPHK3A1Tq8u1t4+IdgyGt06wSpLwNwNN Vhlyl/b2KYdh3iacqCH5/MknRB+lh8a6VBqdtqoAhdv0uBLbduFjI53ROgq/XNekmYNp NjFw== X-Gm-Message-State: AOJu0YwKD+E6Trjasx4dTNW0oedNMJQmAgqOnpSw/5RwFHYIJJWPjSM7 1vjY5KplLRh9myExUNoG0SZjy0r3k4onmU+xvG4= X-Google-Smtp-Source: AGHT+IHJOV+/CohR5v8oBsh5dAU7BirkqhULbuVPJZWlNmd96PbswP/Hb8UQLWc3nS43GPyabBwg9A== X-Received: by 2002:a05:6e02:1102:b0:348:7f18:68be with SMTP id u2-20020a056e02110200b003487f1868bemr1080188ilk.4.1693266118840; Mon, 28 Aug 2023 16:41:58 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 22/36] bsd-user: Implement statfs related syscalls Date: Mon, 28 Aug 2023 17:38:07 -0600 Message-ID: <20230828233821.43074-23-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::133; envelope-from=imp@bsdimp.com; helo=mail-il1-x133.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266216827100002 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the following syscalls: statfs(2) fstatfs(2) getfsstat(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 935663c0713..9492c93c55a 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -210,4 +210,73 @@ static inline abi_long do_freebsd_fhstatfs(abi_ulong t= arget_fhp_addr, return h2t_freebsd_statfs(target_stfs_addr, &host_stfs); } =20 +/* statfs(2) */ +static inline abi_long do_freebsd_statfs(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + struct statfs host_stfs; + + LOCK_PATH(p, arg1); + ret =3D get_errno(statfs(path(p), &host_stfs)); + UNLOCK_PATH(p, arg1); + if (is_error(ret)) { + return ret; + } + + return h2t_freebsd_statfs(arg2, &host_stfs); +} + +/* fstatfs(2) */ +static inline abi_long do_freebsd_fstatfs(abi_long fd, abi_ulong target_ad= dr) +{ + abi_long ret; + struct statfs host_stfs; + + ret =3D get_errno(fstatfs(fd, &host_stfs)); + if (is_error(ret)) { + return ret; + } + + return h2t_freebsd_statfs(target_addr, &host_stfs); +} + +/* getfsstat(2) */ +static inline abi_long do_freebsd_getfsstat(abi_ulong target_addr, + abi_long bufsize, abi_long flags) +{ + abi_long ret; + struct statfs *host_stfs; + int count; + long host_bufsize; + + count =3D bufsize / sizeof(struct target_statfs); + + /* if user buffer is NULL then return number of mounted FS's */ + if (target_addr =3D=3D 0 || count =3D=3D 0) { + return get_errno(freebsd11_getfsstat(NULL, 0, flags)); + } + + /* XXX check count to be reasonable */ + host_bufsize =3D sizeof(struct statfs) * count; + host_stfs =3D alloca(host_bufsize); + if (!host_stfs) { + return -TARGET_EINVAL; + } + + ret =3D count =3D get_errno(getfsstat(host_stfs, host_bufsize, flags)); + if (is_error(ret)) { + return ret; + } + + while (count--) { + if (h2t_freebsd_statfs((target_addr + + (count * sizeof(struct target_statfs))), + &host_stfs[count])) { + return -TARGET_EFAULT; + } + } + return ret; +} + #endif /* BSD_USER_FREEBSD_OS_STAT_H */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266199; cv=none; d=zohomail.com; s=zohoarc; b=kFS0Km8FGQVx0RL1QK0dHCq5xvqwiy6r1Zdg9LhACE7EivWg1bwkAUzuAVBRg1GMiZe5PKk6z2S3KZvPBQ+mpmX6Iji3fH/G5tWs5oekuXxUJP3t1aZT+CW3pxag+H4sKlmBIIgRhykLX9NDyV71pYCXbtFFlV/VqlKzfZ+vZQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266199; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zii+bXewDYitejvupsp9eZMnhHeSRtYNzFVqXQF7jis=; b=oEHopVnZlCOg2nATCmsipMCK+2mAV9k/xyV4kC85lJzGul1oitOqFGAHUINA679SnHiCHaeTKK16HxIJN9MNzXHd/v0Z+2h0+aQ8Tal7PgQFn7pKMnfPC7BaILDI72SLRThaOp9l0qlejsRjZ0+enVF3h4RZRzYKoWmAdZSchX0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266199532921.3268480706066; Mon, 28 Aug 2023 16:43:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qals1-0003no-57; Mon, 28 Aug 2023 19:42:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrv-0003mo-A2 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:03 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrt-0006lC-1C for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:03 -0400 Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-34ccc0fca24so13757755ab.0 for ; Mon, 28 Aug 2023 16:42:00 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266119; x=1693870919; 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; bh=zii+bXewDYitejvupsp9eZMnhHeSRtYNzFVqXQF7jis=; b=izHmnwP/6KYpQmryTa9aECQdLjdfH61iEUQw6SWJPALn1zmKOGmleQKAOR4BmIBfao zoLRaPxM2CcMIqE/NS6i9SFSCAeVYdTSMV4cNs2h1gzSenJaWOVf824D6yz8gD96O/Rm 1inYSSZHLNvKYMCQkQXD2p0NPxXAhIVjvwiMXMsCbpmluDY1gpE8QF/9elHcZ3/KMD/B q3Qhxp90Ky8q0rcCxTT8j2q/zkgb6CJaFN11LOLSNp1SMNxJPq9AjJmmpJ5nFPjzf1SG cXhBxLcpzMjV3LXAJODICgIlLLHbrCImHjnEY6cgEF9MB3Re3qSSoRxDqG6y0d/D0LqQ Sgmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266119; x=1693870919; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zii+bXewDYitejvupsp9eZMnhHeSRtYNzFVqXQF7jis=; b=QjDbxhHsPb5wG28OCTHSuo2uA4H2uMJHB9MW7NMPgBItsdyhnSQgcWI8VpY1PwVp6J /z/9ygVnmHlbe081qZsP2L60n0e8PdpVIwvaUMxu6+PrkA6BoiKIWM9ehw3tHpvg40L0 fltr/jiNlMhjhCmg3PexbvOyhX359zH+kPhSk0g3pCobzffu5kaIqeQOWV0zHNMBQYMS Xpa7FN7a+qGsIRsu1BubYQcKJsARCR9HT7H1pUUSEsGk9s1a9Weyz4VEoS9yO+fcts5C eci6A1fi+r9QILfpOFqVsbztSANMq931fi7r5MTkmgWuh04LEbxOa82XTnC2y0WSmem1 nUdw== X-Gm-Message-State: AOJu0YyIMZj+ixcPou+g4aGJZSutoKrQHBA5RfHhBqLOK9NXtTQ9RSdX dvM5tqCvnLZuzTfIeOoRhe4ElicGvE1uG6ODbX8= X-Google-Smtp-Source: AGHT+IHXn+ccytLG5BXJ7LNSRq8Gl9W51hs4IKLA+HIyFs8/Fe3h1IvlX+Ox1GSWSG9X3dLkfVBHKA== X-Received: by 2002:a05:6e02:1a4f:b0:34a:c751:28ca with SMTP id u15-20020a056e021a4f00b0034ac75128camr22227033ilv.15.1693266119646; Mon, 28 Aug 2023 16:41:59 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 23/36] bsd-user: Implement getdents related syscalls Date: Mon, 28 Aug 2023 17:38:08 -0600 Message-ID: <20230828233821.43074-24-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12f; envelope-from=imp@bsdimp.com; helo=mail-il1-x12f.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266200987100018 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the following syscalls: getdents(2) getdirecentries(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 9492c93c55a..7dc41cd0bfe 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -279,4 +279,76 @@ static inline abi_long do_freebsd_getfsstat(abi_ulong = target_addr, return ret; } =20 +/* getdents(2) */ +static inline abi_long do_freebsd11_getdents(abi_long arg1, + abi_ulong arg2, abi_long nbytes) +{ + abi_long ret; + struct freebsd11_dirent *dirp; + + dirp =3D lock_user(VERIFY_WRITE, arg2, nbytes, 0); + if (dirp =3D=3D NULL) { + return -TARGET_EFAULT; + } + ret =3D get_errno(freebsd11_getdents(arg1, (char *)dirp, nbytes)); + if (!is_error(ret)) { + struct freebsd11_dirent *de; + int len =3D ret; + int reclen; + + de =3D dirp; + while (len > 0) { + reclen =3D de->d_reclen; + if (reclen > len) { + return -TARGET_EFAULT; + } + de->d_reclen =3D tswap16(reclen); + de->d_fileno =3D tswap32(de->d_fileno); + len -=3D reclen; + } + } + return ret; +} + +/* getdirecentries(2) */ +static inline abi_long do_freebsd_getdirentries(abi_long arg1, + abi_ulong arg2, abi_long nbytes, abi_ulong arg4) +{ + abi_long ret; + struct dirent *dirp; + long basep; + + dirp =3D lock_user(VERIFY_WRITE, arg2, nbytes, 0); + if (dirp =3D=3D NULL) { + return -TARGET_EFAULT; + } + ret =3D get_errno(getdirentries(arg1, (char *)dirp, nbytes, &basep)); + if (!is_error(ret)) { + struct dirent *de; + int len =3D ret; + int reclen; + + de =3D dirp; + while (len > 0) { + reclen =3D de->d_reclen; + if (reclen > len) { + return -TARGET_EFAULT; + } + de->d_fileno =3D tswap64(de->d_fileno); + de->d_off =3D tswap64(de->d_off); + de->d_reclen =3D tswap16(de->d_reclen); + de->d_namlen =3D tswap16(de->d_namlen); + len -=3D reclen; + de =3D (struct dirent *)((void *)de + reclen); + } + } + unlock_user(dirp, arg2, ret); + if (arg4) { + if (put_user(basep, arg4, abi_ulong)) { + return -TARGET_EFAULT; + } + } + return ret; +} + #endif /* BSD_USER_FREEBSD_OS_STAT_H */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266300; cv=none; d=zohomail.com; s=zohoarc; b=DLd10Mq3f0/1aMyYxr+pPpI2tPdOpdJfFxfW7WATvj7aj/GbKjOPDmsJTObDA0g41WoYNb68PTK27uNkZNipw7APKGB/Rf4EJ4HnUcGfS3Yec2lub8t26zrhPiZDP0HOet8C5Rbdbixva7UHCNZ1JoUR40WdgxdiniJ5rv6M2Ik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266300; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+8KyIPO+6/qtk663eKB4TGmb1eaoTmFby8ULGYDVGqk=; b=OAaLM43IQP8CsLzXtH3JLybuYzW+EzrF4JIKJKpgjmP1eZ/yWMD/F/5h6+WPOL/lZJr6Pt/6MgALqNAl2ar6F+7TmAvE9sF0nA86yzgcqECr9ZmJaI7PrFDlUCFSqDy4wXqaiybXN+dIJ/hA2X/mMNo6tW5wMQnNPsSFQwyMweE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266300257340.5964637678625; Mon, 28 Aug 2023 16:45:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsD-0003q2-Sy; Mon, 28 Aug 2023 19:42:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalrv-0003n0-UP for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:04 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrt-0006lL-MG for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:03 -0400 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-34cc0ad6f61so13464535ab.0 for ; Mon, 28 Aug 2023 16:42:01 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266120; x=1693870920; 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; bh=+8KyIPO+6/qtk663eKB4TGmb1eaoTmFby8ULGYDVGqk=; b=tgC+PLKHG5w/kNJ5TdB5EfNO8uESu60yTkhcU0svBOWzSNu3tJN+rs1Y23bo33m9Rv 8VTix1wWC6eawF5HLXurkzUA6gs6oLDFUguNfNSAvgTdqIRg7dthIxrba0Bu4xqiQJ0k 9dacGz19xln59358J7Jft7VSY8l3LGO5ozNETjY3IxYOIaiSuhc3XjCeSY9cttKe4ojf /1w2yaInLSnXbAbV7joqLuW/wQWVtUGGoid97r8MJfS8FAmN0KCDiXiWOhQ/+xaLRlxP nFCM1kuyFORijgoHWxO+sZt3C1P7ManEDWcxBrgLwzJmKvKSICbveb72GZxp2qER4+8Y 2MBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266120; x=1693870920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+8KyIPO+6/qtk663eKB4TGmb1eaoTmFby8ULGYDVGqk=; b=dNDKUzwk1j2xUeOGp0m7nJ+S244VqV2W4gxAXtLTRQxrzqp+H/mqw3vndRrf+dI3ve UL5xCWXdFUcB+KkhsXp3zsuHb0qH16p9yUcCViry72WrFAnvO/G9ikwODBTQ2G+7kGMK ZBx+OL8OdA/QFV7AOzvP2jP/KMXCuYBMwfSSDSvVj1OEJJJVpyYx2DzmjtiLEMJWahoE tPU1602ZGgewS2UjnHTCvnZ9lNOvtpDkcYJ/0ND9bKBszFh9rIGFt0yootL147uta1va nkMLTyoJeoXUjKF4umVR8hZXhyvXGYkphOEXUhKA+8rwE0/K1N4F8qXvUvnXc4koOTjl /fGg== X-Gm-Message-State: AOJu0Yw+4i+dmxbJfzjQvCRb+UGpa406ELVylSX7ZZQFiIcsmImVgbVp a6JUelh0jdEE2ZhpUa/QNSkmAwhvehXm59rQKVA= X-Google-Smtp-Source: AGHT+IHoWwjmGkhiXcKoPEWJbxvir3H9s3RPTyXPxccs+2h9iTA3AGIVtEFfvw0krD84pywy8TIALw== X-Received: by 2002:a05:6e02:1c28:b0:345:df7f:efc4 with SMTP id m8-20020a056e021c2800b00345df7fefc4mr19515994ilh.27.1693266120462; Mon, 28 Aug 2023 16:42:00 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 24/36] bsd-user: Implement stat related syscalls Date: Mon, 28 Aug 2023 17:38:09 -0600 Message-ID: <20230828233821.43074-25-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::135; envelope-from=imp@bsdimp.com; helo=mail-il1-x135.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266300729100005 Content-Type: text/plain; charset="utf-8" From: Stacey Son Implement the following syscalls: fcntl(2) Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 74 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 7dc41cd0bfe..5d9323c7d1b 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -351,4 +351,78 @@ static inline abi_long do_freebsd_getdirentries(abi_lo= ng arg1, return ret; } =20 +/* fcntl(2) */ +static inline abi_long do_freebsd_fcntl(abi_long arg1, abi_long arg2, + abi_ulong arg3) +{ + abi_long ret; + int host_cmd; + struct flock fl; + struct target_freebsd_flock *target_fl; + + host_cmd =3D target_to_host_fcntl_cmd(arg2); + if (host_cmd < 0) { + return host_cmd; + } + switch (arg2) { + case TARGET_F_GETLK: + if (!lock_user_struct(VERIFY_READ, target_fl, arg3, 1)) { + return -TARGET_EFAULT; + } + __get_user(fl.l_type, &target_fl->l_type); + __get_user(fl.l_whence, &target_fl->l_whence); + __get_user(fl.l_start, &target_fl->l_start); + __get_user(fl.l_len, &target_fl->l_len); + __get_user(fl.l_pid, &target_fl->l_pid); + __get_user(fl.l_sysid, &target_fl->l_sysid); + unlock_user_struct(target_fl, arg3, 0); + ret =3D get_errno(safe_fcntl(arg1, host_cmd, &fl)); + if (!is_error(ret)) { + if (!lock_user_struct(VERIFY_WRITE, target_fl, arg3, 0)) { + return -TARGET_EFAULT; + } + __put_user(fl.l_type, &target_fl->l_type); + __put_user(fl.l_whence, &target_fl->l_whence); + __put_user(fl.l_start, &target_fl->l_start); + __put_user(fl.l_len, &target_fl->l_len); + __put_user(fl.l_pid, &target_fl->l_pid); + __put_user(fl.l_sysid, &target_fl->l_sysid); + unlock_user_struct(target_fl, arg3, 1); + } + break; + + case TARGET_F_SETLK: + case TARGET_F_SETLKW: + if (!lock_user_struct(VERIFY_READ, target_fl, arg3, 1)) { + return -TARGET_EFAULT; + } + __get_user(fl.l_type, &target_fl->l_type); + __get_user(fl.l_whence, &target_fl->l_whence); + __get_user(fl.l_start, &target_fl->l_start); + __get_user(fl.l_len, &target_fl->l_len); + __get_user(fl.l_pid, &target_fl->l_pid); + __get_user(fl.l_sysid, &target_fl->l_sysid); + unlock_user_struct(target_fl, arg3, 0); + ret =3D get_errno(safe_fcntl(arg1, host_cmd, &fl)); + break; + + case TARGET_F_DUPFD: + case TARGET_F_DUP2FD: + case TARGET_F_GETOWN: + case TARGET_F_SETOWN: + case TARGET_F_GETFD: + case TARGET_F_SETFD: + case TARGET_F_GETFL: + case TARGET_F_SETFL: + case TARGET_F_READAHEAD: + case TARGET_F_RDAHEAD: + case TARGET_F_ADD_SEALS: + case TARGET_F_GET_SEALS: + default: + ret =3D get_errno(safe_fcntl(arg1, host_cmd, arg3)); + break; + } + return ret; +} + #endif /* BSD_USER_FREEBSD_OS_STAT_H */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266215; cv=none; d=zohomail.com; s=zohoarc; b=RL6A8S5IwEwm8mE14wl4GjvaLU1YQ/9sfoseXiAuRtsxP7tlTJVvDUhhbrqKwMllZ7KJ+5zpnwP1Jxdcysw8rdDhLnsnjaFAXd9QIGvCiJH59K36KyMgCrxKhUd+yuRmoz/VNZ3norathY3MiyLoHv18Jh/8bBw1ruy4byKnWJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266215; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NkCIF/cz1CORecgJNpP6wmYIklfZQzDUYN6XXFugEHQ=; b=n94Lwi/bPL8pnjYv/xlv6eauiDRN2eMXco0DBcxVEj2Nuu/eRJWNysrEGMQQg0J+CfKFSBIDSReQeCaG6KkseQDDhjDkkzcpwTjcNK9Ayq80UZMGl5z31zGXaaYiLHkuMSIPQGRPgV16DDPODC6U1q95A9rU9i52hNAh3LrC09s= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266215228880.401508527017; Mon, 28 Aug 2023 16:43:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsN-0003uR-4z; Mon, 28 Aug 2023 19:42:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qals7-0003oq-5e for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:15 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalru-0006lc-K3 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:04 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-34bae82b2ffso12430775ab.1 for ; Mon, 28 Aug 2023 16:42:02 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266121; x=1693870921; 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; bh=NkCIF/cz1CORecgJNpP6wmYIklfZQzDUYN6XXFugEHQ=; b=o5jOoKSlVrqNJIrdIhw5gEyIv8hv15MWfL7jQHMbEWe085SwbHLJNrjwofg4ZIXtbp E3XJf66S8bMbHX3npP4L3rvalJ/JmdXCgSPIbLj3N0IYliiMU7hSDBzW1bpotfrjYl/W PbppR6zgUDCtW/m3Zl89RxVljetpazFd8zjSv0IRD3jxfyerLFpBDouW2DoRQ31/3AyV kePPpqSw3htxoc0Yj7NJnO3FZMpR6WGrsVfvBxdiBlE4TeHKYoagWH6y+ad9dWZMrLKG hjIUYt1pmJp/cK4rvHRfsKY2EhzWjsrKjGZ99/JK7glqz8XN7ew9jM1ytklu1c9imQhw AmeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266121; x=1693870921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NkCIF/cz1CORecgJNpP6wmYIklfZQzDUYN6XXFugEHQ=; b=RYcD+gg5r1yBjqy/m1/tpMvWuVxge0Ieu5CyJnwiBzEGoizX/l5a7C2voSDn44sgIQ kM/m6rbzqsZTLoMhjl6LixTObeR2mQJLd0taCK75V4QzFA1vw0sNHv92de6fn1030FBJ +LfuUHdZnDwPCFB6VlONgNhlNWDm3gsJFgGIkqWaTrBdgiYd4BlEEfzAY8Dgxb+Knxfy 9qgzjyY7B3cHdP7pkr852otRbKvP6RudjMjaQZBxd9owjvugcpy9j6H6J6mHkNU1mtUm c/XmDNoEXZKjNnLsA7HDghgepEMsedk00XJ+gMrpNmlEP3pCmqM6/7tn2OX//Ktl6fY/ mUHQ== X-Gm-Message-State: AOJu0YyOSKznc7K2LUd2YpbKsOq5FMWbtUP1x9jetbvCy5lqwoINCzwD FJoVjcSSpoAf/aIDocOBws60+zlQWcCcjJapoD0= X-Google-Smtp-Source: AGHT+IFOFC+cD0M0EczcX+SpaF8frUmCm68JTBV3lhBInwYtExlSgHjRmJwPh95QuBO836ReBO8Fpw== X-Received: by 2002:a05:6e02:144f:b0:348:797d:a94e with SMTP id p15-20020a056e02144f00b00348797da94emr20692590ilo.2.1693266121323; Mon, 28 Aug 2023 16:42:01 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 25/36] bsd-user: Implement freebsd11 stat related syscalls Date: Mon, 28 Aug 2023 17:38:10 -0600 Message-ID: <20230828233821.43074-26-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266217035100005 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Rename the following syscalls to the freebsd11 variant: do_freebsd_lstat -> do_freebsd11_lstat do_freebsd_stat -> do_freebsd11_stat Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 5d9323c7d1b..aef55c8bb53 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -20,6 +20,11 @@ #ifndef BSD_USER_FREEBSD_OS_STAT_H #define BSD_USER_FREEBSD_OS_STAT_H =20 +int freebsd11_stat(const char *path, struct freebsd11_stat *stat); +__sym_compat(stat, freebsd11_stat, FBSD_1.0); +int freebsd11_lstat(const char *path, struct freebsd11_stat *stat); +__sym_compat(lstat, freebsd11_lstat, FBSD_1.0); + /* stat(2) */ static inline abi_long do_freebsd11_stat(abi_long arg1, abi_long arg2) { --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266234; cv=none; d=zohomail.com; s=zohoarc; b=KmM8x06/K1ahGgp+E3GjkyKeTyy+fLmODNMCqZQYVnxoU8i4806ZP43rWc4bB5h/QPkoEmMK1RzvRP7JdsuqRrqba2IAnfQ0Xo4fvDVPxmJltHI2hHaqQ8H5EtIH7EUs7CL2hgkijZMMT/hnrwsbny0iW2wUAVfWbKJvnFWOQeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266234; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vEJ4yqkPcxV2O/9AHiCAR4WW/EWetmRbNI/78P0DXQM=; b=Kw+/lp2E5FeQa+jTMn36R+Kp8/bK9+qJKhyX4PLAiFtXcCxjR9i/Ho5BYfJJ0CpZDVVBXSOoJWlV+cQyCyNW0rKN5cfLORnpLSaE4E8qTJ7XU4CPqQNrmbfwqWoZnMpqlZslnRZnWHjBV2SvRn+0FgxK4R1cie+b9YyqeOEyt/k= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266234216230.75759877862652; Mon, 28 Aug 2023 16:43:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsK-0003uP-S5; Mon, 28 Aug 2023 19:42:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qals7-0003op-4w for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:15 -0400 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qalrv-0006ln-Ir for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:05 -0400 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-34dea77cbe6so868265ab.2 for ; Mon, 28 Aug 2023 16:42:03 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266122; x=1693870922; 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; bh=vEJ4yqkPcxV2O/9AHiCAR4WW/EWetmRbNI/78P0DXQM=; b=oB4rcYZ90Hlw5DvYlo/Hsiutr4oX3YPVmKvokuXCqFJepWlesxElcAz5rlsmiGy9ZQ p5Iy+hIyXqIIZ11Du5yFRM/yXQoRDgfaE9dWMmEXx/jYIlCzcrz8j2PVPYZuQN8GjN1Y NvoQNUDpZ/FCMVwCQ0YV6iVV9OtWm5XCZMiFyWr9iX5ZsqKwuOnT9Cg64pXaGtCI7+ad AZ6nB7X2H8kLRISxrfriJoGli2mfi/YKA+eyoUfRoHagrVwcaQ0pIkIUXuMH63vpoaWc gaKkaf+coT1Eb+LdlE7JpjUvod6/jJUJ54alNrjhEy3Gfj2RgtuC5SkedpPBVN7VypHM RzSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266122; x=1693870922; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vEJ4yqkPcxV2O/9AHiCAR4WW/EWetmRbNI/78P0DXQM=; b=H8XvyD2UZu4cc/w0SCzgUUPRHBKnsQfqUd74fIP/DCpasb8cfRDVxY7+fdB05X+007 UNCwiKPVcBWAwZTKlgGIGxMIFKsDbdaPo7yiT2yivGOSh/oS9NadPevMbw5Kc4h4l6+F FHLk43k74vi4xKK6jIAY4oBs5U9KVUzcfJ58CDs9PoAOwmLo65baat07ese0uSRQQe8Q 3k+Esgdy6Qlcnhz6J6ZZEECEIiN9JQT6Su25p1ML1jEa7oR0Qz1JawE5d4V2ovCh4UV9 TTOCzZvspEx/aZilGBjeZrDUE63lrfTOYAiYLwjmyYX+EEUlweiTstbcH1hb6SOdUxXn x3gA== X-Gm-Message-State: AOJu0YyNQ4Ml3fM91HXn1NTesUZQiWtlzrOANmQmebxq/F5KXbslXLqt 3OLrRUAHdqWsfnNVuwgqoZ0V6sTyQsxP7U0vY+A= X-Google-Smtp-Source: AGHT+IHW8M083XZPgWZvYazEHB0XbclWznI0JRH7d8seInbyqIvbUSU4JOpULAOZzuc2fjDdc7dd4w== X-Received: by 2002:a05:6e02:dcc:b0:34c:c7c6:d8ed with SMTP id l12-20020a056e020dcc00b0034cc7c6d8edmr15593946ilj.13.1693266122228; Mon, 28 Aug 2023 16:42:02 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 26/36] bsd-user: Implement freebsd11 fstat and fhstat related syscalls Date: Mon, 28 Aug 2023 17:38:11 -0600 Message-ID: <20230828233821.43074-27-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12e; envelope-from=imp@bsdimp.com; helo=mail-il1-x12e.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266235163100003 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Implement the freebsd11 variant of the following syscalls: fstat(2) fstatat(2) fhstat(2) fhstatfs(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 78 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index aef55c8bb53..2e0c7245dfd 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -24,6 +24,17 @@ int freebsd11_stat(const char *path, struct freebsd11_st= at *stat); __sym_compat(stat, freebsd11_stat, FBSD_1.0); int freebsd11_lstat(const char *path, struct freebsd11_stat *stat); __sym_compat(lstat, freebsd11_lstat, FBSD_1.0); +int freebsd11_fstat(int fd, struct freebsd11_stat *stat); +__sym_compat(fstat, freebsd11_fstat, FBSD_1.0); +int freebsd11_fstatat(int fd, const char *path, struct freebsd11_stat *sta= t, + int flag); +__sym_compat(fstatat, freebsd11_fstatat, FBSD_1.1); + +int freebsd11_fhstat(const fhandle_t *fhandle, struct freebsd11_stat *stat= ); +__sym_compat(fhstat, freebsd11_fhstat, FBSD_1.0); +int freebsd11_fhstatfs(const fhandle_t *fhandle, struct freebsd11_statfs *= buf); +__sym_compat(fhstatfs, freebsd11_fhstatfs, FBSD_1.0); +int freebsd11_statfs(const char *path, struct freebsd11_statfs *buf); =20 /* stat(2) */ static inline abi_long do_freebsd11_stat(abi_long arg1, abi_long arg2) @@ -57,6 +68,19 @@ static inline abi_long do_freebsd11_lstat(abi_long arg1,= abi_long arg2) return ret; } =20 +/* fstat(2) */ +static inline abi_long do_freebsd11_fstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + struct freebsd11_stat st; + + ret =3D get_errno(freebsd11_fstat(arg1, &st)); + if (!is_error(ret)) { + ret =3D h2t_freebsd11_stat(arg2, &st); + } + return ret; +} + /* fstat(2) */ static inline abi_long do_freebsd_fstat(abi_long arg1, abi_long arg2) { @@ -70,6 +94,23 @@ static inline abi_long do_freebsd_fstat(abi_long arg1, a= bi_long arg2) return ret; } =20 +/* fstatat(2) */ +static inline abi_long do_freebsd11_fstatat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4) +{ + abi_long ret; + void *p; + struct freebsd11_stat st; + + LOCK_PATH(p, arg2); + ret =3D get_errno(freebsd11_fstatat(arg1, p, &st, arg4)); + UNLOCK_PATH(p, arg2); + if (!is_error(ret) && arg3) { + ret =3D h2t_freebsd11_stat(arg3, &st); + } + return ret; +} + /* fstatat(2) */ static inline abi_long do_freebsd_fstatat(abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4) @@ -178,6 +219,24 @@ static inline abi_long do_freebsd_fhopen(abi_long arg1= , abi_long arg2) return get_errno(fhopen(&host_fh, arg2)); } =20 +/* fhstat(2) */ +static inline abi_long do_freebsd11_fhstat(abi_long arg1, abi_long arg2) +{ + abi_long ret; + fhandle_t host_fh; + struct freebsd11_stat host_sb; + + ret =3D t2h_freebsd_fhandle(&host_fh, arg1); + if (is_error(ret)) { + return ret; + } + ret =3D get_errno(freebsd11_fhstat(&host_fh, &host_sb)); + if (is_error(ret)) { + return ret; + } + return h2t_freebsd11_stat(arg2, &host_sb); +} + /* fhstat(2) */ static inline abi_long do_freebsd_fhstat(abi_long arg1, abi_long arg2) { @@ -196,6 +255,25 @@ static inline abi_long do_freebsd_fhstat(abi_long arg1= , abi_long arg2) return h2t_freebsd_stat(arg2, &host_sb); } =20 +/* fhstatfs(2) */ +static inline abi_long do_freebsd11_fhstatfs(abi_ulong target_fhp_addr, + abi_ulong target_stfs_addr) +{ + abi_long ret; + fhandle_t host_fh; + struct freebsd11_statfs host_stfs; + + ret =3D t2h_freebsd_fhandle(&host_fh, target_fhp_addr); + if (is_error(ret)) { + return ret; + } + ret =3D get_errno(freebsd11_fhstatfs(&host_fh, &host_stfs)); + if (is_error(ret)) { + return ret; + } + return h2t_freebsd11_statfs(target_stfs_addr, &host_stfs); +} + /* fhstatfs(2) */ static inline abi_long do_freebsd_fhstatfs(abi_ulong target_fhp_addr, abi_ulong target_stfs_addr) --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266395; cv=none; d=zohomail.com; s=zohoarc; b=fSM8jhMLoyHgY1FRMLtaz9c9/Y9H7BZwWlqm+Vq87faV/DdvRj0DMp8JvvV/oOEZGSGLpCgMOZtVjcAWdP7eLz/Di/rI+InzrDd/tZJsXAtu0mN5kXXK036zgNGjx7Umdweaf/Nu4hCLmJwPTiywMh5Mw2P6EjkACZAOf/N3qj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266395; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K0W3d2u7rz+/pVZ99RWkIygZtbsFMR+b9Wlcog4VF1M=; b=j9lHQOCXhG/l7qgXLffP7rlfICXyOEKWv39xPE8MR1dXbDcKG2hWjRVoCkVd619Us1jAoTVBodU2XQy3KHsag6INem5w/GA5UUhFsYdC0/iFvQFvWmtoiwnJInCJSkGcVK7VzAkMVhiH9txKfQqWjvJ9gA8/dgtR/nCLwUGSoMs= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266395967291.5309144257744; Mon, 28 Aug 2023 16:46:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsO-0003uf-Pc; Mon, 28 Aug 2023 19:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sb-Eb for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals4-0006mP-11 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:18 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-34bbe9e916cso13113305ab.0 for ; Mon, 28 Aug 2023 16:42:04 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266123; x=1693870923; 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; bh=K0W3d2u7rz+/pVZ99RWkIygZtbsFMR+b9Wlcog4VF1M=; b=ocZbhnk6VtC2ugHu5MFbB/QiDiDlKaKxnPcXsTcQWNNU+a7vn/3TqBV5d0c2Pb9J+o tEDviJEA3sBJXKYQAc68bWxcAShmxVO775PuY7z0AErfYYjMi7YUzk2762b4sTDl7ZLG 4OyaksTlh5NBcbSB8ayFebkFJqjC3jqGaVzbOTGDcJ60QRIBWL7gMLqFfk5opNrl11RC 6h7b/SzwTVcLC8tr9I2mHsCur4ZYRVjfolJRqB758oRbox2P+tQuSoyEjM4myc82ocCr g1YVOvLjVD0yPg+uD+RxmA78aT3dPsZ97C0m6qr445K43I3uimi62Ed4UOY1EGAYI5mK Aasg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266123; x=1693870923; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K0W3d2u7rz+/pVZ99RWkIygZtbsFMR+b9Wlcog4VF1M=; b=cemP/+rwE76YzOZDu8tgRaSNvedDrfGHuhGGohqslR73mfT6KWySwsRAuMpuyuveG/ J0ppg+CcjW1bVYPZvFF3R7fFaE0d0rYbZKfwsJ8LaPdttKf6IH5DOZ3BMfU2WhSOEU+1 zDE4+KCuVXVPCzGRKe4coGpYghGFtYrm2MKSFknN6mBgucQKEIOMTLnMVRujiPk7mfjd x2nZFiAO31R1UdS5bwUQI8PWebWTEpK+6J36TrOiFNM6JDhv+YFFo+6AA+U3jVto7u+D OKbEl/UJMf4pLP6LjVtlm7ze3gsSQPoLRF04WjEghIrzDQ9/AbOeSBcqMZNahM+4H3gg hq6Q== X-Gm-Message-State: AOJu0YwlNqN3lM7dpBuyY8Fx6hgbC8P7+hAwK5A/uh/skDBA+DgWOukC 3toVPjjkc7VSTcCn2SoXoHtY0jwDgz+bZu0tjZo= X-Google-Smtp-Source: AGHT+IHmS/i6d+TgnIGFjBE0N8RLTQK2xvKi/jw0iekhFT7ck8qdE3E4G0jQ3NNqJ+XyNkZk72qhXA== X-Received: by 2002:a05:6e02:1b04:b0:34d:ec00:2ce9 with SMTP id i4-20020a056e021b0400b0034dec002ce9mr173671ilv.26.1693266123165; Mon, 28 Aug 2023 16:42:03 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 27/36] bsd-user: Implement freebsd11 statfs related syscalls Date: Mon, 28 Aug 2023 17:38:12 -0600 Message-ID: <20230828233821.43074-28-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266397960100007 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Implement the freebsd11 variant of the following syscalls: statfs(2) fstatfs(2) getfsstat(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 2e0c7245dfd..04a61fabd11 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -32,9 +32,15 @@ __sym_compat(fstatat, freebsd11_fstatat, FBSD_1.1); =20 int freebsd11_fhstat(const fhandle_t *fhandle, struct freebsd11_stat *stat= ); __sym_compat(fhstat, freebsd11_fhstat, FBSD_1.0); +int freebsd11_getfsstat(struct freebsd11_statfs *buf, long bufsize, int mo= de); +__sym_compat(getfsstat, freebsd11_getfsstat, FBSD_1.0); int freebsd11_fhstatfs(const fhandle_t *fhandle, struct freebsd11_statfs *= buf); __sym_compat(fhstatfs, freebsd11_fhstatfs, FBSD_1.0); int freebsd11_statfs(const char *path, struct freebsd11_statfs *buf); +__sym_compat(statfs, freebsd11_statfs, FBSD_1.0); +int freebsd11_fstatfs(int fd, struct freebsd11_statfs *buf); +__sym_compat(fstatfs, freebsd11_fstatfs, FBSD_1.0); + =20 /* stat(2) */ static inline abi_long do_freebsd11_stat(abi_long arg1, abi_long arg2) @@ -293,6 +299,23 @@ static inline abi_long do_freebsd_fhstatfs(abi_ulong t= arget_fhp_addr, return h2t_freebsd_statfs(target_stfs_addr, &host_stfs); } =20 +/* statfs(2) */ +static inline abi_long do_freebsd11_statfs(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + struct freebsd11_statfs host_stfs; + + LOCK_PATH(p, arg1); + ret =3D get_errno(freebsd11_statfs(path(p), &host_stfs)); + UNLOCK_PATH(p, arg1); + if (is_error(ret)) { + return ret; + } + + return h2t_freebsd11_statfs(arg2, &host_stfs); +} + /* statfs(2) */ static inline abi_long do_freebsd_statfs(abi_long arg1, abi_long arg2) { @@ -310,6 +333,20 @@ static inline abi_long do_freebsd_statfs(abi_long arg1= , abi_long arg2) return h2t_freebsd_statfs(arg2, &host_stfs); } =20 +/* fstatfs(2) */ +static inline abi_long do_freebsd11_fstatfs(abi_long fd, abi_ulong target_= addr) +{ + abi_long ret; + struct freebsd11_statfs host_stfs; + + ret =3D get_errno(freebsd11_fstatfs(fd, &host_stfs)); + if (is_error(ret)) { + return ret; + } + + return h2t_freebsd11_statfs(target_addr, &host_stfs); +} + /* fstatfs(2) */ static inline abi_long do_freebsd_fstatfs(abi_long fd, abi_ulong target_ad= dr) { @@ -324,6 +361,44 @@ static inline abi_long do_freebsd_fstatfs(abi_long fd,= abi_ulong target_addr) return h2t_freebsd_statfs(target_addr, &host_stfs); } =20 +/* getfsstat(2) */ +static inline abi_long do_freebsd11_getfsstat(abi_ulong target_addr, + abi_long bufsize, abi_long flags) +{ + abi_long ret; + struct freebsd11_statfs *host_stfs; + int count; + long host_bufsize; + + count =3D bufsize / sizeof(struct target_freebsd11_statfs); + + /* if user buffer is NULL then return number of mounted FS's */ + if (target_addr =3D=3D 0 || count =3D=3D 0) { + return get_errno(freebsd11_getfsstat(NULL, 0, flags)); + } + + /* XXX check count to be reasonable */ + host_bufsize =3D sizeof(struct freebsd11_statfs) * count; + host_stfs =3D alloca(host_bufsize); + if (!host_stfs) { + return -TARGET_EINVAL; + } + + ret =3D count =3D get_errno(freebsd11_getfsstat(host_stfs, host_bufsiz= e, flags)); + if (is_error(ret)) { + return ret; + } + + while (count--) { + if (h2t_freebsd11_statfs((target_addr + + (count * sizeof(struct target_freebsd11_statfs))), + &host_stfs[count])) { + return -TARGET_EFAULT; + } + } + return ret; +} + /* getfsstat(2) */ static inline abi_long do_freebsd_getfsstat(abi_ulong target_addr, abi_long bufsize, abi_long flags) --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266399; cv=none; d=zohomail.com; s=zohoarc; b=H7BtQSNWPGiZGh1BjNKkuduuQGkGnOstOj7Ye8yosgh6XvCliuq53Ik1MVp4RlezREPEScYs74GyvNPGl55N8ryIcrTrdOh8lNgmqeP/AlnSE3nPLACe36Yn8VwB58aliKMEIlWeAed2KWGTHqde+vKM+V+ZaEwj3S/tahdTqY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266399; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7lV/5XeTX9LnWNklrCPw9QQtEp/5MCYlEuIolAxVmMo=; b=jxeihtjk/6hu61DUuvgaD5fBU/PcXeFeBozAymdBvHXwsC6/M7Zuw822QF6GMrr6A1uXDsupkFxNMJdTcQTFP1t50SvZkI+tacw8huK2WXZF6EDDg5Suem3tfEBvn/vdjtG2OygwKRNZeVAT/VkJjoCeBBwYmYBF89ibE67sODg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266399915327.350006012942; Mon, 28 Aug 2023 16:46:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsO-0003uZ-Oe; Mon, 28 Aug 2023 19:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qals9-0003pP-IT for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:18 -0400 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006ot-SX for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:17 -0400 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-34dec9c77d4so42705ab.0 for ; Mon, 28 Aug 2023 16:42:05 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266124; x=1693870924; 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; bh=7lV/5XeTX9LnWNklrCPw9QQtEp/5MCYlEuIolAxVmMo=; b=REaMhuXPRVeuchOFH3z8ZsLqA72BP4v+/Avi6nJ9ohx7XOHkVQ8hWz2Nm53RhibCJd z4g1Sxc30WPTDBZmVXwCiwMbgaZuMLIIz3wvEEJftHsXUn1LQiPKT5XUHD/7N3e5iaTd WIZ0yMtOW9V51quNY00IioYL0VSs64GmElOn2oNm0SJD7j3zv+0qSQxXd58VPEUhr+mE 9hgITQOWxNa9URcHU2ZH4fSMl+RAK+M0wauoufUO9DAKky9lX9MzYjiAKubJ+NQFt3G3 3g9cAJA9CPTMI7Zq6gZ6BcP3ZMKQsFjFU5b29oTICwF4l3mjHATAOkZ9if0/k0pJaXjk H8Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266124; x=1693870924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7lV/5XeTX9LnWNklrCPw9QQtEp/5MCYlEuIolAxVmMo=; b=Cw9rccghIBBi2bKR7RybvxE1Wr+jeOrpbIAvHIyDrPYeV1oql5QT5Tn7758PbpF9YL iFOyDKQIH4FBmdq2k4swfjf9Xm2MsyPr7KO3ivj3d1Ob1IvbumPE6s5nvo4nMPS03i7B xadt8u71PpytxVBusK8MoDT8VMUEzfZP5JOSnft5LJtf8FEFCrOV/YWa2UrR03sx1KxO VQmQ+xaCM2UfiOLsraORofin9yUuLBH7JtjjRTc2Lh2W76GQmJSqW8gylM/W9w7g93XK 6zWRkfEqrHz8VnAKfeBJ/keqp/tzwBMo9wgze1L65ncwchJY+yP2W+ePQP0PWeLJCMdn eoUA== X-Gm-Message-State: AOJu0YzRYshu+OCHv2Cp103WCSh3oE06kiGdD7aYNAUHUg/aRmgqmL6D 3blcL8JhytcAA2iuxk/tAyTvcdtzgHfmxrOgDKI= X-Google-Smtp-Source: AGHT+IH4bskpsrGzXbnxzN2SRc+EhYDmuKEv8f7HAMcnoNTlrTw5foncvTFznB3EIX2CccLM9XsHCw== X-Received: by 2002:a05:6e02:2166:b0:34c:e4c6:c517 with SMTP id s6-20020a056e02216600b0034ce4c6c517mr10977259ilv.6.1693266124421; Mon, 28 Aug 2023 16:42:04 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 28/36] bsd-user: Implement freebsd11 getdirents related syscalls Date: Mon, 28 Aug 2023 17:38:13 -0600 Message-ID: <20230828233821.43074-29-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::133; envelope-from=imp@bsdimp.com; helo=mail-il1-x133.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266401958100003 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Implement the freebsd11 variant of the following syscalls: getdirentries(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 04a61fabd11..26909af455d 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -41,6 +41,11 @@ __sym_compat(statfs, freebsd11_statfs, FBSD_1.0); int freebsd11_fstatfs(int fd, struct freebsd11_statfs *buf); __sym_compat(fstatfs, freebsd11_fstatfs, FBSD_1.0); =20 +ssize_t freebsd11_getdirentries(int fd, char *buf, size_t nbytes, off_t *b= asep); +__sym_compat(getdirentries, freebsd11_getdirentries, FBSD_1.0); +ssize_t freebsd11_getdents(int fd, char *buf, size_t nbytes); +__sym_compat(getdents, freebsd11_getdents, FBSD_1.0); + =20 /* stat(2) */ static inline abi_long do_freebsd11_stat(abi_long arg1, abi_long arg2) @@ -468,6 +473,45 @@ static inline abi_long do_freebsd11_getdents(abi_long = arg1, return ret; } =20 +/* getdirecentries(2) */ +static inline abi_long do_freebsd11_getdirentries(abi_long arg1, + abi_ulong arg2, abi_long nbytes, abi_ulong arg4) +{ + abi_long ret; + struct freebsd11_dirent *dirp; + long basep; + + dirp =3D lock_user(VERIFY_WRITE, arg2, nbytes, 0); + if (dirp =3D=3D NULL) { + return -TARGET_EFAULT; + } + ret =3D get_errno(freebsd11_getdirentries(arg1, (char *)dirp, nbytes, = &basep)); + if (!is_error(ret)) { + struct freebsd11_dirent *de; + int len =3D ret; + int reclen; + + de =3D dirp; + while (len > 0) { + reclen =3D de->d_reclen; + if (reclen > len) { + return -TARGET_EFAULT; + } + de->d_reclen =3D tswap16(reclen); + de->d_fileno =3D tswap32(de->d_fileno); + len -=3D reclen; + de =3D (struct freebsd11_dirent *)((void *)de + reclen); + } + } + unlock_user(dirp, arg2, ret); + if (arg4) { + if (put_user(basep, arg4, abi_ulong)) { + return -TARGET_EFAULT; + } + } + return ret; +} + /* getdirecentries(2) */ static inline abi_long do_freebsd_getdirentries(abi_long arg1, abi_ulong arg2, abi_long nbytes, abi_ulong arg4) --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266265; cv=none; d=zohomail.com; s=zohoarc; b=gv95A2HnNe/5Baaj4jMYLZriA3wDO2filORc8rBqQqI7kdkOl/vr7vFr3nysD6yaKGs7wRBY2u7ZHNqi13F6L0/o+YN+55w6wzNEZxhAi5X9ZlYAC6j2uxvpKjG0UQOV+m7iAyJKpij8BcxfHr/F+YcZYcp1QJVnUZFjHnCKRKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266265; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QyoTisO2SKxuhTiuJ9PKmqpK606MeGtTF1rKK3KRIew=; b=ATmoTY5lHZugF4qS6irqDj07EYmmR1X90FATePOwqTYGyq3c7do2E6yGzb+Z0X7rz266kRqvu0qebWBulqFexP/iKrHIisAaL9ltQUaxTmS4O+qpfdtYL/zKzL6BeiPbqk7VX6E3bKt8x2H/FY4LnErkSi59VGAcpW7Xw07rGg0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266265207516.5682451538431; Mon, 28 Aug 2023 16:44:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsR-0003yU-TZ; Mon, 28 Aug 2023 19:42:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sf-Gt for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006pg-VG for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:21 -0400 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-7927952ca67so111766339f.2 for ; Mon, 28 Aug 2023 16:42:06 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266125; x=1693870925; 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; bh=QyoTisO2SKxuhTiuJ9PKmqpK606MeGtTF1rKK3KRIew=; b=SnxSUaT8prZEZLkE5rYh6vABPAesJUE3zZMCj9kVZkKSlzt6ndSw4wxuhg+gxQikNy nemwWP7jFov62oQksIKWCtnW7NI4rvqnYlskkQWHQeRzggiGBz18jo/2cFyTVE3OqP1+ DNqWuNXfte6XXfPT1cDGEfEqjK5YhOxmXNVJoaBB+Gn91om4aDKy7iPIZgesGYvjyk61 GKrtBgLXYTuJ3ZHQO4gdzPc5NEBkd/bi4DZQovl4mrG7sFBpnozE/n4CLoi5G4F0414Z vPMCY8aNIqoue4hDNgPDCy9I+DBCXwxZ3XSrHGuDuzN+1DfY4fgYpH/D5iUf0ZVMRQW1 zp4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266125; x=1693870925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QyoTisO2SKxuhTiuJ9PKmqpK606MeGtTF1rKK3KRIew=; b=lqIifajE0FhKOTYUx7JvjzKX4qN5LKMmE5LOCNOciVfuCMCCE1RMOrUisSSwD7DysW ChnyzNBkZ/2grfjiNrEmY0HboYjS3irv8o8wYLr4RuYqC9Mo1tTLYXz1NBA19u9WufQe NENGbnSRfwSdr3tRsFfan6coFNX3wnhIJL4z8cjYf1mwj5RrDmVEb/7ojyT5KySJJ7P7 eUQb8G4aomXhuYaJyNBJmU0EINioI1T5PraNqt2DVo9OObkzAmZu/6cbO+dv2SfVIcPW oKwU/2NkcH06muWvyN44b5/ob/K7QIXqyBgnqzFeuAhu6ggH11GRsvAa36s96np+t233 tX0w== X-Gm-Message-State: AOJu0Ywq1fMk5ryaqsRQBIPA7oS8MsQL1Db8NY1r2Ub9EjsoyRPmWYO2 LrKSTLNdRsxv6CXGIwOifkRUeBDgxKNlxCMXDBU= X-Google-Smtp-Source: AGHT+IErX26p4SQAV5Z/y3Irempszw+b1XQfjHZQIOLRqUu7V092lL4IB8RM58p3eLP80lo/VLUmgg== X-Received: by 2002:a05:6e02:1d1a:b0:348:b114:a3d2 with SMTP id i26-20020a056e021d1a00b00348b114a3d2mr22811719ila.21.1693266125236; Mon, 28 Aug 2023 16:42:05 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Michal Meloun , Stacey Son , Karim Taha , Richard Henderson Subject: [PULL 29/36] bsd-user: Implement freebsd11 netbsd stat related syscalls Date: Mon, 28 Aug 2023 17:38:14 -0600 Message-ID: <20230828233821.43074-30-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2e; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2e.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266266591100001 Content-Type: text/plain; charset="utf-8" From: Michal Meloun Forward declaration of the nstat syscalls: nstat nlstat nfstat Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index 26909af455d..e31b2aab9e8 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -46,6 +46,13 @@ __sym_compat(getdirentries, freebsd11_getdirentries, FBS= D_1.0); ssize_t freebsd11_getdents(int fd, char *buf, size_t nbytes); __sym_compat(getdents, freebsd11_getdents, FBSD_1.0); =20 +/* undocumented nstat system calls */ +int freebsd11_nstat(const char *path, struct freebsd11_stat *sb); +__sym_compat(nstat, freebsd11_nstat, FBSD_1.0); +int freebsd11_nlstat(const char *path, struct freebsd11_stat *sb); +__sym_compat(nlstat, freebsd11_nlstat, FBSD_1.0); +int freebsd11_nfstat(int fd, struct freebsd11_stat *sb); +__sym_compat(nfstat, freebsd11_nfstat, FBSD_1.0); =20 /* stat(2) */ static inline abi_long do_freebsd11_stat(abi_long arg1, abi_long arg2) --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266292; cv=none; d=zohomail.com; s=zohoarc; b=YDy1Fk13NepAFSPJamRM+69xfdvw87MxTtjkIofPIHuTMzaG5Nx5GOVXs/XQbO0mc7NR++VlqNz1ed436ycwrYCNLgtCmd6THacvLBKej5m5T93Wpgck+SVzOgX2grsS3dq7d0B3acBxP98p0/E143zIhCAaFMdcngnkUoPdNIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266292; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hAf9q2fDw0guLLS8QyB9ffSUo9hVGOLmg07hz6ALafE=; b=gHvlYEiNWKy3CoLmiVXx/OZl3i998scizfxeZmVTV65FRoUxnPEfqK/AuO27lBZhJy3FdhM7JGDet8rvjR0iOxH/6sh3Uy4C7PgTxBjw8n/e4+8JOVpP/1Fw1wiuf1dQsXdkcjAzVorAFIxfv6Ou7ZlEjjN+52RthdVXluER+Yc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266292939930.2912562949018; Mon, 28 Aug 2023 16:44:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsQ-0003v4-1C; Mon, 28 Aug 2023 19:42:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sh-Hn for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006q9-UN for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:19 -0400 Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-34ca192f8feso12440215ab.3 for ; Mon, 28 Aug 2023 16:42:07 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266126; x=1693870926; 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; bh=hAf9q2fDw0guLLS8QyB9ffSUo9hVGOLmg07hz6ALafE=; b=z8h/I3IjhtiJVCFAeABJEEqoAw6U88wmE/xRAEsEv5OuCj81YjOzPmY+J1w3SPl4+K O+I9JREYruPUBz2m4zyVGi7hlM5BDg4d7xMgE+f2RTM6MvCHfUQZ/4c1NDu+XYPXsCkD zcYwGIDKgMDIX2B27YYRD9XZOXu+tv9TwbFy8pSevjOfiIZogyJ+zoFC5/Z9vD4XorE6 v12VeEfk7MUGA5SqpIcMRVBC3JsdI0sSu2lo8JQ7EhVizl1MNL5C7qqMuty7m77kffyW p5ylqn/HjCgT8UtjEmIqVdoJYrIeBL78tdmREZnrMCEbNYfUatzTXrIpPAoafezQ2o5G UUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266126; x=1693870926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hAf9q2fDw0guLLS8QyB9ffSUo9hVGOLmg07hz6ALafE=; b=NEpuszjz/D+DKPv0ASvLNe0R9ZFvMNrSdEj4MlzGTfHRtLgsqHRQUSBZH0OdiG/+yI EpfhfS3FtL1UxdwGQYanrDE2d4RiYeO8UZ5SF7LvsqpM1zQrdK+CZwNQjhiFrn6QhqAk sI2h+KrKEBQ+yBhd7UyWKO0c/OrFfW/JYtxjojCpl1UlsVjhax23fo3x1Nm95Qsc5eay 3MMBKEEd4VkV+dz2Nso1HSttwNq66mAbhGi2i55c4MTxcO0fo3R8EhP8N04l8g601+ua 2OQBolnKyE9+K6yT80UAIc30LgiZoUkUdii7HCK8F++9WPr3uQ2fd3eHPBdSSZZwvcM7 bXjw== X-Gm-Message-State: AOJu0Yxhs0v2HNKKSiGFkYeo8XpXUFxJsPqBWkIWbpY0+kK4cgApiglb 3gcyPZsa1H+bq9ZbS6Ij2wqcy7Nt9OT3RLdKybU= X-Google-Smtp-Source: AGHT+IF6OFTYk1mHlH7Mb5GPjXtm33brSm2ShKvF4+M5B0cvAYcvi2rw3qElsDNAtzNefZd3Zr3kGQ== X-Received: by 2002:a05:6e02:13cf:b0:34b:ba9b:c764 with SMTP id v15-20020a056e0213cf00b0034bba9bc764mr15322574ilj.18.1693266126052; Mon, 28 Aug 2023 16:42:06 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , =?UTF-8?q?Mika=C3=ABl=20Urankar?= , Karim Taha , Richard Henderson Subject: [PULL 30/36] bsd-user: Implement do_freebsd_realpathat syscall Date: Mon, 28 Aug 2023 17:38:15 -0600 Message-ID: <20230828233821.43074-31-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12f; envelope-from=imp@bsdimp.com; helo=mail-il1-x12f.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266295092100005 From: Mika=C3=ABl Urankar Signed-off-by: Mika=C3=ABl Urankar Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h index e31b2aab9e8..b20e2707745 100644 --- a/bsd-user/freebsd/os-stat.h +++ b/bsd-user/freebsd/os-stat.h @@ -634,4 +634,30 @@ static inline abi_long do_freebsd_fcntl(abi_long arg1,= abi_long arg2, return ret; } =20 +#if defined(__FreeBSD_version) && __FreeBSD_version >=3D 1300080 +extern int __realpathat(int fd, const char *path, char *buf, size_t size, + int flags); +/* https://svnweb.freebsd.org/base?view=3Drevision&revision=3D358172 */ +/* no man page */ +static inline abi_long do_freebsd_realpathat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + abi_long ret; + void *p, *b; + + LOCK_PATH(p, arg2); + b =3D lock_user(VERIFY_WRITE, arg3, arg4, 0); + if (b =3D=3D NULL) { + UNLOCK_PATH(p, arg2); + return -TARGET_EFAULT; + } + + ret =3D get_errno(__realpathat(arg1, p, b, arg4, arg5)); + UNLOCK_PATH(p, arg2); + unlock_user(b, arg3, ret); + + return ret; +} +#endif + #endif /* BSD_USER_FREEBSD_OS_STAT_H */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266270; cv=none; d=zohomail.com; s=zohoarc; b=mBIWumZ37DvC5BUNxg7pDSMWqhIhOIRFqeTlNfqA7izgurOUTy5SIaUrYsL0b3plklC9jY5ACPwQ/ZqFO7GbxKz/uG6kASSrHX6kzWIm7XZ5bYvuzl4oxvMnGMi6ztYrocgwkjtvf9JvWe4uV59euO6fJB24CIZqMiJieE5dzrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266270; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cjyYBPaaCRmWFwjKQO0ANajfRRSHfBsR4cDK15Y/bxE=; b=SGyNabScDdwor0ImRprReQlCKmctX8ugMAUMk3uoByiGgOrKWBBUk1LQY0r75oop1OXHOTrwYemDUzYV3AyaUKIVSZiOTE40YwQMSp+q9c0UU73fZOzDbys55lkoOFPBSRFNUfkzMKyZSjW5PMGK2I4c1LKiMA9gK2pWAx2q4yQ= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266269979301.14691412070556; Mon, 28 Aug 2023 16:44:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsP-0003uh-DR; Mon, 28 Aug 2023 19:42:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sg-Ho for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006qE-Vp for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:21 -0400 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7927952ca67so111767539f.2 for ; Mon, 28 Aug 2023 16:42:07 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266127; x=1693870927; 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; bh=cjyYBPaaCRmWFwjKQO0ANajfRRSHfBsR4cDK15Y/bxE=; b=EaVF/HzPLKUHzrGLxiAFN2Iq9CgZIIsLaEkskBHPazdH50a9cneIB9kCok4jNhHcqm DpemaPua47IXT65jYFLTjCfWTmbMYsJCQie4Jl2mjB5fRzteia3yWxZa0p7DUjfs66N7 nLyicxDs+AXU6FpO3KTyyMdV4P6XxFSdlWyD5WzkHzI6hL/Q/NBO9Cp36lsNt7g+5C0S ir8xD5oI4t3dOFd5h7D/DmNM5FIZVMv/gLXDkOAztYlNamVKSG9TcQp5ka/cJNeV/LS0 RmbJL8liPmFnu4XFAVmJvL44tqrBZE4Us1M32gxye9OhXL3wi4C87IdGBTDXeLeRpKOp 31wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266127; x=1693870927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cjyYBPaaCRmWFwjKQO0ANajfRRSHfBsR4cDK15Y/bxE=; b=bQwkaU8PAPtlWGXhQemZtqOKXLyto259BnJBRKDAOa2JHCGqEtAQHsuWQcav2Ousaj 3Ggj4OcKjC5QEEa1qbHqVeSpNj7Dkxru7rqJl240yWDJQDtewXiLALIY9j2fbOgfBCxG b4ox1qWLpvdspinPieDJ2igBkknXAu+oOnOpIjIcZe+uo/u5b16dEAiwk5Z33QD88uPV +UDa+d+W2NxF59TWjpZ8y/9Uvj9wBm+X7B87OjELZwF2BsJwLZd+ajGXB+RWoR20d+ye xYqT/FpV0oiyKCAR9WSseUdvj6weFFqDrV9Dme3Ksc3N09zgURs4vOAgSBtmqSY41PlF FWyQ== X-Gm-Message-State: AOJu0Yz5DE7U0JQMfpSQQ7/cv5huLTOLDVWix5nMCYxN0lxpBJhJtfXA vNlIiPqJLAmN4Hs67Qra0+YP55OWraMMC1UaPG0= X-Google-Smtp-Source: AGHT+IER1KiAMAN/33MJAOMgFUarkEMM02VypV91zwF/zgu252KrwNHC096MMNTILu5dH7HqRk432w== X-Received: by 2002:a92:c5c6:0:b0:34c:b57d:f282 with SMTP id s6-20020a92c5c6000000b0034cb57df282mr17922028ilt.19.1693266126840; Mon, 28 Aug 2023 16:42:06 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 31/36] bsd-user: Add os-stat.c to the build Date: Mon, 28 Aug 2023 17:38:16 -0600 Message-ID: <20230828233821.43074-32-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266270970100003 Content-Type: text/plain; charset="utf-8" From: Karim Taha Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/bsd-user/freebsd/meson.build b/bsd-user/freebsd/meson.build index f87c788e846..f2f047cca31 100644 --- a/bsd-user/freebsd/meson.build +++ b/bsd-user/freebsd/meson.build @@ -1,4 +1,5 @@ bsd_user_ss.add(files( + 'os-stat.c', 'os-sys.c', 'os-syscall.c', )) --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266293; cv=none; d=zohomail.com; s=zohoarc; b=Uag1rsZO2ZkYj4nA/UzJQYZ6r2fttIY8vyzySbwnoy5ZvJi2+z8r8I5Ua1q791+Vx/EeFlZiP7md0ZIY/T2gTxfzxt0x+E9dJqS2qBWUeAYOd75F6XjIn/AldEQGCkZE4kUD/iBZAPhc/yWEsOp0/8v5A2Cer4epRVw0OAS42Do= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266293; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9203UaeNY+VxpDbqXbvLLDOyA4HHIbk0lktS3VR1LOM=; b=WYjQPP5tCxx+06S49ylCe3BViXCvEclfAHdAqwhsXdgl8W2JLiA8op6aFMe+v/mUCEJBoUApyA2w0kVI5cnLlJUPYYKxJXDmCbtXWv53g81wCF7yXN7tJNdvbf44OZLqQYy7e/868DeNI64WSTdfR5Ou2esbrCT4hu7TfU5Wrcg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266293322625.4772109317024; Mon, 28 Aug 2023 16:44:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsP-0003ui-DW; Mon, 28 Aug 2023 19:42:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sc-Fq for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006qJ-Ve for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:19 -0400 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-34ca63f6a27so13250175ab.1 for ; Mon, 28 Aug 2023 16:42:08 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266127; x=1693870927; 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; bh=9203UaeNY+VxpDbqXbvLLDOyA4HHIbk0lktS3VR1LOM=; b=GSNHWCgaev9VugoPzZY7UsKPBVOPw7esJn+ZHxdrdQj4BFNay+hIiITqYc6QOALUnZ MBjpQy0OkvuO/G4/t1/0lVW7s097mdknVxLvliy2Pv2r7sM97sRN16/SHdYgJPsV+Q9v 6gB1YlXlNE8liPJElJXbQojJ2lmZ0aAnZj2j6KAPCbsKbQiF+MO/lB2Y8nrAFYW9BKvk EdnMxzBS+v4u2VyDBlnpxOEKDL3/LQCrM5ATTMTic+7RS7jq3gwGil4qIejOdUm72MUk jLXgkwlp3SjoW6aF9SrZBC7MXoObj5ohbdvryISjjyn2VEihIQGc8cU5azJ7VCF3dqaz yzHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266127; x=1693870927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9203UaeNY+VxpDbqXbvLLDOyA4HHIbk0lktS3VR1LOM=; b=VGVoek5GBZYVruwAtEXp13g2vbEvJhGHKrueFHaBiur6aR7xBZu3S9oYKY0Fc3bRDj KmZhEQc6MglXhmo0BijLkyngpxoY2/3459qcLxSKPvnxczgcK1sQ2adhPhwd09NQ7cHR 76mROC2jSF0IFAx/4K6/s/So/2Ju2NtstLZTQ8eKKhvLMEQiLZHrJ0OfOa6/k+OyNX6S AXZulJAu3iCjPK0Hz+3GmxSWNbIN1gMVXFUuZK/71/y6QJEg6MSADiHpBa1MfTyM+IWa rR9fSIzFXJq6ghKMf4AJqrODdffowR1W7QJyrE0NDZJX1v1Vinecr9si1P3plbzS3RCK /4Pw== X-Gm-Message-State: AOJu0YyGeeOYkEZ40lTpTsjFLjkQ+vZ1j1CO8jUE0PCWTrgI6DxfQWgp EypA1Ge3dUdUmt/S0a3gpq5v9HDlXUL9MaPtfK0= X-Google-Smtp-Source: AGHT+IFLrBRsVKP5Jx/MwzacqqGl7X8aM0jI8GLQrYNbSFxG6oi1WsXnUmmKIYlRGToXZuQ7nz0GcQ== X-Received: by 2002:a92:c5ab:0:b0:34c:e84b:4c60 with SMTP id r11-20020a92c5ab000000b0034ce84b4c60mr7436341ilt.17.1693266127592; Mon, 28 Aug 2023 16:42:07 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 32/36] bsd-user: Add glue for the freebsd11_stat syscalls Date: Mon, 28 Aug 2023 17:38:17 -0600 Message-ID: <20230828233821.43074-33-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::135; envelope-from=imp@bsdimp.com; helo=mail-il1-x135.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266293806100003 Content-Type: text/plain; charset="utf-8" Add glue to call the freebsd11_stat syscalls to the freebsd_syscall: freebsd11_stat freebsd11_lstat freebsd11_fstat freebsd11_fstatat freebsd11_nstat, freebsd11_nfstat, freebsd11_nlstat fstatat fstat Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 2224a280ea2..ade47a0d2f2 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -36,6 +36,9 @@ #include "bsd-file.h" #include "bsd-proc.h" =20 +/* *BSD dependent syscall shims */ +#include "os-stat.h" + /* I/O */ safe_syscall3(int, open, const char *, path, int, flags, mode_t, mode); safe_syscall4(int, openat, int, fd, const char *, path, int, flags, mode_t, @@ -482,6 +485,45 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_bsd_undelete(arg1); break; =20 + /* + * stat system calls + */ + case TARGET_FREEBSD_NR_freebsd11_stat: /* stat(2) */ + ret =3D do_freebsd11_stat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_lstat: /* lstat(2) */ + ret =3D do_freebsd11_lstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_fstat: /* fstat(2) */ + ret =3D do_freebsd11_fstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fstat: /* fstat(2) */ + ret =3D do_freebsd_fstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_fstatat: /* fstatat(2) */ + ret =3D do_freebsd11_fstatat(arg1, arg2, arg3, arg4); + break; + + case TARGET_FREEBSD_NR_fstatat: /* fstatat(2) */ + ret =3D do_freebsd_fstatat(arg1, arg2, arg3, arg4); + break; + + case TARGET_FREEBSD_NR_freebsd11_nstat: /* undocumented */ + ret =3D do_freebsd11_nstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_nfstat: /* undocumented */ + ret =3D do_freebsd11_nfstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_nlstat: /* undocumented */ + ret =3D do_freebsd11_nlstat(arg1, arg2); + break; + /* * sys{ctl, arch, call} */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266219; cv=none; d=zohomail.com; s=zohoarc; b=aumsEMQcT03VP+IJwOTvTGH1L5jT8aQ6gy1PJYvThfL2Kk6hOSriNdZ9srT4dis1qooBAZoNA6eizhenH8NWX2FYFmWdon4EbCoA88YzTqBTp886k/OQGvxXKui0MDxjTPxiJNL3ImWokTLTlzrTyCZy9XBM6VZOsP+3nb+PtbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266219; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G5U7mLm+bsD4Khy6hH0NG/eGf24P7ccIdU3Pa7XNEEg=; b=SQm4d2B6Qc2bvs9nwtM2Wu/RvPdqoc9Wd9WoxIjm5O4AhieDUZYLk/2ifvv12QjfhEnaXsxCYZZNpVhsZl9DiZ5pAVMhzlWvzG6mHX1pMaeHCWfBeZ3DcqRzWcj/KXgmowcyxppf5wYQE4IxVX0XQxWREhGHqTW+zBoLb2lHlMY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266219025401.9465867884089; Mon, 28 Aug 2023 16:43:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsN-0003uS-50; Mon, 28 Aug 2023 19:42:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sd-Fy for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006qO-VO for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:19 -0400 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-34ca1aadcccso13056695ab.3 for ; Mon, 28 Aug 2023 16:42:09 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266128; x=1693870928; 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; bh=G5U7mLm+bsD4Khy6hH0NG/eGf24P7ccIdU3Pa7XNEEg=; b=ddLGrgU2WY/5emi0ha+QVi6IM2vbyhOoFS/RGX4Q/+T/vwFj2pAza3nmLtuRDj7stW wqfqiI0Or6iefxO/9X1lj+7uFhOyueJycBuNBFyKnTMUI2vIX55tyh/VWLRxqB377r8C Q+RueXjUhvnr9UslUBRrgu19Z2n86qzcM0ZWDyyfp+0P39uwnobOAwhZWAFA8Mx9krW6 PKLmEaKwCwsQkKXQRvKd8f03mCzNLoHxmfw+suNwZdn7jWYCmuryUanCH/v4gcxgcX8D ByhGY3If8vaV5CXRiOSpzJ2bFNU3MOuc3yUtUJkbkHXYymc9tApQ5fAfkJXVHGTnp8lN whCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266128; x=1693870928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G5U7mLm+bsD4Khy6hH0NG/eGf24P7ccIdU3Pa7XNEEg=; b=O4lncI5kDB69JFC9COa8moM8mrrL1dpWZWIBSfFVp/SBLz2U2hMnzYdm4R5Fme6h3N m3NgSfmGv68uEo2jcyf+R0CMKxqENevYN4Z/AneNMEwsWOIQljO9pqXUBCOEARa0YgZw 7F3nCyBAbE9x4Cs7xf9n2WNWcLuSOp2IViB6IyP9q0wzhpK4aJrR1FSYfcg0SJirmWYX MEyfbt90zTzB+hRuil3+PcK2uLnYYfOggfcW/VX48PfiQG874xxTvT8YlSfiCGyw4eJL HNp09tA8a4+/roNZpybSicUW+tEhln3iB8m3uwfk1OF8xzr9ExxSivrrYzggzcWXW8F5 lWfg== X-Gm-Message-State: AOJu0YzbaaAO5iR/j5i3WHe2qMaU1rXAgWnLkM5XHG7PbZdNdxgRV2VC xGtKbD+JpGqP0semgjZwzF0eU78V37FJszdL65k= X-Google-Smtp-Source: AGHT+IERLk60p7nKJ8itiDe06YiM7Eqeuj4vBaNoppiLGaGYwbUhvobp2EKZqKXyUpiV5SkxSruhgA== X-Received: by 2002:a05:6e02:1c08:b0:34b:ad7a:383f with SMTP id l8-20020a056e021c0800b0034bad7a383fmr21793482ilh.0.1693266128340; Mon, 28 Aug 2023 16:42:08 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 33/36] bsd-user: Add glue for getfh and related syscalls Date: Mon, 28 Aug 2023 17:38:18 -0600 Message-ID: <20230828233821.43074-34-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266220444100001 Content-Type: text/plain; charset="utf-8" Add glue to call the following syscalls to the freebsd_syscall: getfh lgetfh fhopen freebsd11_fhstat freebsd11_fhstatfs fhstat fhstatfs Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index ade47a0d2f2..73616a5be08 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -524,6 +524,34 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_freebsd11_nlstat(arg1, arg2); break; =20 + case TARGET_FREEBSD_NR_getfh: /* getfh(2) */ + ret =3D do_freebsd_getfh(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_lgetfh: /* lgetfh(2) */ + ret =3D do_freebsd_lgetfh(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fhopen: /* fhopen(2) */ + ret =3D do_freebsd_fhopen(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_fhstat: /* fhstat(2) */ + ret =3D do_freebsd11_fhstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fhstat: /* fhstat(2) */ + ret =3D do_freebsd_fhstat(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_fhstatfs: /* fhstatfs(2) */ + ret =3D do_freebsd11_fhstatfs(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fhstatfs: /* fhstatfs(2) */ + ret =3D do_freebsd_fhstatfs(arg1, arg2); + break; + /* * sys{ctl, arch, call} */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266258; cv=none; d=zohomail.com; s=zohoarc; b=nqpa9DCnHM2JYaoC0ankGJg81hNx7W6YZ6pMqJz+TQeqVz0ZjwtrrzIi0VMP8Hepfa29D5kZQy2jZFkhNN9+bdcPqwJJixHjqcYGD+jhCdAJz+AHSVrSuVKLy0+fG0iPxDyv0jF21J6JWpHZWIkOi3XSyAHAIz/rFun35I4u3yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266258; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ZzGKX91yr67fIOgLMVQ4bKuqceFUDjMtINiYOw56ek=; b=dzcPZOhx60e3Q67jr6E1O55tyJaCGQzApipk6nWJdtMtSfzxyDdJUq5A0azMjDEYX6NlHqTdAwJtd1QuMkpfgH5QdVUt3IrfLRK80Y2HHUsY40tciKKT8IAOuXTyFW/YM8I4p6ep+XbM52Kf9MB/aScrCVcGKAcMumjzrsy6ZNg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169326625842792.86170476800646; Mon, 28 Aug 2023 16:44:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsQ-0003xQ-8O; Mon, 28 Aug 2023 19:42:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003si-I0 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006qU-W2 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:21 -0400 Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-794d98181f0so48590539f.2 for ; Mon, 28 Aug 2023 16:42:10 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266129; x=1693870929; 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; bh=2ZzGKX91yr67fIOgLMVQ4bKuqceFUDjMtINiYOw56ek=; b=aQrF7iywzO/txU5RYDEkuKsQhz03u3YBd04jYsunWaXbnLVVbQabqyWLUVkfr0Opuj 99HT/whFfdBoPkwf0RzQ+qAcgUi1j4oBUeBrNuL4nIraWppNwA9vg9Q0N6Mzr/nBq/tq 45geiHr+//k2jVk9EFjZGXD674S+JSnNSPiVjMU0kX7GIuj1WWcgQhRxkpSEpG+xYXiC UAFT2n/hIDkuy7r4OBb4LP7VTq+g68KrWBC01aX+VTTMhWMv9xNnVYv0hN4Q1KbyoML7 dKKbMH7604TRJrcHj6cxyY/1NOVDroZ2X0/ezJAPi413cmalfYyfOPm+w6xMS4s9j8y+ XwWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266129; x=1693870929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2ZzGKX91yr67fIOgLMVQ4bKuqceFUDjMtINiYOw56ek=; b=C1oaxmCZq4nrKaq8vIex9FZvoi7z06oqtIc0jX7JHbt6VAj4aAsmiVmUk2uYHfU9uT 9CNdg5SX2xeUPYVQVeJp9or+to6oyrPXAa1SYI3ADr3X8VuXQYRw9ZLaIrfjvr7s1EyO Mf+9B6eOl98xmjcI9VknXfzAwEFC+GSDMO8OXHvxILyP1CVMDrIb2tgljQm/enqxG4oB jM3EPs0VORSwJUM1KJkjeDZPBssfYUssGtdooL0Ut/6ggQKcx/161HBhqP123nQ393+v GgHhqZgIZ4hYrtDBdjgJMS8pW24/RqLgkiliMboSVxrpu4wpHavmCOOqaytVLxiXqnuh OkWw== X-Gm-Message-State: AOJu0YzXZtbMvDT/9P7LtP0+Vky214jK/aAISAgqY+3ooHcTNddRcYIe zGgudWT5nL8saWMVFwsKYpbWdxUjI4RgzknRXgw= X-Google-Smtp-Source: AGHT+IH7u7NC6rUx/0hvuAO0qb0TbwMD3kX3ZbMOm8y/0IHRD7Nkkd54OdYRtqa1COuUOhjX+BmV8w== X-Received: by 2002:a92:c565:0:b0:34c:e4c6:c51d with SMTP id b5-20020a92c565000000b0034ce4c6c51dmr10889197ilj.6.1693266129106; Mon, 28 Aug 2023 16:42:09 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 34/36] bsd-user: Add glue for statfs related system calls Date: Mon, 28 Aug 2023 17:38:19 -0600 Message-ID: <20230828233821.43074-35-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d33; envelope-from=imp@bsdimp.com; helo=mail-io1-xd33.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266259665100001 Content-Type: text/plain; charset="utf-8" Add glue to call the following syscalls to the freebsd_syscall: freebsd11_statfs statfs freebsd11_fstatfs fstatfs freebsd11_getfsstat getfsstat Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 73616a5be08..916a754bf8b 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -552,6 +552,30 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_freebsd_fhstatfs(arg1, arg2); break; =20 + case TARGET_FREEBSD_NR_freebsd11_statfs: /* statfs(2) */ + ret =3D do_freebsd11_statfs(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_statfs: /* statfs(2) */ + ret =3D do_freebsd_statfs(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_fstatfs: /* fstatfs(2) */ + ret =3D do_freebsd11_fstatfs(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fstatfs: /* fstatfs(2) */ + ret =3D do_freebsd_fstatfs(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_freebsd11_getfsstat: /* getfsstat(2) */ + ret =3D do_freebsd11_getfsstat(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_getfsstat: /* getfsstat(2) */ + ret =3D do_freebsd_getfsstat(arg1, arg2, arg3); + break; + /* * sys{ctl, arch, call} */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266365; cv=none; d=zohomail.com; s=zohoarc; b=mTZ4/Y6E6tWGG96YrhJMtCzQxtcHxnLY/Nb2tRuH7CwRHQ0TPI/qy1i9/VdWsnVh4Wdo5tmXenqlJDOqBrXViE5/JaqhYVEXecMyzwJ8wibFZQHUkP/1Qkw06qE7sqvrukdGD6LiCy/wFcA4AyYRYzesc2PCGwPXJmsWFbI27L8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266365; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fr2lJgWGvnGEd848mGunRkkes2I0QZce3Voahhm5Tb0=; b=INAPAgRl9/3PDhg1xMEielCN+30wVf24UGwXD3d8SN90JdJcfkLD2qyO0JDp+yZvpRsqfg2PYx2dAjRGGkmTFhPqNSE+xGO7pRT9u3rJDsz8AVQMAJbj//sVzR3Qb5gOxa/v3WoetbRegfYq07YeK6NxwFLqCx3ywNbhTV/1vRk= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266365426705.9630277005028; Mon, 28 Aug 2023 16:46:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsP-0003uj-K9; Mon, 28 Aug 2023 19:42:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003se-GP for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006qY-Up for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:19 -0400 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-79241bb5807so136357039f.0 for ; Mon, 28 Aug 2023 16:42:10 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266130; x=1693870930; 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; bh=Fr2lJgWGvnGEd848mGunRkkes2I0QZce3Voahhm5Tb0=; b=bTqL6yN4gMgYrvIljZedJf0SZkfVhBgwW6zBxIGj0opSeXPgE5mZvxHc8zMImCf/X9 G+ShVuyd6zR6V6Php2/9OXb+0asVCqw8be2c3Kx/wScjtI6HpMmkFxGy+11+l5KBk45R rnSq/dIrqrRAJc6SA0dyK1RbX98a0xBsLjPMHv9G7EmUwEciOh6R7PP87IL1CibVuX0Q dQ03U6Gkpja9m1HVhxOtlxwF5QBDFMj6JLUOSmUJKpSd3ocaGTQmjo7XG+pj34T+rSBD 379Cc7E6noziLrs1aLO/nMN2IzAgGuu/+sD3wdf0iey/9T/sAosCVWrVZRXTg5dWacA+ woUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266130; x=1693870930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fr2lJgWGvnGEd848mGunRkkes2I0QZce3Voahhm5Tb0=; b=hEbonbRjRCwb3USDvBQt2S30YpaQiPcUd0dAXV9+d6xAevjJhpNXkJD3vn2jtPWkBK ioVYZ4oP/f98lzCM6P7L2FhHd2Nzv/7DdwcD/ibO5T8fMCHUMKRDDPzG6bvY9rcyInpW VO3B8J6AUR8HiDPPP+uwZiIE/z2BbN08PTfLxoRDyjw+7sMkxta3hGQ6l1tGREvFdOKg R9R9OPQ9mzaYK5qKPNfLy2Cpp0JpqLWaNcLneKWpBVsIjk/I4c/P34COrX3fyykDlhNP sOf+ntL6hUrXgNFJW+E0qFgogufUakhZH4h6qAke89ZdAkFcZg6M4k5iJDkh8HDr/EMg mpsA== X-Gm-Message-State: AOJu0Yx61irMlqSfrkqzvoALkFALdKSJMKsFxFu9wMs4lsCtB9ENizD4 3ZK4QLDMYrzUMBIKsbxwNiHn1LdDu1S7szUIl7c= X-Google-Smtp-Source: AGHT+IFF0Jo0ma4ELvDcvQQkA/atoyJoLsCwGpQMtN0ixiJU45a7AbnPFDNxE+A0N/CXPlg5O6Mmuw== X-Received: by 2002:a05:6e02:1a4f:b0:349:8811:fc51 with SMTP id u15-20020a056e021a4f00b003498811fc51mr20839630ilv.20.1693266129840; Mon, 28 Aug 2023 16:42:09 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , Karim Taha , Richard Henderson Subject: [PULL 35/36] bsd-user: Add getdents and fcntl related system calls Date: Mon, 28 Aug 2023 17:38:20 -0600 Message-ID: <20230828233821.43074-36-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266367425100001 Content-Type: text/plain; charset="utf-8" Add glue to call the following syscalls to the freebsd_syscall: freebsd11_getdents getdirentries freebsd11_getdirentries fcntl Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 916a754bf8b..e9b1b663af4 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -576,6 +576,22 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_freebsd_getfsstat(arg1, arg2, arg3); break; =20 + case TARGET_FREEBSD_NR_freebsd11_getdents: /* getdents(2) */ + ret =3D do_freebsd11_getdents(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_getdirentries: /* getdirentries(2) */ + ret =3D do_freebsd_getdirentries(arg1, arg2, arg3, arg4); + break; + + case TARGET_FREEBSD_NR_freebsd11_getdirentries: /* getdirentries(2) */ + ret =3D do_freebsd11_getdirentries(arg1, arg2, arg3, arg4); + break; + case TARGET_FREEBSD_NR_fcntl: /* fcntl(2) */ + ret =3D do_freebsd_fcntl(arg1, arg2, arg3); + break; + + /* * sys{ctl, arch, call} */ --=20 2.41.0 From nobody Thu Nov 28 09:42:14 2024 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=1693266395; cv=none; d=zohomail.com; s=zohoarc; b=WQAPQq/fAVI7BkQuLVvnkbtC57HQJo1D+IuIrez9rJTkmcjhi1M3LWOhzHTNTC1BmhTJlS+pCqMjabvrVeFjKkqxtO6HROLQsgNMVpeJW0q3/BlnSFDExN1ns1VVk+TDSgLOmfVUk17bPGCGl25LybYbZGOyIEfXAjNIOxE1Nps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693266395; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N2zpTl6+Qn2qxjehwfDJexIkEUjfkShWM5RDsL7uCz4=; b=iDF66Eg49/fWiWOmjpmZZQcK8flh3WqCEQ/BQRMvd9xXvzYpZ/HeyJpRYLQccfGsI/PQ6RjN9Ulp7LBmXgIKxocKVBHcXH07UuyyNg+S9KHmwd4XDX/Pn4p4MIsiBxGULRYDPq5GnutRre+6PI/btnnfQraYz9QFdsxbhKEn1kY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693266395787582.2318000068404; Mon, 28 Aug 2023 16:46:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qalsO-0003ug-Uy; Mon, 28 Aug 2023 19:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qalsH-0003sj-IM for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:26 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qals6-0006qf-Ud for qemu-devel@nongnu.org; Mon, 28 Aug 2023 19:42:19 -0400 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-34992fd567bso9188965ab.1 for ; Mon, 28 Aug 2023 16:42:11 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id t9-20020a056e02060900b0034b58dd5694sm2805491ils.15.2023.08.28.16.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 16:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693266130; x=1693870930; 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; bh=N2zpTl6+Qn2qxjehwfDJexIkEUjfkShWM5RDsL7uCz4=; b=49d2Rgh8YfCfzCpfD6Cvi/6P3Ziw+Xrmhr6i7e0SolZ3ZJQyjypg7eMW+xfqItoTE2 jw9UASR7gL/gciwNnWl4sb8/UvqEivzWEQM4MP70xE4XNLga+/z9HdM/2sqRxZwr3qRG kf7Do9nSdd4IooTInCSQDxt3MjZB+K65u01fvCCNJET9pDP2Fmtk5IJAb+rsZoTN8ZsF AkwEuSAHPoy7J+uJx33RKYdQkoZjr+i3y59Hr7WWptz+1Bi6Xsc7SCQkbAWUowQCLf7R L4rX8bKzvdemOcYXshYOnFAX9LAEJKPKM/aSSWsgLbfxkFesnRemzde4mSXuKnIngRkf 2Ang== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693266130; x=1693870930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N2zpTl6+Qn2qxjehwfDJexIkEUjfkShWM5RDsL7uCz4=; b=T3FSMq0CQczQK1ewg68kUqG3lgN+BoZB075c6z4RzMbkQxcNtfxrdVaHI1WbahnN1T AP68fdgKmwCFWur7Txv0zyi4QE09q1omDokRW4uLRqw2oJw0+cyQKJH7lxrkPGs9FPQy hud6mVYFlqSbE8oDv1TBsOv9eTLaKq05Toe0aTuPwe94iyhdnBS0h9s0ZIATTJ6pjda8 0sHUoRbHgNhW6Z2WbKDhD0sUDUdE//yKW9fONqAjO0w6p0DmXLd1Os2wsDKzFrPByGai NeAv0aie5S8YdUkNm3Y8vWqrNRSNkwEtkYR4mUzsT+6EjwOvSicT2GYC6kyfjP1NcDLN 9orQ== X-Gm-Message-State: AOJu0Yz2CkeLBYWNXtMWqnoXv3bAcr5/KqQl7bG1Sgjzjamrq2Vz8scR h+UsUELd8nxeFYLb4B1vCjoXjM0DC8uusdZYoSk= X-Google-Smtp-Source: AGHT+IHJhKFUzYSaMsrwRUwA+ZSF6AtwiP06z/5g/t6EH6I6jeTVhU/bfbvEzpHIbtcAd5MODL+jEg== X-Received: by 2002:a92:c547:0:b0:348:797d:169e with SMTP id a7-20020a92c547000000b00348797d169emr1309505ilj.1.1693266130634; Mon, 28 Aug 2023 16:42:10 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , Warner Losh , Ryo ONODERA , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 36/36] bsd-user: Add missing break after do_bsd_preadv Date: Mon, 28 Aug 2023 17:38:21 -0600 Message-ID: <20230828233821.43074-37-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828233821.43074-1-imp@bsdimp.com> References: <20230828233821.43074-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::134; envelope-from=imp@bsdimp.com; helo=mail-il1-x134.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: 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.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693266396462100001 Without it, we'd call preadv, then write with weird parameters, which is clearly not ideal... Signed-off-by: Warner Losh Reviewed-by: Philippe Mathieu-Daud=C3=A9 Fixes: 770d8abae7 ("bsd-user/bsd-file.h: Meat of the write system calls") Reviewed-by: Richard Henderson Message-Id: <20230820045419.89691-1-imp@bsdimp.com> --- bsd-user/freebsd/os-syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index e9b1b663af4..fa60df529ef 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -240,6 +240,7 @@ static abi_long freebsd_syscall(void *cpu_env, int num,= abi_long arg1, =20 case TARGET_FREEBSD_NR_preadv: /* preadv(2) */ ret =3D do_bsd_preadv(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6); + break; =20 case TARGET_FREEBSD_NR_write: /* write(2) */ ret =3D do_bsd_write(arg1, arg2, arg3); --=20 2.41.0