From owner-svn-src-all@freebsd.org Thu Sep 28 08:46:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A54E2CE3D; Thu, 28 Sep 2017 08:46:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5393275D33; Thu, 28 Sep 2017 08:46:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8S8kFNg043834; Thu, 28 Sep 2017 08:46:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8S8kFad043832; Thu, 28 Sep 2017 08:46:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709280846.v8S8kFad043832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Sep 2017 08:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324079 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 324079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2017 08:46:16 -0000 Author: kib Date: Thu Sep 28 08:46:15 2017 New Revision: 324079 URL: https://svnweb.freebsd.org/changeset/base/324079 Log: Restore a part of r323722. Do not return from interrupt using the POP_FRAME;iret instruction sequence, always jump to doreti. The user segments selectors saved on the stack might become invalid because userspace manipulated LDT in a parallel thread. trap() is aware of such issue, but it is only prepared to handle it at iret and segment registers load operations in doreti path. Also remove POP_FRAME macro because it is no longer used. Reviewed by: bde, jhb (as part of r323722) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/apic_vector.s head/sys/i386/include/asmacros.h Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Thu Sep 28 08:38:24 2017 (r324078) +++ head/sys/i386/i386/apic_vector.s Thu Sep 28 08:46:15 2017 (r324079) @@ -189,8 +189,7 @@ IDTVEC(xen_intr_upcall) SUPERALIGN_TEXT invltlb_ret: call as_lapic_eoi - POP_FRAME - iret + jmp doreti SUPERALIGN_TEXT IDTVEC(invltlb) @@ -274,10 +273,8 @@ IDTVEC(cpustop) call as_lapic_eoi call cpustop_handler + jmp doreti - POP_FRAME - iret - /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. */ @@ -290,10 +287,8 @@ IDTVEC(cpususpend) call as_lapic_eoi call cpususpend_handler + jmp doreti - POP_FRAME - jmp doreti_iret - /* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. * @@ -314,7 +309,6 @@ IDTVEC(rendezvous) call smp_rendezvous_action call as_lapic_eoi - POP_FRAME - iret + jmp doreti #endif /* SMP */ Modified: head/sys/i386/include/asmacros.h ============================================================================== --- head/sys/i386/include/asmacros.h Thu Sep 28 08:38:24 2017 (r324078) +++ head/sys/i386/include/asmacros.h Thu Sep 28 08:46:15 2017 (r324079) @@ -153,13 +153,6 @@ pushl $0 ; \ movw %fs,(%esp) -#define POP_FRAME \ - popl %fs ; \ - popl %es ; \ - popl %ds ; \ - popal ; \ - addl $4+4,%esp - /* * Access per-CPU data. */