From nobody Mon Dec 06 18:48:27 2021 X-Original-To: dev-commits-src-all@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 2A6E518B5D1C; Mon, 6 Dec 2021 18:48:31 +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 4J7CB46w7xz4SMP; Mon, 6 Dec 2021 18:48:28 +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 DD4FF111F0; Mon, 6 Dec 2021 18:48:27 +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 1B6ImRHe065307; Mon, 6 Dec 2021 18:48:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6ImRoM065305; Mon, 6 Dec 2021 18:48:27 GMT (envelope-from git) Date: Mon, 6 Dec 2021 18:48:27 GMT Message-Id: <202112061848.1B6ImRoM065305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8a4bd7f818a0 - main - amd64 ia32 vdso: add unwind annotations to the signal trampoline List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 8a4bd7f818a0e361876ab05d49fd04e28ce05357 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638816509; 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=mD1jGjUM2txCCI7WtaEOPWosUrNNEySmxOz7XQDtGb0=; b=xGs5O6OYjfohVIoxI+md6SvJBLEJohvZR8LzjV5qCCNr1tKcuyk37J08BrVZPormEiOC2p Nu5QjWEqJIgQjMtkhNGFja9i2bVsMDhmn1zmJqC68kVOSij+nUoXjXIEFAjFU00kjQht2Z ZjiINZLl98g3/8WUL0IpwOy4yf9fwrKaJFN35lMlIbScVUQ6MulywmAj43RD+b7mmrgqKT +WYMRjn/H68cCnWN/bw1x8Sf0DthFT7pDmxVCHaO9uAiKIKY/JVq0nyU9oYJqOzfDF5iUd NIERrpk/6YwJgRN823iFRc9fd/dahzOG/IXxsDNzIAXPcUw3fvHs7cO2AQLiAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638816509; a=rsa-sha256; cv=none; b=QpvGAcPU8CpdOZRVOyTmQgAXVOdeHUmNJy7D/rbEbdjxCOrw11Wy9atGwn+pluoIoKeJ+Y FW1Tz1SqZO+pQSwThKXCkZ2z2LDoYYY4PnHqsG3zC+ylNPZRzxEWfLpvysMJ7c7dWZfDrQ Nh9CyLx2PpuIO7a9E6I+w0VmAE+1XqieWbfQ30v3MJN4K4BctvrjrfQ4LNxCvHoy6LjWjj X4JdBZqwgg0pAcjTSBhM9cu+v/f0XvJ+gpB758EwWFRPrlREC2fmOmqDwJtKZWA9Y8F5kO 73IOWion5xrCeqPgCNKCLBlUZcjFfjm+EfDjw8BPz2qoY2rP1eBFVE5IPJif/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8a4bd7f818a0e361876ab05d49fd04e28ce05357 commit 8a4bd7f818a0e361876ab05d49fd04e28ce05357 Author: Konstantin Belousov AuthorDate: 2021-11-15 18:30:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-06 18:47:24 +0000 amd64 ia32 vdso: add unwind annotations to the signal trampoline Reviewed by: emaste Discussed with: jhb, jrtc27 Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D32960 --- 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));