From patchwork Wed Sep 22 06:14:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB4EDC433EF for ; Wed, 22 Sep 2021 06:19:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80449611B0 for ; Wed, 22 Sep 2021 06:19:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 80449611B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvbn-0000n1-JA for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:19:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWp-0001Hx-1X for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:47 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:36636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWl-0007Ri-VS for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:46 -0400 Received: by mail-il1-x134.google.com with SMTP id v16so1586599ilg.3 for ; Tue, 21 Sep 2021 23:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2mgHuG7p6mpXnNHKT7KvNxZcaCjufurqWdVEkpIUqrA=; b=IcAl71snFhJllIibpwBASJvIKKhlE8AjTVP7raaayoDP+wqPgJO0rawuP1vM2vdHUT Q6srgMdsE8QQpyd+x3TeM+w9KH4yXOAu6jS6M/fuIbUi7/BMhAGVEJbpq/2EYLkts4O0 AsTBCZNmZXbqAFXmRbi/wqohG6zymGrs8UwImE3FIN0169kHfLxMvpeSV/8bJ6yDTIp9 tNMFF021wGLvdq2imasEtGpVusdDe5rEYXAqA3nHtz0hVYc0FuwrHP20hw6/bw8MRCog gJHB7/NVZoLFyk1CyH4IcOaQ74psYylmhdSQmbuY/NoS+HASatZGyvnnRLTkWH3BytS8 pOnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2mgHuG7p6mpXnNHKT7KvNxZcaCjufurqWdVEkpIUqrA=; b=rFqGPlSQx1JiIQPixoPQjXGcT0uya4tVZZ91ZBYBEaS25b9gSTfyseAe8zCr2xxCPg UYlVjhYE9/9r322WhT4k7cMd0w0OvsaROOVyyBq1joAdKEe3ReJh6u7lericWhj+DjnQ hODg8nodgtNB49A/xbT8DVIkiGCR2Fq3GlycQlwg9Fm10c6j49264XMJarW+2VJUp21w MislySPGqFbmE8tQt6PHo2NrL7FyZ/JRyX0p3f+rC4084rUHgUC7wfXfV11wrP62ty24 krRBKmsh0cqDCvMI8dTyMoNLjJBtiAp08xpwom9bD3CBqhPobHGEPhdC/cd82EL9Qt0v /AOg== X-Gm-Message-State: AOAM5324Dp5nnUWjqitf848I9vG1DgkNLRWnlqcCTtPj0P3wUQAIX6J3 efv4O3rYGe86nkcIMP9ZSNZYMKlwzEcO9krx+lI= X-Google-Smtp-Source: ABdhPJwDMiXh3kO+Enp86PI27dtwiojJk0sQDzGm54kqfsPJe2WZI6XpgqJNUytzJev3FPUYoWBxeg== X-Received: by 2002:a05:6e02:1907:: with SMTP id w7mr426897ilu.34.1632291282395; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:41 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 01/14] bsd-user/target_os-user.h: Remove support for FreeBSD older than 12.0 Date: Wed, 22 Sep 2021 00:14:25 -0600 Message-Id: <20210922061438.27645-2-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_user.h | 100 +----------------------------- 1 file changed, 1 insertion(+), 99 deletions(-) diff --git a/bsd-user/freebsd/target_os_user.h b/bsd-user/freebsd/target_os_user.h index 95b1fa9f99..19892c5071 100644 --- a/bsd-user/freebsd/target_os_user.h +++ b/bsd-user/freebsd/target_os_user.h @@ -61,15 +61,7 @@ struct target_sockaddr_storage { /* * from sys/user.h */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 #define TARGET_KI_NSPARE_INT 2 -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 1100000 -#define TARGET_KI_NSPARE_INT 4 -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 1000000 -#define TARGET_KI_NSPARE_INT 7 -#else -#define TARGET_KI_NSPARE_INT 9 -#endif /* ! __FreeBSD_version >= 1000000 */ #define TARGET_KI_NSPARE_LONG 12 #define TARGET_KI_NSPARE_PTR 6 @@ -116,11 +108,7 @@ struct target_kinfo_proc { int32_t ki_tsid; /* Terminal session ID */ int16_t ki_jobc; /* job control counter */ int16_t ki_spare_short1; /* unused (just here for alignment) */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 int32_t ki_tdev__freebsd11; /* controlling tty dev */ -#else - int32_t ki_tdev; /* controlling tty dev */ -#endif target_sigset_t ki_siglist; /* Signals arrived but not delivered */ target_sigset_t ki_sigmask; /* Current signal mask */ target_sigset_t ki_sigignore; /* Signals being ignored */ @@ -164,45 +152,24 @@ struct target_kinfo_proc { int8_t ki_nice; /* Process "nice" value */ char ki_lock; /* Process lock (prevent swap) count */ char ki_rqindex; /* Run queue index */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1100000 u_char ki_oncpu_old; /* Which cpu we are on (legacy) */ u_char ki_lastcpu_old; /* Last cpu we were on (legacy) */ -#else - u_char ki_oncpu; /* Which cpu we are on */ - u_char ki_lastcpu; /* Last cpu we were on */ -#endif /* ! __FreeBSD_version >= 1100000 */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 char ki_tdname[TARGET_TDNAMLEN + 1]; /* thread name */ -#else - char ki_ocomm[TARGET_TDNAMLEN + 1]; /* thread name */ -#endif /* ! __FreeBSD_version >= 900000 */ char ki_wmesg[TARGET_WMESGLEN + 1]; /* wchan message */ char ki_login[TARGET_LOGNAMELEN + 1]; /* setlogin name */ char ki_lockname[TARGET_LOCKNAMELEN + 1]; /* lock name */ char ki_comm[TARGET_COMMLEN + 1]; /* command name */ char ki_emul[TARGET_KI_EMULNAMELEN + 1]; /* emulation name */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 char ki_loginclass[TARGET_LOGINCLASSLEN + 1]; /* login class */ -#endif /* ! __FreeBSD_version >= 900000 */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 char ki_sparestrings[50]; /* spare string space */ -#else - char ki_sparestrings[68]; /* spare string space */ -#endif /* ! __FreeBSD_version >= 900000 */ int32_t ki_spareints[TARGET_KI_NSPARE_INT]; /* spare room for growth */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 - uint64_t ki_tdev; /* controlling tty dev */ -#endif -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1100000 + uint64_t ki_tdev; /* controlling tty dev */ int32_t ki_oncpu; /* Which cpu we are on */ int32_t ki_lastcpu; /* Last cpu we were on */ int32_t ki_tracer; /* Pid of tracing process */ -#endif /* __FreeBSD_version >= 1100000 */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 int32_t ki_flag2; /* P2_* flags */ int32_t ki_fibnum; /* Default FIB number */ -#endif /* ! __FreeBSD_version >= 900000 */ uint32_t ki_cr_flags; /* Credential flags */ int32_t ki_jid; /* Process jail ID */ int32_t ki_numthreads; /* XXXKSE number of threads in total */ @@ -234,18 +201,8 @@ struct target_kinfo_file { int32_t kf_flags; /* Flags. */ int32_t kf_pad0; /* Round to 64 bit alignment. */ int64_t kf_offset; /* Seek location. */ -#if defined(__FreeBSD_version) && __FreeBSD_version < 1200031 - int32_t kf_vnode_type; /* Vnode type. */ - int32_t kf_sock_domain; /* Socket domain. */ - int32_t kf_sock_type; /* Socket type. */ - int32_t kf_sock_protocol; /* Socket protocol. */ - struct target_sockaddr_storage kf_sa_local; /* Socket address. */ - struct target_sockaddr_storage kf_sa_peer; /* Peer address. */ -#endif -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 union { struct { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kf_spareint; /* Socket domain. */ int kf_sock_domain0; @@ -257,7 +214,6 @@ struct target_kinfo_file { struct sockaddr_storage kf_sa_local; /* Peer address. */ struct sockaddr_storage kf_sa_peer; -#endif /* Address of so_pcb. */ uint64_t kf_sock_pcb; /* Address of inp_ppcb. */ @@ -272,7 +228,6 @@ struct target_kinfo_file { uint32_t kf_sock_pad0; } kf_sock; struct { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 /* Vnode type. */ int kf_file_type; /* Space for future use */ @@ -290,16 +245,6 @@ struct target_kinfo_file { uint32_t kf_file_fsid_freebsd11; /* File device, FreeBSD 11 compat. */ uint32_t kf_file_rdev_freebsd11; -#else - /* Global file id. */ - uint64_t kf_file_fileid; - /* File size. */ - uint64_t kf_file_size; - /* Vnode filesystem id. */ - uint32_t kf_file_fsid; - /* File device. */ - uint32_t kf_file_rdev; -#endif /* File mode. */ uint16_t kf_file_mode; /* Round to 64 bit alignment. */ @@ -307,18 +252,14 @@ struct target_kinfo_file { uint32_t kf_file_pad1; } kf_file; struct { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kf_spareint[4]; uint64_t kf_spareint64[32]; -#endif uint32_t kf_sem_value; uint16_t kf_sem_mode; } kf_sem; struct { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kf_spareint[4]; uint64_t kf_spareint64[32]; -#endif uint64_t kf_pipe_addr; uint64_t kf_pipe_peer; uint32_t kf_pipe_buffer_cnt; @@ -326,7 +267,6 @@ struct target_kinfo_file { uint32_t kf_pipe_pad0[3]; } kf_pipe; struct { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kf_spareint[4]; uint64_t kf_spareint64[32]; uint32_t kf_pts_dev_freebsd11; @@ -334,34 +274,18 @@ struct target_kinfo_file { uint64_t kf_pts_dev; /* Round to 64 bit alignment. */ uint32_t kf_pts_pad1[4]; -#else - uint32_t kf_pts_dev; - /* Round to 64 bit alignment. */ - uint32_t kf_pts_pad0[7]; -#endif } kf_pts; struct { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kf_spareint[4]; uint64_t kf_spareint64[32]; -#endif int32_t kf_pid; } kf_proc; } kf_un; uint16_t kf_status; /* Status flags. */ uint16_t kf_pad1; /* Round to 32 bit alignment. */ int32_t _kf_ispare0; /* Space for more stuff. */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1000000 target_cap_rights_t kf_cap_rights; /* Capability rights. */ uint64_t _kf_cap_spare; /* Space for future cap_rights_t. */ -#else /* ! __FreeBSD_version >= 1000000 */ - uint64_t kf_cap_rights; - int _kf_ispare[4]; -#endif /* ! __FreeBSD_version >= 1000000 */ - -#else /* ! __FreeBSD_version >= 900000 */ - int _kf_ispare[16]; -#endif /* ! __FreeBSD_version >= 900000 */ /* Truncated before copyout in sysctl */ char kf_path[PATH_MAX]; /* Path to file, if any. */ }; @@ -372,34 +296,19 @@ struct target_kinfo_vmentry { uint64_t kve_start; /* Starting address. */ uint64_t kve_end; /* Finishing address. */ uint64_t kve_offset; /* Mapping offset in object */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 uint64_t kve_vn_fileid; /* inode number if vnode */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kve_vn_fsid_freebsd11; /* dev_t of vnode location */ -#else - uint32_t kve_vn_fsid; /* dev_t of vnode location */ -#endif -#else /* ! __FreeBSD_version >= 900000 */ - uint64_t kve_fileid; /* inode number if vnode */ - uint32_t kve_fsid; /* dev_t of vnode location */ -#endif /* ! __FreeBSD_version >= 900000 */ int32_t kve_flags; /* Flags on map entry. */ int32_t kve_resident; /* Number of resident pages. */ int32_t kve_private_resident; /* Number of private pages. */ int32_t kve_protection; /* Protection bitmask. */ int32_t kve_ref_count; /* VM obj ref count. */ int32_t kve_shadow_count; /* VM obj shadow count. */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 int32_t kve_vn_type; /* Vnode type. */ uint64_t kve_vn_size; /* File size. */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 uint32_t kve_vn_rdev_freebsd11; /* Device id if device. */ -#else - uint32_t kve_vn_rdev; /* Device id if device. */ -#endif uint16_t kve_vn_mode; /* File mode. */ uint16_t kve_status; /* Status flags. */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 #if (__FreeBSD_version >= 1300501 && __FreeBSD_version < 1400000) || \ __FreeBSD_version >= 1400009 union { @@ -413,13 +322,6 @@ struct target_kinfo_vmentry { #endif uint64_t kve_vn_rdev; /* Device id if device. */ int _kve_ispare[8]; /* Space for more stuff. */ -#else - int32_t _kve_ispare[12]; /* Space for more stuff. */ -#endif -#else /* ! __FreeBSD_version >= 900000 */ - int _kve_pad0; - int32_t _kve_ispare[16]; /* Space for more stuff. */ -#endif /* ! __FreeBSD_version >= 900000 */ /* Truncated before copyout in sysctl */ char kve_path[PATH_MAX]; /* Path to VM obj, if any. */ }; From patchwork Wed Sep 22 06:14:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07D25C433FE for ; Wed, 22 Sep 2021 06:17:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8169161178 for ; Wed, 22 Sep 2021 06:17:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8169161178 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvZR-0004Dd-KF for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:17:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWp-0001Hy-3N for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:47 -0400 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]:43788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWm-0007SL-Fs for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:46 -0400 Received: by mail-il1-x132.google.com with SMTP id b15so1543070ils.10 for ; Tue, 21 Sep 2021 23:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o5dcZNS1jB3ij2bEKaW3MxKb1lTCx5+fcPK9f+WD9ww=; b=plXpElKUms2eEC3v0dBvr81tIgtX4g3HyvS4TwZZ1IwE0GlEdV8zm+mjUr9ICQ7fvi fBb7oAWTFWtXwOQukpr5K7e5i0vfNPlQcgKrIa8SNxgPtY/xq/2kZh8lFPDcyF2VhpZT zZIJdLSw8OG89pf1aN3zgTvwu4huw+n+6JqdEmhttRKkaaZDkpQ+qLqPAJakna0kjZRb YAnO9u38bR+YfRgdCzoBqtWb0f5LvsxWsTgAWybv2miABLCAFrO2EmotPMH1HMbkghNG XsU4bIyVigy5xjVlKCaFl3QDCw51B3DtJnWKapEea+Bu5zGqJ0rboNhjlTdRpL7Q/e10 KFqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o5dcZNS1jB3ij2bEKaW3MxKb1lTCx5+fcPK9f+WD9ww=; b=mS9yYRLiR9Zjk2JwTiYtrfLl7UUEff0TGh+kOhGu7A3bAhTPkIzvnJZBnFlipPJVdF KFv3WqHE4p8ofpUlgUztVhzF1ofOjBZoEiIj/xpY4AwUX7yPgFvRredrwSKA2HQtcDZ7 KSkDtfu621PwLb4l4Nx1YRPY+1B+9MqZKEKKM80aaCXJbZpIFoedG+up4MaoMERmdfbq P0lRfu0sR9fpmFhn7IGtAe9uQEv4Kmyc+browBKp6rJr1ZNF7ENqU1CPJroFX07AxNWw jI0daCn7xLBfuP0KOzN1VSBjZ0jt68qk070C1kE0HwdTHWu1VU4K98z/I95He2MA2bLS isVQ== X-Gm-Message-State: AOAM530GIto97JeBYAIZ4boM1Cxv3SZGZ1tEIEpao8sp6bziFcsWv/OU nRE6tZijG1KE/oFck10UPxTt7+8E9a6vn39bI/g= X-Google-Smtp-Source: ABdhPJyBhPGsRl9OOFcdtA+NRpCrgUqBhLxxQGSpKVQZl1rS6i5jfAeOH4QS981jcnPqnHLY1lpd0g== X-Received: by 2002:a92:4a10:: with SMTP id m16mr24785957ilf.91.1632291283198; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:42 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 02/14] bsd-user/strace.list: Remove support for FreeBSD versions older than 12.0 Date: Wed, 22 Sep 2021 00:14:26 -0600 Message-Id: <20210922061438.27645-3-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::132; envelope-from=imp@bsdimp.com; helo=mail-il1-x132.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/strace.list | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list index b01b5f36e8..275d2dbe27 100644 --- a/bsd-user/freebsd/strace.list +++ b/bsd-user/freebsd/strace.list @@ -33,10 +33,6 @@ { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL }, { TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, print_sysctl, NULL }, { TARGET_FREEBSD_NR__umtx_op, "_umtx_op", "%s(%#x, %d, %d, %#x, %#x)", NULL, NULL }, -#if defined(__FreeBSD_version) && __FreeBSD_version < 1000000 -{ TARGET_FREEBSD_NR__umtx_lock, "__umtx_lock", NULL, NULL, NULL }, -{ TARGET_FREEBSD_NR__umtx_unlock, "__umtx_unlock", NULL, NULL, NULL }, -#endif { TARGET_FREEBSD_NR_accept, "accept", "%s(%d,%#x,%#x)", NULL, NULL }, { TARGET_FREEBSD_NR_accept4, "accept4", "%s(%d,%d,%#x,%#x)", NULL, NULL }, { TARGET_FREEBSD_NR_access, "access", "%s(\"%s\",%#o)", NULL, NULL }, @@ -49,10 +45,6 @@ { TARGET_FREEBSD_NR_cap_fcntls_get, "cap_fcntls_get", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_cap_fcntls_limit, "cap_fcntls_limit", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_cap_getmode, "cap_getmode", NULL, NULL, NULL }, -#if defined(__FreeBSD_version) && __FreeBSD_version < 1000000 -{ TARGET_FREEBSD_NR_cap_getrights, "cap_getrights", NULL, NULL, NULL }, -{ TARGET_FREEBSD_NR_cap_new, "cap_new", NULL, NULL, NULL }, -#endif { TARGET_FREEBSD_NR_cap_ioctls_get, "cap_ioctls_get", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_cap_ioctls_limit, "cap_ioctls_limit", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_cap_rights_limit, "cap_rights_limit", NULL, NULL, NULL }, @@ -146,9 +138,6 @@ { TARGET_FREEBSD_NR_freebsd11_kevent, "freebsd11_kevent", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_kevent, "kevent", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_kill, "kill", NULL, NULL, NULL }, -#if defined(__FreeBSD_version) && __FreeBSD_version < 1000000 -{ TARGET_FREEBSD_NR_killpg, "killpg", NULL, NULL, NULL }, -#endif { TARGET_FREEBSD_NR_kqueue, "kqueue", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_ktrace, "ktrace", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_lchown, "lchown", NULL, NULL, NULL }, From patchwork Wed Sep 22 06:14:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509505 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D598C433F5 for ; Wed, 22 Sep 2021 06:23:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28895611B0 for ; Wed, 22 Sep 2021 06:23:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 28895611B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:53392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvfh-0005Fo-6h for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:23:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWr-0001KX-Br for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:49 -0400 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:42888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWn-0007T1-C7 for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:49 -0400 Received: by mail-io1-xd32.google.com with SMTP id b10so1920123ioq.9 for ; Tue, 21 Sep 2021 23:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MC3awmL5TaW0wcLRlKah2nBls+h6DuoytKG/ajQlDzU=; b=SEIkpoQoTZ7lkK4RPEz0u5mCTDSK36Wrad2KX/4tPkHNH7J0Y7wFR5b/EJKP/fib20 rQJAxJ/Cy8SetDQoqOvSnlgoN6FWl0IFHDgw07qkUXn1PmIVFROrurN59atLYx0qvJvF lD7i43ThDSE+CQcc4N/bShkCu2nOTGr5X8FopjrvD9Qz9EIG1hybQrgs7p9IVdPBjFLc bXa7ah59Rz2SIHhhLy8yp1YUpLMe0YtFNRcEvh2I7FI5gDD+Znw0q/5Y2a3tTQhogL+2 vb0WrYp6RqlYial9YA152ja3bDp3fL4pt3LuvwATnPfMpl/JlJz6Hbz4sfRTzmxE3eou 8DvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MC3awmL5TaW0wcLRlKah2nBls+h6DuoytKG/ajQlDzU=; b=V00KIyMq+UsMZOjUDPMsy7uVKUO84Ha0evXw8bvZCJefp6ed/TKqALpqrUgeGLDBtU 1W/ooln+ZsA9oHMDuAhniXsXuRRS6X0kOgVNXf5kg4FhzBEVK3T/b1O6s4ofm8PaG/WM jm4i0oYe2CW6X536BUhNy81mOJzPrxzY1hhT9gl81ssqyL5kkb0xdb8KS8xfvLuN0uOR jZ278TDFI9pugdrL3Zzv069PKefveBsnjCpeflvsOfp8A9ht0f4XdKSsnWn05r/9K2DP alLz06TLQ5R8gLPcVisaHuc6h9ZhopB78q6PqY3cVgzU1FEk5+pD4pHP2ZYxFlG8PMFr W04Q== X-Gm-Message-State: AOAM533mHv5RAH+yb4iRxXgi5YYR3dbWpZN+oRlT4jMAKgcD+4rQm4GU Sh0ehV3R7hMdVn0rueLbycn5hhsXLziuvF3dYHo= X-Google-Smtp-Source: ABdhPJxGZm7R5x8J8xQM6Jk4AOUb4lUwLO9Gpj6KZJyJIR/p5WnK40weUriY+YIHT//Xftqz0MGfJA== X-Received: by 2002:a5d:8185:: with SMTP id u5mr3077158ion.173.1632291283995; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:43 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 03/14] bsd-user: TARGET_RESET define is unused, remove it Date: Wed, 22 Sep 2021 00:14:27 -0600 Message-Id: <20210922061438.27645-4-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d32; envelope-from=imp@bsdimp.com; helo=mail-io1-xd32.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/i386/target_arch_cpu.h | 2 -- bsd-user/x86_64/target_arch_cpu.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/bsd-user/i386/target_arch_cpu.h b/bsd-user/i386/target_arch_cpu.h index 978e8066af..b28602adbb 100644 --- a/bsd-user/i386/target_arch_cpu.h +++ b/bsd-user/i386/target_arch_cpu.h @@ -23,8 +23,6 @@ #define TARGET_DEFAULT_CPU_MODEL "qemu32" -#define TARGET_CPU_RESET(cpu) - static inline void target_cpu_init(CPUX86State *env, struct target_pt_regs *regs) { diff --git a/bsd-user/x86_64/target_arch_cpu.h b/bsd-user/x86_64/target_arch_cpu.h index 5f5ee602f9..5172b230f0 100644 --- a/bsd-user/x86_64/target_arch_cpu.h +++ b/bsd-user/x86_64/target_arch_cpu.h @@ -23,8 +23,6 @@ #define TARGET_DEFAULT_CPU_MODEL "qemu64" -#define TARGET_CPU_RESET(cpu) - static inline void target_cpu_init(CPUX86State *env, struct target_pt_regs *regs) { From patchwork Wed Sep 22 06:14:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CDE7C433EF for ; Wed, 22 Sep 2021 06:26:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8660611B0 for ; Wed, 22 Sep 2021 06:26:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C8660611B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:59352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvi7-0000yV-1R for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:26:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWs-0001M9-Qp for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:51 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:42891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWo-0007Th-NF for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:50 -0400 Received: by mail-io1-xd35.google.com with SMTP id b10so1920157ioq.9 for ; Tue, 21 Sep 2021 23:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k8/U+V4On1a0jp4LKCee8f0RCpT6m/1m5ZiCNYWdnpo=; b=A6l3w4ljprehLgyZOZHVTFuh2RNaBYHjVxgGJZqahzuqib9eDHNB5cPnQWiJwc+Pft wSfss0jB8NoGR/wxvsJao4tYZfkcckRmBWbvIEp67CKix8/S5M6I1Au7dfR/W2WDu+gj U6olBcnkL6VWGZiM5IdZ5KSzyycAw1q8i8FLQ1gKXwDiRpIPx/HH/X+OPvfeEiywcww8 ugHhdzu/Zu7xw7zB3UWaGN2mxKg4+1++QisJ4tCiSN3S8WQV3EpmVDArvr3oh8sg1Ziv SYIn1j+1mD/ueMMzlyFWjFdNw35kFNoEI7VwV1l4cvjn3oOss8WUvN3BHV0j4T1qFlkn +CCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k8/U+V4On1a0jp4LKCee8f0RCpT6m/1m5ZiCNYWdnpo=; b=I2FtmCdB7k8X1vOwEVaPlDq6Xc7GOJCsap2gESDnUAqOFPzuNLrK+2YXYp14kbsM6W GezqxZrsq7eXm1zKx7CNnqsIkWGyOuCP3RyS4xGBjgsoEKgnsWZ9BuS7l6igkBXWX92w DK1fqolCK3exFwIt0UKFl27DNj9SIyBxRv3uji542wClngWq2YpHfbi/sVWOWFEVHqG6 369WjgK86EvlmndMW2bujXxwcX49YJ2D3r6bCaao0h8WQa7QnmXUYYNvnlKPtwUy347B Hhn3JarfFlsSi10fNn1fCSrMd9t6nbu3N6jkuSH1IIRTGTMhieVVGf9aNhjxMyv038up zw7w== X-Gm-Message-State: AOAM531U/0EPXEvimumw/f6mijo8I25y/EktLWhvIx9gtx04u8e1keKA zPekFW37uElUkXEW1n/FrJE6LyMmnsRcFwDJt9c= X-Google-Smtp-Source: ABdhPJxxNdGUhzUqgGen+xs3Ibs34WwTwn7gbS5nVZQc+QtCHSq9i8McrdT0eZkEKl4p/AJ+jOxSBg== X-Received: by 2002:a05:6602:117:: with SMTP id s23mr3128645iot.124.1632291284743; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 04/14] bsd-user: export get_errno and is_error from syscall.c Date: Wed, 22 Sep 2021 00:14:28 -0600 Message-Id: <20210922061438.27645-5-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Make get_errno and is_error global so files other than syscall.c can use them. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/qemu.h | 4 ++++ bsd-user/syscall.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 522d6c4031..22fc3a6c30 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -235,6 +235,10 @@ extern unsigned long target_dflssiz; extern unsigned long target_maxssiz; extern unsigned long target_sgrowsiz; +/* syscall.c */ +abi_long get_errno(abi_long ret); +int is_error(abi_long ret); + /* user access */ #define VERIFY_READ PAGE_READ diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 372836d44d..a579d52ede 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -33,18 +33,18 @@ static abi_ulong target_brk; static abi_ulong target_original_brk; -static inline abi_long get_errno(abi_long ret) +abi_long get_errno(abi_long ret) { - if (ret == -1) + if (ret == -1) { /* XXX need to translate host -> target errnos here */ return -(errno); - else - return ret; + } + return ret; } #define target_to_host_bitmask(x, tbl) (x) -static inline int is_error(abi_long ret) +int is_error(abi_long ret) { return (abi_ulong)ret >= (abi_ulong)(-4096); } From patchwork Wed Sep 22 06:14:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF0FFC433EF for ; Wed, 22 Sep 2021 06:17:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6427460F12 for ; Wed, 22 Sep 2021 06:17:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6427460F12 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvZW-0004Hu-KU for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:17:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWq-0001JE-CW for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:48 -0400 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]:33477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWo-0007UD-SI for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:48 -0400 Received: by mail-io1-xd2b.google.com with SMTP id n71so2056347iod.0 for ; Tue, 21 Sep 2021 23:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BV9QoUo+n57AQjEYGXu9vkmc6azqGybk3j9BhDuzsdQ=; b=T1ehAf+3/evmWRqM3hwWgif7dpbEDslpmnuOTqd3Bm9jIYZ+ULqsnPHQIWSJVVAQ5j d5ViJ8V7IXitITMp8KSvvOhzT3vYHJYGFKAzJmmjm3s//0TFdeLVAASVT+oUlVbsZKRs yk8JS2O65OFOr7GJgP0JyhwXd26NDxvQtXTrKgYZGguCvusGHCVQ5rhl2TBaMFSBpLGU ckILLXI7beBAYKkqvHPr1Lp3cao4GfP98f3hHEcrXLmqZq0iDUzNX/lAGCWjyXsT8oLm AmGPqHLZDUhmxPjzj9LyjxO7hO5Y1Q949+enryQlOnVkn0HIBek3n1vBMkVVy1ShI6AZ ZtoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BV9QoUo+n57AQjEYGXu9vkmc6azqGybk3j9BhDuzsdQ=; b=bi+yw74e1qRk0lCy4iaFX+q+naJciGYPVm5IcmZMyRKYCvvqkHRtJGEnPkrMLtTSLw hHJASIEmqbDzszZSZGsBJx11A/TMOycrPUvn10UGLd27eUVvedTVB25nJcJSmEXNDt3R P7ugk6CZ0lK0RuxDNBYein4dh4ndot+3wkaYAZi4Wc1H4Wb/vuNxpPj4UfHg5kSVd3KY LnwHi25rYeTzNFw53qn9Xu1lSHvJYIBDSCWHZNj9XAEnKApY+gsL7kx4CSP6iMGTHQhU cqcHo090xOR8Kmq7QMCGhB/5c5rSpoxK4JFzWa7/3strNAjOWwPFEIw8NUn6SsU3V6am g6IQ== X-Gm-Message-State: AOAM5301iEouznsLeNVnekhqxwCX+Jz/WRv6sptd74VY1A7HNShkoM1U F3zW05Kjqivrzyse5QoKA+gkxyFnawDEVunY/wc= X-Google-Smtp-Source: ABdhPJwZJfEIAUjiyHoKUal0RWZ1Ylxg+WKTSNchShls2AeHWTkq4hAr33M3MuxDyh++XhB/2XmEGA== X-Received: by 2002:a5e:a60e:: with SMTP id q14mr2976710ioi.55.1632291285646; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:45 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 05/14] bsd-user/errno_defs.h: Add internal error numbers Date: Wed, 22 Sep 2021 00:14:29 -0600 Message-Id: <20210922061438.27645-6-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2b; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2b.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh , Stacey Son Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stacey Son To emulate signals and interrupted system calls, we need to have the same mechanisms we have in the kernel, including these errno values. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/errno_defs.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bsd-user/errno_defs.h b/bsd-user/errno_defs.h index 1efa502a12..b538dd93da 100644 --- a/bsd-user/errno_defs.h +++ b/bsd-user/errno_defs.h @@ -1,6 +1,3 @@ -/* $OpenBSD: errno.h,v 1.20 2007/09/03 14:37:52 millert Exp $ */ -/* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */ - /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -37,6 +34,9 @@ * @(#)errno.h 8.5 (Berkeley) 1/21/94 */ +#ifndef _ERRNO_DEFS_H_ +#define _ERRNO_DEFS_H_ + #define TARGET_EPERM 1 /* Operation not permitted */ #define TARGET_ENOENT 2 /* No such file or directory */ #define TARGET_ESRCH 3 /* No such process */ @@ -147,3 +147,11 @@ #define TARGET_EIDRM 89 /* Identifier removed */ #define TARGET_ENOMSG 90 /* No message of desired type */ #define TARGET_ELAST 90 /* Must be equal largest errno */ + +/* Internal errors: */ +#define TARGET_EJUSTRETURN 254 /* Just return without + modifing regs */ +#define TARGET_ERESTART 255 /* Restart syscall */ +#define TARGET_ERESTARTSYS TARGET_ERESTART /* Linux compat */ + +#endif /* ! _ERRNO_DEFS_H_ */ From patchwork Wed Sep 22 06:14:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF7BEC4332F for ; Wed, 22 Sep 2021 06:19:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6978861184 for ; Wed, 22 Sep 2021 06:19:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6978861184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvbq-0000sp-KW for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:19:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWr-0001KA-3W for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:49 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:39539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWp-0007VF-Ka for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:48 -0400 Received: by mail-io1-xd2c.google.com with SMTP id m11so1954056ioo.6 for ; Tue, 21 Sep 2021 23:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aFgEL8mrMZNllBbU4xUNPil8wKGkgxSBpv3vMZ0WcBY=; b=qsvlOohAma5CQHTYyDXVsOgCdI9whLaVpSM1jR7UUDybhr3P3QT0xhqsRp7SrbCCI3 7z22urn+bo7rP0N88hFFLEraMJlqqBdw5vlMS7BUeM8EbeCVxoldOjOxmnZQg4qZhnL+ aq32Ah2nwVmBlkfL+fGfpK7eA09uMkmZZI2khQt+1mfAXlESYiHhSAglxAkN13daYyQW dHXtWHZVqhquiSPpQ4RAAZWb+ZgLqnSC59RYjTpQ9xBO9d26YYdStsr9282l4BN5YZeU x5iZOd2x3rSvaJQbjZCxw5FkQsF1xRnAm8GxT+C4q6TwRuOGGOjFuui/L6NkO5Yt61v4 v9Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aFgEL8mrMZNllBbU4xUNPil8wKGkgxSBpv3vMZ0WcBY=; b=E0DN4OoD3WX6qiyW07CWlqJxT/ZhEH7pKOmHZYvMVzINfS3WJEAn9DvEdXfepoIJuU e+oSXiZKD7oChdQ1TfSsEQdePM8wXToBFAZlcwDKifuHN5Nlfj2xLDFOqlUWkbMm6Xbz kppdA+K8J6UuAdscH6k/3xzwQ47XfjOLtvvS0wR2U6uAXLIg0lqMiPe/q5JEXraPEDhx 5H4K484fdIGAh8BIFzVffnWqOW/Fr2LCJcp1UGceIn+Yb4EIAgPgBP5wBOhKZn3ITaEm AUSSRkbnoF2rnPOX6+NeMgk93XTenWH5JH24/4OykAUId8gGbVNq6zO48AdZ58y0Hk08 1PWw== X-Gm-Message-State: AOAM5326VfHdsl6cZ062i7NEYVaWPX1uQWITMEeA+xtpTS+BECbC4CJ7 uHXJlY7H6/3ZBNW7oO6OGA+hlB7ZA2R1/+Bx9vU= X-Google-Smtp-Source: ABdhPJwsnQUEdMLsWtsekigal3pUSpyhdRRVNHIYXnV1D+dBQJ1W7ZViixhdLIZHXTNH9/IIOoYixQ== X-Received: by 2002:a5d:894c:: with SMTP id b12mr3009638iot.83.1632291286398; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:45 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 06/14] bsd-user: move TARGET_MC_GET_CLEAR_RET to target_os_signal.h Date: Wed, 22 Sep 2021 00:14:30 -0600 Message-Id: <20210922061438.27645-7-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move TARGET_MC_GET_CLEAR_RET to freebsd/target_os_signal.h since it's FreeBSD-wide. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/freebsd/target_os_signal.h | 3 +++ bsd-user/i386/target_arch_signal.h | 2 -- bsd-user/x86_64/target_arch_signal.h | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bsd-user/freebsd/target_os_signal.h b/bsd-user/freebsd/target_os_signal.h index 3ed454e086..9fcdfce003 100644 --- a/bsd-user/freebsd/target_os_signal.h +++ b/bsd-user/freebsd/target_os_signal.h @@ -1,6 +1,9 @@ #ifndef _TARGET_OS_SIGNAL_H_ #define _TARGET_OS_SIGNAL_H_ +/* FreeBSD's sys/ucontex.h defines this */ +#define TARGET_MC_GET_CLEAR_RET 0x0001 + #include "target_os_siginfo.h" #include "target_arch_signal.h" diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch_signal.h index 9812c6b034..a90750d602 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -27,8 +27,6 @@ #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ -#define TARGET_MC_GET_CLEAR_RET 0x0001 - struct target_sigcontext { /* to be added */ }; diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_arch_signal.h index 4c1ff0e5ba..4bb753b08b 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -27,8 +27,6 @@ #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ -#define TARGET_MC_GET_CLEAR_RET 0x0001 - struct target_sigcontext { /* to be added */ }; From patchwork Wed Sep 22 06:14:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01950C433EF for ; Wed, 22 Sep 2021 06:24:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA89661184 for ; Wed, 22 Sep 2021 06:23:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AA89661184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:53544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvfi-0005M9-Q2 for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:23:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWr-0001LQ-S4 for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:50 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:44630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWq-0007VX-Dd for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:49 -0400 Received: by mail-io1-xd31.google.com with SMTP id y197so1881342iof.11 for ; Tue, 21 Sep 2021 23:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9zW08+Vc3ElhFXMnF/RFJwdGBp3FBijIjwjDeGhfTQ0=; b=vsX9F6F7yn6EkXWxsTkaoZzqcaodZcBx4/Xi+fvk6CutK+tWVdEX/p7YUjnld4Z0Cv U2Obvm8DY9TCGpEvezHQwj5uRn1Afi7MmMZGnzQAc1bHNzvU627nAfMDbr6zEWxerBir B1MYrIC33wKVcSvSb52/zzycm4Xc7imA83mYOwiXj3Syf1xv1+ScbucnFfsRLGlzM10a XJ1pElg9F8/Xf+x94jfgQlUJwuK5H5XsmLp5wdGqokgDBv9GIo1BLSM6YIKGfuPO+bqE E0xIPMjaA+e4jiPNl8IcJK9rpMGI/gTM/k8ZcRnFASuIQBpA7Yp7/ePZJd4Yf284zBdr 073g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9zW08+Vc3ElhFXMnF/RFJwdGBp3FBijIjwjDeGhfTQ0=; b=ebY5yhi66dzztPphqkfbmi3/ZylzYc1bOTne/LC0vHDJD+wXXv//kHpA25OgxNCVXO Wp+O7WaThfdq5SaMPWk7aGRPkpoyAiai+u6fHXJq2HPBWGFQ/Z02GG2V7KNAHqCEP8ZL 77tBShZg+M4e/QsANS5nTIBLgIF65ln8uLPcLXdFlZZRZ+OARg8svSVxZBYKnFR2s0xu HUXtFlSsKTi8KQ9moXjxt+40bMCDtEQbDA88eEXgomNMi8FtD5rGlQ2jiE1yq2wYvNXp lJCoRGKsu5miwwRiQbh8EjjmKwu8ZhU/FLqOVYODv5+DS7T/ph7L3bZgDwGYtk1sCSlc zw2g== X-Gm-Message-State: AOAM530BhVfD6wV441iaXti/ejl7e3uu2+hLj0k+yZidl+VclreY+X+K dVjBFgJE6L6biCDZ29pFxOkPkjDmEDOClpK5mRc= X-Google-Smtp-Source: ABdhPJzyMJIzvp8sgf3lb/Oi1vV1DMODeWSb+m/C/6BUdqKfsSVJ9MN7S+CoVbDP7XIVlWM97uqjPg== X-Received: by 2002:a6b:5918:: with SMTP id n24mr3130712iob.108.1632291287105; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 07/14] bsd-user/target_os_elf.h: Remove fallback ELF_HWCAP and reorder Date: Wed, 22 Sep 2021 00:14:31 -0600 Message-Id: <20210922061438.27645-8-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" All architectures have a ELF_HWCAP, so remove the fallback ifdef. Place ELF_HWCAP in the same order as on native FreeBSD. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/freebsd/target_os_elf.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bsd-user/freebsd/target_os_elf.h b/bsd-user/freebsd/target_os_elf.h index 2d03a883aa..adcffd1ddb 100644 --- a/bsd-user/freebsd/target_os_elf.h +++ b/bsd-user/freebsd/target_os_elf.h @@ -38,10 +38,6 @@ #define ELF_PLATFORM (NULL) #endif -#ifndef ELF_HWCAP -#define ELF_HWCAP 0 -#endif - /* XXX Look at the other conflicting AT_* values. */ #define FREEBSD_AT_NCPUS 19 #define FREEBSD_AT_HWCAP 25 @@ -114,12 +110,12 @@ static abi_ulong target_create_elf_tables(abi_ulong p, int argc, int envc, NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0); NEW_AUX_ENT(FREEBSD_AT_NCPUS, (abi_ulong)bsd_get_ncpu()); NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry); + features = ELF_HWCAP; + NEW_AUX_ENT(FREEBSD_AT_HWCAP, features); NEW_AUX_ENT(AT_UID, (abi_ulong)getuid()); NEW_AUX_ENT(AT_EUID, (abi_ulong)geteuid()); NEW_AUX_ENT(AT_GID, (abi_ulong)getgid()); NEW_AUX_ENT(AT_EGID, (abi_ulong)getegid()); - features = ELF_HWCAP; - NEW_AUX_ENT(FREEBSD_AT_HWCAP, features); target_auxents = sp; /* Note where the aux entries are in the target */ #ifdef ARCH_DLINFO /* From patchwork Wed Sep 22 06:14:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69675C433EF for ; Wed, 22 Sep 2021 06:26:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34B3E60EE5 for ; Wed, 22 Sep 2021 06:26:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 34B3E60EE5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:59516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSviF-000150-Ld for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:26:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWs-0001M7-Iq for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:51 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:33480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWr-0007Wn-6j for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:50 -0400 Received: by mail-io1-xd2e.google.com with SMTP id n71so2056436iod.0 for ; Tue, 21 Sep 2021 23:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zdMf1pNNEOvkez9WfeJ2j4FMzgl9gPUSEytioy1vA84=; b=Z7yUD4RrJ8NMlIev2cx3rK2JzwVUtYEiZBMtwJ4S+o1UtCF5vuVjrGETVgkLWqesCF 8j7ytjafFo+KSullRGPhW3UjKNvuS6DucIlz9nTGS+4lnHB1RBEDaZW86iU8yVI3detL Bjk9xEGo+RmcJ4X2JXYyed/R5YnHZgl1tWOj/LykkR4NQ+sMZVA/FuPo3GcBBtHKd3/l NgUmGZ/VJQGiwMpGAq4tZaf0yrnDsnDlZYTb6eZh5bX26tjC69c1A+GSqgh1rcEL/3vn g96MCL3Ik6BVDTjv/5+RFMzVLFCR1oEwDwCVxl6y08qhR2gQ7TJJkEn41BkzbCrS730o Ek8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdMf1pNNEOvkez9WfeJ2j4FMzgl9gPUSEytioy1vA84=; b=F2dEzFUgGrbBAPR2Lf3+t/FnO+G7kYwQ/vOos/VgWd4dAvrkzqZdObuC8LI1+fLVW7 4L7a7TMLDTqGJTNutF+bbiB4nkEDPkaYxRIdXivtlziGiM/lvdjWXj4RAkXHdWwM9WaR xxh7qVBwb5mDA96bBImcRR85s+rjXpoCC2B/hobrDBxM3+pf1VDo/w3PfkFONYWj2k8v JGbmnBkpGtZBSq4aj01yzZl5b1qv0elh6Hvop4Wcld7OtljcIhwJf98Ws72ZDpgOR3Zb XWIWm9lv9PcPrhR46Ysn0Yq0+vvLQH+q9YCP12CIHgrnX8DokKHPdUX4uOm2N6WNVhar W8iQ== X-Gm-Message-State: AOAM5322sP5E7XbFH9bi4/2XzOhIfpSQaBIQgcWT4u9HSkYtRUtpbI4H NPyJQNNtq87q0iW4Zl255bpLj1ee204AyroESSg= X-Google-Smtp-Source: ABdhPJyhHeC2F4WyKi2VXDgp9nqv1i/Dy6QaqA6TpV1tUylsq9abzXDN/qjQxIp1OciMQshWV3hPsQ== X-Received: by 2002:a6b:b785:: with SMTP id h127mr3052597iof.149.1632291287887; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:47 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 08/14] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it Date: Wed, 22 Sep 2021 00:14:32 -0600 Message-Id: <20210922061438.27645-9-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Some architecutres publish AT_HWCAP2 as well as AT_HWCAP. Those architectures will define this in their target_arch_elf.h files. If it is defined, then publish it. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/freebsd/target_os_elf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bsd-user/freebsd/target_os_elf.h b/bsd-user/freebsd/target_os_elf.h index adcffd1ddb..e5ac8e8e50 100644 --- a/bsd-user/freebsd/target_os_elf.h +++ b/bsd-user/freebsd/target_os_elf.h @@ -112,6 +112,10 @@ static abi_ulong target_create_elf_tables(abi_ulong p, int argc, int envc, NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry); features = ELF_HWCAP; NEW_AUX_ENT(FREEBSD_AT_HWCAP, features); +#ifdef ELF_HWCAP2 + features = ELF_HWCAP2; + NEW_AUX_ENT(FREEBSD_AT_HWCAP2, features); +#endif NEW_AUX_ENT(AT_UID, (abi_ulong)getuid()); NEW_AUX_ENT(AT_EUID, (abi_ulong)geteuid()); NEW_AUX_ENT(AT_GID, (abi_ulong)getgid()); From patchwork Wed Sep 22 06:14:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5CFEC433F5 for ; Wed, 22 Sep 2021 06:28:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8891860EE5 for ; Wed, 22 Sep 2021 06:28:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8891860EE5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvk1-00040t-Iz for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWu-0001Mf-6t for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:52 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:47012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWr-0007Y2-UU for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:51 -0400 Received: by mail-io1-xd35.google.com with SMTP id d18so1869752iof.13 for ; Tue, 21 Sep 2021 23:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C+QUksFYJBVgzYVm/3aEzfq4ZdDqNAp+FTVgi1Z07d4=; b=UND0PXOiiOFNGWcBVQESCGuvGjd77AUEEOK2v1aAKyc6yUGrbYEPrjb5g7VNbWoGwf dTHla6Fu2aVEatoldAuAZLSzEV+uD7PAnL7b/aZ8U6brWkk9ukBA6p2g4xNta+4MjCWG eYwbAcu7gniSlpwXuBvaGmjpl6BgZEc87l94mN/O768Ncm1rNKNKxSP3NlOMlqKaS4uB D1NVV9HwDmFuPX2vCfCoPN3nfmz0tbh6qRiuCloQ2v2IIqv38TdT5tehnj4ZUFdSJTla yoCITVZtoqJ83CjJtAKjN/bHiiGVO+jfJAOHV8vXG44opHRP2Rbi3zzqATbKLjnawllX 94hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C+QUksFYJBVgzYVm/3aEzfq4ZdDqNAp+FTVgi1Z07d4=; b=lCm6ELpOD7L0BU3u+l9OUqd8Qu/8OVBtfJrWdUrAWaFT5hBSACKp9u1UTLs1HUlZUq I+OUGGEzMAR4NdOMFGG1gzR4khJ4ZIyRl7Shg7Nrw/njtSXW+jXlLBuxDP3uPvM7W+ri +093gB+HJgdzGS2dqUwfPsdMeEcNsyy/gkZPVpFny0+i9D6g4/syj0M6/gNIrsKLcTVJ XgwV6JCk0kl0YhLaCAhZ6LbQJ4mKe+CBAdHryhcGAYhK9EuddY8i2pxCj9bRDwKijLCV /05RYjPQIhZuzK4jH0ZhlaNq+2zbuEfErlVXtRKvTAfQuh9Hzq+8QVBevcgEMIm9dKXn dwfw== X-Gm-Message-State: AOAM533rwQrsnUQjT/uf+yxiYC9dLqAXW4Gpig8TkXWD4oMtu/+N/B5B 6xgxZPIP4d0AhnAdtO00eC+0diC34pTWJEXML0s= X-Google-Smtp-Source: ABdhPJwAstGHcrqu/qTRxMuZ8Q77dy+HQQeyTR75bgAMB9DR+Wdqnk4wKb79/XlM/mWRQ/MXkZdj+g== X-Received: by 2002:a5d:8b8d:: with SMTP id p13mr3045906iol.216.1632291288638; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:48 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 09/14] bsd-user: Remove used from TaskState Date: Wed, 22 Sep 2021 00:14:33 -0600 Message-Id: <20210922061438.27645-10-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The used field of TaskState is write only. Eliminate it. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/main.c | 1 - bsd-user/qemu.h | 1 - 2 files changed, 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 48643eeabc..ee84554854 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -210,7 +210,6 @@ void init_task_state(TaskState *ts) { int i; - ts->used = 1; ts->first_free = ts->sigqueue_table; for (i = 0; i < MAX_SIGQUEUE_SIZE - 1; i++) { ts->sigqueue_table[i].next = &ts->sigqueue_table[i + 1]; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 22fc3a6c30..431c5cfc03 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -92,7 +92,6 @@ typedef struct TaskState { struct TaskState *next; struct bsd_binprm *bprm; - int used; /* non zero if used */ struct image_info *info; struct emulated_sigtable sigtab[TARGET_NSIG]; From patchwork Wed Sep 22 06:14:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9055DC433F5 for ; Wed, 22 Sep 2021 06:31:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 421CA61184 for ; Wed, 22 Sep 2021 06:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 421CA61184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvmb-0006vb-4z for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:31:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWv-0001My-9K for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:53 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:41594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWt-0007YY-Ty for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:53 -0400 Received: by mail-il1-x130.google.com with SMTP id d11so1547309ilc.8 for ; Tue, 21 Sep 2021 23:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tTYEl08M4St6iVesKv7dwzZY/X4yBWzxZk2xR7dqYNI=; b=Q7x9A9mgG0iHiLtvbrWYUnwpMYuOymJ5zpBK4efasx+FLaZVMWd6dOfw3eClmbXKNF eGbgp7tMoUOvm4UPqc6Piozpppxn8PBZhgWpyf3Bqeb2bcKSvm/g/vF9OPBiMPHEbC4k /ErjcqHa5U5zr1ig4pbCwzw6qPhcTx8zNKIOHDLKKY2fWmY3aBYnOmZ+5d39aN7qc042 yQQMLERth/0W17VMG3tfstBP/MdenoVcUWg6LYxbnumEIDOHVwpUGwGBpyQHaH30QNIA 9W3k68fLePxg4DXE1lIebolswTcvaSHCpDHfJU4itHGZDNVO1ECf/A0M9ayPzzOidxfv 9JYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tTYEl08M4St6iVesKv7dwzZY/X4yBWzxZk2xR7dqYNI=; b=ou4wEBxD4zKHb2cYoAJuODdLxOguOPAOubg0jLup7+dBb2N6Ou+mL6j1096Jwim2J8 4V2NgYbcSV7YD0QKDrlKuGDlvQ/FEjTu0+5VNKdgoUNRxz1AaeTmGdtYQvQa9vu1S3CB oWyAUhMMI3uU9oRWizYyO+qytdD3sBhJVXko+z0sl2Ay3KTY9LXbdUkOlGA3Nx7r/ueg PRWL7kvKBsqGpl4O65FMjlaCosnq0EW/GHQVSVwFvsYObZuVN10mkzTTHMCN1AKQ3vC4 Skiq4lwMmZn2jbrCEvE4abSnnDNBG/YP1EzIglF66hy5vixyEGa3rGEXxnHIM9Q3cHSs vLZw== X-Gm-Message-State: AOAM531DADfGdAucrWHpivUdDUJKrtA//tcHKTB5ATffiXlSNoyws4BU gO5Z3giiyfgV6M1thJJrZuSp7OXkzuk0EwTad90= X-Google-Smtp-Source: ABdhPJz3xhKNQkVQOhzBxQz8ZiincNZTGBZhwirv9MmNMgwOfHqBqlBVMd4/l/PA07w36T8dsTylsQ== X-Received: by 2002:a92:d0d2:: with SMTP id y18mr24847327ila.80.1632291289544; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 10/14] bsd-user: Add stop_all_tasks Date: Wed, 22 Sep 2021 00:14:34 -0600 Message-Id: <20210922061438.27645-11-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh , Stacey Son Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Similar to the same function in linux-user: this stops all the current tasks. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 9 +++++++++ bsd-user/qemu.h | 1 + 2 files changed, 10 insertions(+) diff --git a/bsd-user/main.c b/bsd-user/main.c index ee84554854..cb5ea40236 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -195,6 +195,15 @@ static void usage(void) __thread CPUState *thread_cpu; +void stop_all_tasks(void) +{ + /* + * We trust when using NPTL (pthreads) start_exclusive() handles thread + * stopping correctly. + */ + start_exclusive(); +} + bool qemu_cpu_is_self(CPUState *cpu) { return thread_cpu == cpu; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 431c5cfc03..4ee57b91f0 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -103,6 +103,7 @@ typedef struct TaskState { } __attribute__((aligned(16))) TaskState; void init_task_state(TaskState *ts); +void stop_all_tasks(void); extern const char *qemu_uname_release; /* From patchwork Wed Sep 22 06:14:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E070FC433EF for ; Wed, 22 Sep 2021 06:33:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BF7961107 for ; Wed, 22 Sep 2021 06:33:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0BF7961107 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvpF-0001a0-7n for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:33:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWv-0001N0-DL for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:53 -0400 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:39547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWt-0007Yu-U3 for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:53 -0400 Received: by mail-io1-xd34.google.com with SMTP id m11so1954241ioo.6 for ; Tue, 21 Sep 2021 23:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LRVf8eRwHcSE1hfiNUjlVhgdMLRdbXotbexroQwEg1Q=; b=XsdcHrF0wVtolPWTjXXv55eINZFlI+u18Gt3EW8TNxVek+41mSECZxZbuyxOjlz79d EWF6oQkLTED/j4YrdpVQwLnM6ve43p3SwmOvIatuJFkyu+gdNDF/e5KwccJ2KsCT2g1N wsh8w8Q23/01gGcY1okqzGxK1wZ7VuBr9OklrAsMEcwS/cVSJ5FzGj+42gdRBaXQHMUp n1mZIDxgdVwldbAh4QOU/+F5JMAOl92qGWJZmQX5iRzvc8zWgbsyk3X4WDPKlGyS6rJL H6mQmlc6pBYXM3ovkcY8x7mFC++cVLkYfuikvR25Lu1RFEQ8zCf4zZWWzuY9Xyv85ebz 75lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LRVf8eRwHcSE1hfiNUjlVhgdMLRdbXotbexroQwEg1Q=; b=p4Wp7vbf3RIo/ySn5yhN6B9VLvZsjugDgsresF6IYSE1MIsehThLorDHTdULJYGr5E DKY6RESGq7QH+RSZX/V2kQsHcvk6E+OPjAxlv6DpQTBqJ0sozLpaGygJ+nwh/Fm/U0Sh fuZbx15G8/HpNjTr3hhgkH3rvQgeFc1rcj84+O5NRuF106M2AYZzZcvkOPn797QZiLQi Zna8QjDfx+7gKZNFVLmUL6SIRjANondpWRZY4kVKdME0bqPJj05eWGQW276U0ZQZ7z8Z VJwoBtVXstDldui+EzCMRrr/hY8okkn/wu48tOE8FIZgRFKoAg811o5mCEnsE+JZksid 030w== X-Gm-Message-State: AOAM532grWOaGa4eGqLCmXWqdcwl0zPrfqel35J4trC5y7bpk8ASZZMT zKvb7I8AEFAYoiE6CIxuEDhEl3paQUVu9nLN5z8= X-Google-Smtp-Source: ABdhPJxSwP/9o2g2iAZTDUFGyOMMmkNIAlZM83c3S+3lkBZuNKtQFNUK+HnhkFULWAx+Ids6sqVlYA== X-Received: by 2002:a02:90d0:: with SMTP id c16mr3432217jag.106.1632291290334; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 11/14] bsd-user/sysarch: Move to using do_freebsd_arch_sysarch interface Date: Wed, 22 Sep 2021 00:14:35 -0600 Message-Id: <20210922061438.27645-12-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d34; envelope-from=imp@bsdimp.com; helo=mail-io1-xd34.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Convert the #ifdef'd i386 code to calling the i386 sysarch code we have living in i386,x86_64/target_arch_sysarch.h do_freebsd_arch_sysarch rather than having a separate copy. This is in preparation to remove it entirely. Signed-Off-By: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/syscall.c | 45 +-------------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index a579d52ede..9bc72501b2 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -91,50 +91,7 @@ static abi_long do_obreak(abi_ulong new_brk) #if defined(TARGET_I386) static abi_long do_freebsd_sysarch(CPUX86State *env, int op, abi_ulong parms) { - abi_long ret = 0; - abi_ulong val; - int idx; - - switch (op) { -#ifdef TARGET_ABI32 - case TARGET_FREEBSD_I386_SET_GSBASE: - case TARGET_FREEBSD_I386_SET_FSBASE: - if (op == TARGET_FREEBSD_I386_SET_GSBASE) -#else - case TARGET_FREEBSD_AMD64_SET_GSBASE: - case TARGET_FREEBSD_AMD64_SET_FSBASE: - if (op == TARGET_FREEBSD_AMD64_SET_GSBASE) -#endif - idx = R_GS; - else - idx = R_FS; - if (get_user(val, parms, abi_ulong)) - return -TARGET_EFAULT; - cpu_x86_load_seg(env, idx, 0); - env->segs[idx].base = val; - break; -#ifdef TARGET_ABI32 - case TARGET_FREEBSD_I386_GET_GSBASE: - case TARGET_FREEBSD_I386_GET_FSBASE: - if (op == TARGET_FREEBSD_I386_GET_GSBASE) -#else - case TARGET_FREEBSD_AMD64_GET_GSBASE: - case TARGET_FREEBSD_AMD64_GET_FSBASE: - if (op == TARGET_FREEBSD_AMD64_GET_GSBASE) -#endif - idx = R_GS; - else - idx = R_FS; - val = env->segs[idx].base; - if (put_user(val, parms, abi_ulong)) - return -TARGET_EFAULT; - break; - /* XXX handle the others... */ - default: - ret = -TARGET_EINVAL; - break; - } - return ret; + do_freebsd_arch_sysarch(env, op, parms); } #endif From patchwork Wed Sep 22 06:14:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DB84C433F5 for ; Wed, 22 Sep 2021 06:17:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 574A760F12 for ; Wed, 22 Sep 2021 06:17:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 574A760F12 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvZX-0004KE-Hu for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:17:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWw-0001PM-QB for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:55 -0400 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]:39576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWu-0007Z1-Dh for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:54 -0400 Received: by mail-il1-x144.google.com with SMTP id h9so1565553ile.6 for ; Tue, 21 Sep 2021 23:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fBb/Bk54Z8xBOeddOPBJJaFD8BHPUCGJPfhM+8RZ+0M=; b=mpPJVXvr3/BrzQzaYdg+7jrTe1IEk0Z+i9DrHBHkfb8/4tzf45BkFYMSkSDIZz4fbq sk8U7V+i4ICO8ZkLPtAQ8WTPmqMjX3+yy8DThLdrCe34LGGByomzx2dN7uHZwHVFxkAT KS1BT6JJRoNZN+Mu5/ID9U9h/zEbwWDxS7o0nRv7Nn3UWH0IDx+HdW2bVhucYylc3z2x 0v6hKlZSnE/CRSEp868ejCqFk6TApcig5dXw3mou8YN1p02VnmZZEXol9rdcoNv0GOIB JKXIN8v0Uq/3bq7Ssbh1x6XwKNbDoUVj9JenX50A9h8nMJGHEk+jbGvmm6b2d3XTEGZA c1iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fBb/Bk54Z8xBOeddOPBJJaFD8BHPUCGJPfhM+8RZ+0M=; b=QrUGJG2EEHw1YffnzjdY/GmcdPVXy2yYkwP/8VPRVAidixF0cd8G6dtnnQS9hmY9yI IXtqBs3if0TjvO8iH1YeohFT/eqf0zz9PHbkDCkCQtXsXsBSq7yMzeeHGSTr6oRMHScI BNZwiYU/eU5YG11zdS93Xk0ifuFPSR9nREIIUSo0jtHal2XFdjQptRz2VRBX8KBZHWSb 9uAsjgIYUv2JX277RFqkS3XmfjEao/3k1kPQ15jWy7wjk01on0ZpQOieZAx1cLUGgbIs V6JqVIlVsQ1qv7adRi3mDdKgteed0WXhFvvOy1oi13vP8LeBOAQi96XzJ1apUDt6EuG4 niFQ== X-Gm-Message-State: AOAM530gFxtj63j+EOU0C9tYc74JLXRosSB7u498xgOTl4ed91bem9Qd LC0boJ1Axx3peVYJ+3Y+66gSraohoCmrQ3/x43Q= X-Google-Smtp-Source: ABdhPJzh1M2KM27J2vjsYAxeY33F813YoHu/1694SgDFtwrl/UGalJWTEtDvyqHctAKgr1lswO8hHQ== X-Received: by 2002:a05:6e02:156c:: with SMTP id k12mr24479141ilu.61.1632291291078; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:50 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 12/14] bsd-user/sysarch: Provide a per-arch framework for sysarch syscall Date: Wed, 22 Sep 2021 00:14:36 -0600 Message-Id: <20210922061438.27645-13-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::144; envelope-from=imp@bsdimp.com; helo=mail-il1-x144.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh , Stacey Son Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add the missing glue to pull in do_freebsd_sysarch to call do_freebsd_arch_sysarch. Put it in os-sys.c, which will be used for sysctl and sysarch system calls because they are mostly arch specific. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/meson.build | 3 +++ bsd-user/freebsd/os-sys.c | 28 ++++++++++++++++++++++++++++ bsd-user/meson.build | 6 ++++++ bsd-user/qemu.h | 3 +++ bsd-user/syscall.c | 7 ------- 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 bsd-user/freebsd/meson.build create mode 100644 bsd-user/freebsd/os-sys.c diff --git a/bsd-user/freebsd/meson.build b/bsd-user/freebsd/meson.build new file mode 100644 index 0000000000..4b69cca7b9 --- /dev/null +++ b/bsd-user/freebsd/meson.build @@ -0,0 +1,3 @@ +bsd_user_ss.add(files( + 'os-sys.c', +)) diff --git a/bsd-user/freebsd/os-sys.c b/bsd-user/freebsd/os-sys.c new file mode 100644 index 0000000000..756b024305 --- /dev/null +++ b/bsd-user/freebsd/os-sys.c @@ -0,0 +1,28 @@ +/* + * FreeBSD sysctl() and sysarch() system call emulation + * + * Copyright (c) 2013-15 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.h" +#include "target_arch_sysarch.h" + +/* sysarch() is architecture dependent. */ +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long arg2) +{ + + return do_freebsd_arch_sysarch(cpu_env, arg1, arg2); +} diff --git a/bsd-user/meson.build b/bsd-user/meson.build index 0369549340..561913de05 100644 --- a/bsd-user/meson.build +++ b/bsd-user/meson.build @@ -8,3 +8,9 @@ bsd_user_ss.add(files( 'syscall.c', 'uaccess.c', )) + +# Pull in the OS-specific build glue, if any +if fs.exists(targetos) + subdir(targetos) +endif + diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 4ee57b91f0..3dde381d5d 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -239,6 +239,9 @@ extern unsigned long target_sgrowsiz; abi_long get_errno(abi_long ret); int is_error(abi_long ret); +/* os-sys.c */ +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long arg2); + /* user access */ #define VERIFY_READ PAGE_READ diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 9bc72501b2..9f51563abd 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -88,13 +88,6 @@ static abi_long do_obreak(abi_ulong new_brk) return 0; } -#if defined(TARGET_I386) -static abi_long do_freebsd_sysarch(CPUX86State *env, int op, abi_ulong parms) -{ - do_freebsd_arch_sysarch(env, op, parms); -} -#endif - #ifdef __FreeBSD__ /* * XXX this uses the undocumented oidfmt interface to find the kind of From patchwork Wed Sep 22 06:14:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 697ACC433FE for ; Wed, 22 Sep 2021 06:19:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D52B61184 for ; Wed, 22 Sep 2021 06:19:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D52B61184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvbp-0000oH-Da for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:19:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWx-0001Pc-Rv for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:55 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]:34662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWv-0007ZD-5P for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:55 -0400 Received: by mail-il1-x12a.google.com with SMTP id w1so1610902ilv.1 for ; Tue, 21 Sep 2021 23:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K3Gn3xv8FemFjNekMbg6gJlXlkLXoZBMvz48zkc34HI=; b=BXtX0118tKY79WhumSZFZsPF/5oD6Ay2qri5wn3Kggplyk54I/JYx+Se41d9PAfCPx YFHNV0DqiWRuNYI/P9Ilj4gbeUb6cFkrqCuBTqXVGieZ2FnlK9qcVeka9EEb9zTscS7A Xm8Qmi8Bz6RUF+xz+A2ODPWCfHeZAIkZlcEGGRqi4e66MMzps3DY9aOaBrm35dGyzUh8 n9hAhsN40Ow9GtJBPSzbqPnPz/XzPIj76A7GymnhBO2HLP99IBpUEniMtj02TTTen+xx 2cROiD7aWhzv4sLC7u2iOXHbO32IdHHbuU5yvuJz5FB3/EV8WCo5PxoScwWxXM/ka3Ok BWZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K3Gn3xv8FemFjNekMbg6gJlXlkLXoZBMvz48zkc34HI=; b=kIZttZLzyr2Gxc2puBrruzC45pxzKBkmxHTdyiSi7dQNsdrTCLQ9EJ+C9riMFIUzJJ tIkbNuKbfCrizNmQbOEWLaZzsH+ajEZGyaBCBiKnvCH5MK73shfzhIUqkSpd6deo7EKg sY1j3/n6UkR1P3m/r6DTgER3rhnIVGbWNQTNrs40Vv5NvhU2v3WLmQC2ctZl2H0pEm6S 9AgC+WIYHQpo7iBrVwsUVagCWocHeTc62XRmeb/oUhto+zZztcCxthTLeDpowPaW/+5Q ugmfSVtPSKkPhr1+a8ZOnH6uCKXFdOTNUKO3Q9J+SSZycnvQWCgKWnrSANtLjxXceLVM miTw== X-Gm-Message-State: AOAM533ElyP9jhSlaIAg8ayRDt0PvSJRvSXzZPEiWMaqOuZ0kshVSdYA UIqaGikiXHX183s0FMa/OAlUeMEK+TG5gd0Mfz4= X-Google-Smtp-Source: ABdhPJyCX+xBrC7qThFe540QR8sfe2i9BblDosSv48OXl8wO1uEQz+OFFE7XwK+2zuuXTsoUiV+Fdg== X-Received: by 2002:a92:2c0d:: with SMTP id t13mr23645713ile.99.1632291291897; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:51 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 13/14] bsd-user: Rename sigqueue to qemu_sigqueue Date: Wed, 22 Sep 2021 00:14:37 -0600 Message-Id: <20210922061438.27645-14-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" To avoid a name clash with FreeBSD's sigqueue data structure in signalvar.h, rename sigqueue to qemu_sigqueue. This sturcture is currently defined, but unused. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/qemu.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 3dde381d5d..5a2fd87e44 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -73,15 +73,15 @@ struct image_info { #define MAX_SIGQUEUE_SIZE 1024 -struct sigqueue { - struct sigqueue *next; +struct qemu_sigqueue { + struct qemu_sigqueue *next; + target_siginfo_t info; }; struct emulated_sigtable { int pending; /* true if signal is pending */ - struct sigqueue *first; - /* in order to always have memory for the first signal, we put it here */ - struct sigqueue info; + struct qemu_sigqueue *first; + struct qemu_sigqueue info; /* Put first signal info here */ }; /* @@ -95,8 +95,8 @@ typedef struct TaskState { struct image_info *info; struct emulated_sigtable sigtab[TARGET_NSIG]; - struct sigqueue sigqueue_table[MAX_SIGQUEUE_SIZE]; /* siginfo queue */ - struct sigqueue *first_free; /* first free siginfo queue entry */ + struct qemu_sigqueue sigqueue_table[MAX_SIGQUEUE_SIZE]; /* siginfo queue */ + struct qemu_sigqueue *first_free; /* first free siginfo queue entry */ int signal_pending; /* non zero if a signal may be pending */ uint8_t stack[]; From patchwork Wed Sep 22 06:14:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12509513 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AD8EC433EF for ; Wed, 22 Sep 2021 06:28:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB05461178 for ; Wed, 22 Sep 2021 06:28:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB05461178 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSvjq-0003xC-PK for qemu-devel@archiver.kernel.org; Wed, 22 Sep 2021 02:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSvWx-0001PN-6Z for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:55 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:42888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSvWv-0007Zx-OU for qemu-devel@nongnu.org; Wed, 22 Sep 2021 02:14:54 -0400 Received: by mail-io1-xd31.google.com with SMTP id b10so1920646ioq.9 for ; Tue, 21 Sep 2021 23:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NNhKAq0Hehk07nStkX54pJwuqwCV1f5deD76MoX6Rzw=; b=xdTn1jRTAOawVo4jB2+K+E5FRWIY2jMMD5bR7r0slx9yqt72CDfRw8oRI6av/UHvL2 sTBzF9JWUUV33BRVIGnQOOjZVD/7XP++/X31mgOlzRrdkqWg+6B6mlVSqAoUFiE0MKxX YOinPVHD9jzqGeAVdw0WdgMx0r7FMgJVUKv9pBQflypp41/wdMqsMDspUE2H80gVukw9 I3ooIi0qdgN/ykUU3Vk4mh6mrL+9gpvV6cHYGYuNZyS2Ti02ungl/U7VcDdaVhrsGLcj CUSt+/k7Ylewd3qlh4rBf+6lMQTYTm9w3QmLNtz9sWkk2Wd9CYBPiZon1dZagyD97z/H UYJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NNhKAq0Hehk07nStkX54pJwuqwCV1f5deD76MoX6Rzw=; b=Cc1gacJ9G9J5VBOnoa7Me5INMTKNlvl0I1neucoADjY2V/BdWC5zletlhPCXQ0+CsJ rU7b1kDDa3flieNyU7LXbtNlzjsQNH6qD0oxsdwpSUwfs2EpfvbIpUCX3xq/A/VfmY6A pTBUGQ2kSUBWvKV0rgq8tvOQDTpRpTAZWHbh23D6yhc47kMFa+LrFsf6KTpR6Lq70too KCyaq4E3zAgB9bac6K7MgE907gj7sB0fqfS1W2U8b0a9mWaZFWPtd2wFdSG7gAQUoc3m fKT25dvzZN/lFE7QcxdUgWPD8PziAuQgj6GxWcrmFY9eWFXv7DDISNu1FMBHMw9javDh Y43g== X-Gm-Message-State: AOAM5310ziB9hH6suFkoeTeU822vO0Ve24R5Dq8cNbNMfWAoQwaQwjbr EUQ7L79VrJARIO2kWYw1lLvigxA8aPqSk6VyMvk= X-Google-Smtp-Source: ABdhPJyCMEXn1CbJjIwdv7YNlRPH2I39KA4sHl9gq4qKPwlU5aQUjD2LkzcFSyZXNDIZDnRtyMBiTQ== X-Received: by 2002:a02:6988:: with SMTP id e130mr1092054jac.97.1632291292621; Tue, 21 Sep 2021 23:14: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 a25sm540817ioq.46.2021.09.21.23.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 23:14:52 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH 14/14] bsd-user/signal: Create a dummy signal queueing function Date: Wed, 22 Sep 2021 00:14:38 -0600 Message-Id: <20210922061438.27645-15-imp@bsdimp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210922061438.27645-1-imp@bsdimp.com> References: <20210922061438.27645-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Evans , richard.henderson@linaro.org, f4bug@amsat.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Create dummy signal queueing function so we can start to integrate other architectures (at the cost of signals remaining broken) to tame the dependency graph a bit and to bring in signals in a more controlled fashion. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 1 + bsd-user/signal.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 5a2fd87e44..85d1f8fd2a 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -209,6 +209,7 @@ void process_pending_signals(CPUArchState *cpu_env); void signal_init(void); long do_sigreturn(CPUArchState *env); long do_rt_sigreturn(CPUArchState *env); +int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info); abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp); /* mmap.c */ diff --git a/bsd-user/signal.c b/bsd-user/signal.c index ad6d935569..4e7f618944 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -19,6 +19,14 @@ #include "qemu/osdep.h" #include "qemu.h" +/* + * Queue a signal so that it will be send to the virtual CPU as soon as + * possible. + */ +int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info) +{ + return 1; +} void signal_init(void) {