From owner-svn-src-head@freebsd.org Sat May 12 11:02:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F21A3FD415B; Sat, 12 May 2018 11:02:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A87A08341F; Sat, 12 May 2018 11:02:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2981D800; Sat, 12 May 2018 11:02:39 +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 w4CB2dX6093683; Sat, 12 May 2018 11:02:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4CB2djW093682; Sat, 12 May 2018 11:02:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805121102.w4CB2djW093682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 May 2018 11:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333525 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 333525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2018 11:02:40 -0000 Author: kib Date: Sat May 12 11:02:39 2018 New Revision: 333525 URL: https://svnweb.freebsd.org/changeset/base/333525 Log: On return from exception or interrupt, returns to vm86 mode with PCB_VM86CALL pcb flag not set should be treated same as return to userspace. Most important, the address space must be switched. This fixes usermode vm86 operations after the 4/4 split. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/exception.s Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Sat May 12 10:57:34 2018 (r333524) +++ head/sys/i386/i386/exception.s Sat May 12 11:02:39 2018 (r333525) @@ -502,11 +502,15 @@ doreti_exit: je doreti_iret_nmi cmpl $T_TRCTRAP, TF_TRAPNO(%esp) je doreti_iret_nmi - testl $SEL_RPL_MASK, TF_CS(%esp) + movl $TF_SZ, %ecx + testl $PSL_VM,TF_EFLAGS(%esp) + jz 1f /* PCB_VM86CALL is not set */ + addl $VM86_STACK_SPACE, %ecx + jmp 2f +1: testl $SEL_RPL_MASK, TF_CS(%esp) jz doreti_popl_fs - movl %esp, %esi +2: movl %esp, %esi movl PCPU(TRAMPSTK), %edx - movl $TF_SZ, %ecx subl %ecx, %edx movl %edx, %edi rep; movsb