Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1n66J0-0005a5-R2 for mharc-qemu-trivial@gnu.org; Sat, 08 Jan 2022 02:38:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66IV-0005I5-GS for qemu-trivial@nongnu.org; Sat, 08 Jan 2022 02:37:58 -0500 Received: from [2607:f8b0:4864:20::d2c] (port=43840 helo=mail-io1-xd2c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66IT-0003Kl-2Z for qemu-trivial@nongnu.org; Sat, 08 Jan 2022 02:37:55 -0500 Received: by mail-io1-xd2c.google.com with SMTP id l3so10038234iol.10 for ; Fri, 07 Jan 2022 23:37:49 -0800 (PST) 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=0CJ1Uc7NVwXMrqtZuM2QHU3pj5pozei2EyzxXFFoWco=; b=SHfDJFDUazC125ItvH8AGmqOx7Uay+jM5nMBTaXg8PB/gTZkdNfm74nUWe5QXVBaX+ PZQuUZg14bf56BL3OTFpHw7oUdA3exKbY+fxb/0CACoumPcUsd70AlL30ONYxC47sbPS w2TR3JtiFzgDD40OVLzGwAEIZIEwo40ZKYVj5gpr5o8elxfvWLpeHSiqCMc/de8+7DDt jxbYVC41yyFwbu513SJx6jXjxiNv9m3/0UX7DtHjFMEFSW1qGgi902ikv7Q+bXny2XfU T9bvXLY6TEcf8XTvDpfY0ujEx+5OB/vDovmNFKRNFSbormy2hoxIQPoy0jAuAEbj4MbW 7NoA== 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=0CJ1Uc7NVwXMrqtZuM2QHU3pj5pozei2EyzxXFFoWco=; b=vYHvuCQrZSOCqTE8SmdJplAFzJW+xaX2ISljGeMNcI/hJsr1BETxDa41vtCyB+UvHC 78doj0ytl0P4uLHLhcG0ZSxGqs/GAoqE3Q7BziGP1Mx5SdRvDR4jW15HN7mO85fRI+ro m091HStq+NNsvVNo1DG6pX5aD4QYGZss1kVix5XaCK9UFV8B+PCxW8dk30IHTNt92LGo 69XnzAKMYA4Dp5EpHSBAte/0Q1ft5pti3DnDJCf+yiL+FyVmRA2yLlrcW/2S37k/vMok F9iWJ58PTghSPkRJyhjqpbLKkUBKxnAdGItL+sPpQcpXva6fwmDpF4cpsr697eRZx7KL OXOw== X-Gm-Message-State: AOAM532BcaxRVzKaM8HKPRtJ29OqF1RwKZWxqdUmNTnD1HP3YKYQi0Py Jk9obwuVT6pNJzu1bk6sf4DLWQ== X-Google-Smtp-Source: ABdhPJwQXjIoM8U1AntRSkZ8gob+PzHWpdo/JZsiLTcDLPnFVRYR0+d0gNFntGW82OZ02r56eaL+gA== X-Received: by 2002:a05:6602:2c4b:: with SMTP id x11mr5978442iov.12.1641627469062; Fri, 07 Jan 2022 23:37:49 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id w19sm613022iov.12.2022.01.07.23.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:48 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-trivial@nongnu.org, kevans@freebsd.org, Jiaxun Yang , Richard Henderson , Michael Tokarev , Warner Losh , Laurent Vivier Subject: [PULL 06/37] bsd-user/i386/target_arch_signal.h: Update mcontext_t to match FreeBSD Date: Sat, 8 Jan 2022 00:37:06 -0700 Message-Id: <20220108073737.5959-7-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2c (failed) 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: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2022 07:38:00 -0000 Fill in target_mcontext_t to match the FreeBSD mcontex_t. Also tag the current size of mcontext and ucontext to enable size checking for i386. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_signal.h | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch_signal.h index bf7263c4f8d..701c6f964f8 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -28,8 +28,54 @@ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ typedef struct target_mcontext { + abi_ulong mc_onstack; /* XXX - sigcontext compat. */ + abi_ulong mc_gs; /* machine state (struct trapframe) */ + abi_ulong mc_fs; + abi_ulong mc_es; + abi_ulong mc_ds; + abi_ulong mc_edi; + abi_ulong mc_esi; + abi_ulong mc_ebp; + abi_ulong mc_isp; + abi_ulong mc_ebx; + abi_ulong mc_edx; + abi_ulong mc_ecx; + abi_ulong mc_eax; + abi_ulong mc_trapno; + abi_ulong mc_err; + abi_ulong mc_eip; + abi_ulong mc_cs; + abi_ulong mc_eflags; + abi_ulong mc_esp; + abi_ulong mc_ss; + + int32_t mc_len; /* sizeof(mcontext_t) */ +#define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ +#define _MC_FPFMT_387 0x10001 +#define _MC_FPFMT_XMM 0x10002 + int32_t mc_fpformat; +#define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ +#define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ +#define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ + int32_t mc_ownedfp; + abi_ulong mc_flags; + /* + * See for the internals of mc_fpstate[]. + */ + int32_t mc_fpstate[128] __aligned(16); + + abi_ulong mc_fsbase; + abi_ulong mc_gsbase; + + abi_ulong mc_xfpustate; + abi_ulong mc_xfpustate_len; + + int32_t mc_spare2[4]; } target_mcontext_t; +#define TARGET_MCONTEXT_SIZE 640 +#define TARGET_UCONTEXT_SIZE 704 + #include "target_os_ucontext.h" struct target_sigframe { -- 2.33.1