From owner-svn-src-all@freebsd.org Mon Dec 14 10:06:02 2015 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 57749A435C4; Mon, 14 Dec 2015 10:06:02 +0000 (UTC) (envelope-from andrew@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 288131BB4; Mon, 14 Dec 2015 10:06:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEA6179027293; Mon, 14 Dec 2015 10:06:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEA61cP027292; Mon, 14 Dec 2015 10:06:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512141006.tBEA61cP027292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Dec 2015 10:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292194 - head/sys/arm64/arm64 X-SVN-Group: head 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.20 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: Mon, 14 Dec 2015 10:06:02 -0000 Author: andrew Date: Mon Dec 14 10:06:01 2015 New Revision: 292194 URL: https://svnweb.freebsd.org/changeset/base/292194 Log: Skip restoring more registers when returning from an exception taken in the kernel. These registers are all callee saved, and as such will be restored before returning to the exception handler. Userland still needs these registers to be restored as they may be changed by the kernel and we don't currently track these places. Modified: head/sys/arm64/arm64/exception.S Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Mon Dec 14 10:04:57 2015 (r292193) +++ head/sys/arm64/arm64/exception.S Mon Dec 14 10:06:01 2015 (r292194) @@ -90,15 +90,19 @@ __FBSDID("$FreeBSD$"); ldp x14, x15, [sp, #(TF_X + 14 * 8)] ldp x16, x17, [sp, #(TF_X + 16 * 8)] .if \el == 0 + /* + * We only restore the callee saved registers when returning to + * userland as they may have been updated by a system call or signal. + */ ldp x18, x19, [sp, #(TF_X + 18 * 8)] -.else - ldr x19, [sp, #(TF_X + 19 * 8)] -.endif ldp x20, x21, [sp, #(TF_X + 20 * 8)] ldp x22, x23, [sp, #(TF_X + 22 * 8)] ldp x24, x25, [sp, #(TF_X + 24 * 8)] ldp x26, x27, [sp, #(TF_X + 26 * 8)] ldp x28, x29, [sp, #(TF_X + 28 * 8)] +.else + ldr x29, [sp, #(TF_X + 29 * 8)] +.endif .if \el == 0 add sp, sp, #(TF_SIZE + 16) .else