From nobody Sun Jan 02 19:08:18 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 869E1191FA88; Sun, 2 Jan 2022 19:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JRpLW6KMdz4YCR; Sun, 2 Jan 2022 19:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5F9B1776E; Sun, 2 Jan 2022 19:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 202J8IoS057892; Sun, 2 Jan 2022 19:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 202J8Ixi057891; Sun, 2 Jan 2022 19:08:18 GMT (envelope-from git) Date: Sun, 2 Jan 2022 19:08:18 GMT Message-Id: <202201021908.202J8Ixi057891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9cbd1c32b1f9 - stable/13 - amd64 ia32 vdso: add unwind annotations to the signal trampoline List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9cbd1c32b1f99542e30dcf4de3f1e70b20a130e4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641150501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GvRZiMj5Zc3JOf8U7ChrmRlVCZ9iiLkd91OanZivDuQ=; b=vgr0du0OgeVFmi554osp3OxGVG1EXYePu4xX6uDVfctNGnvKCg3lG2X8oyVJqANt6KGvwj tYpN5qwEzs6+5yVu7Md2ThJAtZwf/bqpRkRJQKT+qVrExVhlHM+A6Ks5uVu1fNJE39B4fF WWmDyCcxSZkXUp79jbXe9d+4bKZVRcegyxXEtMhJIceDi6kVXb8txexj4kJNen5Ttj0bmH DzpOEnJBNmj7Ohrsr0ZoBgdyf8+OMlrO42OouJCov2bISF8HVN3XI0cqe3SJaKSiRLypYo yP2DhTzQf8ASHmzI8rFXylCwP7KgnijY+0M3kdJyYWE7G2m/wIidMAsS8FLFhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641150501; a=rsa-sha256; cv=none; b=nRiRhzfpz+qUGkzC8QPyv68fU9awBN3JZ9szpiTy2V9TOynJxapJWublzxVQPLt2LdWtfG oo6os1XI2Z0+W8A7yfI99v0d7evl4LOEEs3jxg2fYAGkdL9oK8e+6JiLRup7E4RD0dkDyG 6PD4cR47KqBsfIJrZ0IIi+e+GjKee3WiPLHIVEH3LWnJFSvz5UulmBQ5R//reAyOWGc0CJ /TRMF+CdyqM9NbVVy677pfgOyvvsI9npn1nQqVbSRYxzAQI1I2UELyrvh5RlChd0lFNzW/ sLV3MWXkYVvWWgFiJowXxx/QuyHIFjlSP9cQEd2HPWBwHpiH+u2HACW9oEw5sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9cbd1c32b1f99542e30dcf4de3f1e70b20a130e4 commit 9cbd1c32b1f99542e30dcf4de3f1e70b20a130e4 Author: Konstantin Belousov AuthorDate: 2021-11-15 18:30:48 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-02 16:43:01 +0000 amd64 ia32 vdso: add unwind annotations to the signal trampoline (cherry picked from commit 8a4bd7f818a0e361876ab05d49fd04e28ce05357) --- sys/amd64/ia32/ia32_sigtramp.S | 35 +++++++++++++++++++++++++++++++++++ sys/compat/ia32/ia32_genassym.c | 20 +++++++++++++++++--- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/sys/amd64/ia32/ia32_sigtramp.S b/sys/amd64/ia32/ia32_sigtramp.S index 4488e568c43e..f7f3fd129cc7 100644 --- a/sys/amd64/ia32/ia32_sigtramp.S +++ b/sys/amd64/ia32/ia32_sigtramp.S @@ -2,6 +2,11 @@ * Copyright (c) 2003 Peter Wemm * All rights reserved. * + * Copyright (c) 2021 The FreeBSD Foundation + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -39,15 +44,45 @@ ALIGN_TEXT .globl __vdso_ia32_sigcode __vdso_ia32_sigcode: + .cfi_startproc + .cfi_signal_frame + .cfi_def_cfa %esp, 0 +#if 0 + .cfi_offset %gs, IA32_SIGF_UC + IA32_UC_GS + .cfi_offset %fs, IA32_SIGF_UC + IA32_UC_FS + .cfi_offset %es, IA32_SIGF_UC + IA32_UC_ES + .cfi_offset %ds, IA32_SIGF_UC + IA32_UC_DS +#endif + .cfi_offset %edi, IA32_SIGF_UC + IA32_UC_EDI + .cfi_offset %esi, IA32_SIGF_UC + IA32_UC_ESI + .cfi_offset %ebp, IA32_SIGF_UC + IA32_UC_EBP + .cfi_offset %ebx, IA32_SIGF_UC + IA32_UC_EBX + .cfi_offset %edx, IA32_SIGF_UC + IA32_UC_EDX + .cfi_offset %ecx, IA32_SIGF_UC + IA32_UC_ECX + .cfi_offset %eax, IA32_SIGF_UC + IA32_UC_EAX + .cfi_offset %eip, IA32_SIGF_UC + IA32_UC_EIP +#if 0 + .cfi_offset %cs, IA32_SIGF_UC + IA32_UC_CS + .cfi_offset %flags, IA32_SIGF_UC + IA32_UC_EFLAGS +#endif + .cfi_offset %esp, IA32_SIGF_UC + IA32_UC_ESP +#if 0 + .cfi_offset %ss, IA32_SIGF_UC + IA32_UC_SS + .cfi_offset 93 /* %fs.base */, IA32_SIGF_UC + IA32_UC_FSBASE + .cfi_offset 94 /* %gs.base */, IA32_SIGF_UC + IA32_UC_GSBASE +#endif calll *IA32_SIGF_HANDLER(%esp) leal IA32_SIGF_UC(%esp),%eax /* get ucontext */ pushl %eax + .cfi_def_cfa %esp, 4 movl $SYS_sigreturn,%eax pushl %eax /* junk to fake return addr. */ + .cfi_def_cfa %esp, 8 int $0x80 /* enter kernel with args */ /* on stack */ 1: jmp 1b + .cfi_endproc #ifdef COMPAT_FREEBSD4 ALIGN_TEXT diff --git a/sys/compat/ia32/ia32_genassym.c b/sys/compat/ia32/ia32_genassym.c index 5a1faae892db..cb15529aacf6 100644 --- a/sys/compat/ia32/ia32_genassym.c +++ b/sys/compat/ia32/ia32_genassym.c @@ -11,13 +11,27 @@ __FBSDID("$FreeBSD$"); ASSYM(IA32_SIGF_HANDLER, offsetof(struct ia32_sigframe, sf_ah)); ASSYM(IA32_SIGF_UC, offsetof(struct ia32_sigframe, sf_uc)); -#ifdef COMPAT_43 -ASSYM(IA32_SIGF_SC, offsetof(struct ia32_sigframe3, sf_siginfo.si_sc)); -#endif ASSYM(IA32_UC_GS, offsetof(struct ia32_ucontext, uc_mcontext.mc_gs)); ASSYM(IA32_UC_FS, offsetof(struct ia32_ucontext, uc_mcontext.mc_fs)); ASSYM(IA32_UC_ES, offsetof(struct ia32_ucontext, uc_mcontext.mc_es)); ASSYM(IA32_UC_DS, offsetof(struct ia32_ucontext, uc_mcontext.mc_ds)); +ASSYM(IA32_UC_EDI, offsetof(struct ia32_ucontext, uc_mcontext.mc_edi)); +ASSYM(IA32_UC_ESI, offsetof(struct ia32_ucontext, uc_mcontext.mc_esi)); +ASSYM(IA32_UC_EBP, offsetof(struct ia32_ucontext, uc_mcontext.mc_ebp)); +ASSYM(IA32_UC_EBX, offsetof(struct ia32_ucontext, uc_mcontext.mc_ebx)); +ASSYM(IA32_UC_EDX, offsetof(struct ia32_ucontext, uc_mcontext.mc_edx)); +ASSYM(IA32_UC_ECX, offsetof(struct ia32_ucontext, uc_mcontext.mc_ecx)); +ASSYM(IA32_UC_EAX, offsetof(struct ia32_ucontext, uc_mcontext.mc_eax)); +ASSYM(IA32_UC_EIP, offsetof(struct ia32_ucontext, uc_mcontext.mc_eip)); +ASSYM(IA32_UC_CS, offsetof(struct ia32_ucontext, uc_mcontext.mc_cs)); +ASSYM(IA32_UC_EFLAGS, offsetof(struct ia32_ucontext, uc_mcontext.mc_eflags)); +ASSYM(IA32_UC_ESP, offsetof(struct ia32_ucontext, uc_mcontext.mc_esp)); +ASSYM(IA32_UC_SS, offsetof(struct ia32_ucontext, uc_mcontext.mc_ss)); +ASSYM(IA32_UC_FSBASE, offsetof(struct ia32_ucontext, uc_mcontext.mc_fsbase)); +ASSYM(IA32_UC_GSBASE, offsetof(struct ia32_ucontext, uc_mcontext.mc_gsbase)); +#ifdef COMPAT_43 +ASSYM(IA32_SIGF_SC, offsetof(struct ia32_sigframe3, sf_siginfo.si_sc)); +#endif #ifdef COMPAT_FREEBSD4 ASSYM(IA32_SIGF_UC4, offsetof(struct ia32_sigframe4, sf_uc)); ASSYM(IA32_UC4_GS, offsetof(struct ia32_ucontext4, uc_mcontext.mc_gs));