From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 23 21:50:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950D11065676; Thu, 23 Feb 2012 21:50:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83AF48FC21; Thu, 23 Feb 2012 21:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1NLoDt9024758; Thu, 23 Feb 2012 21:50:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1NLoD2I024756; Thu, 23 Feb 2012 21:50:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202232150.q1NLoD2I024756@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 23 Feb 2012 21:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232078 - stable/9/sys/amd64/acpica X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 21:50:13 -0000 Author: jkim Date: Thu Feb 23 21:50:13 2012 New Revision: 232078 URL: http://svn.freebsd.org/changeset/base/232078 Log: MFC: r230958 Restore callee saved registers later and micro-optimize. Modified: stable/9/sys/amd64/acpica/acpi_switch.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/acpica/acpi_switch.S ============================================================================== --- stable/9/sys/amd64/acpica/acpi_switch.S Thu Feb 23 21:48:39 2012 (r232077) +++ stable/9/sys/amd64/acpica/acpi_switch.S Thu Feb 23 21:50:13 2012 (r232078) @@ -120,15 +120,6 @@ ENTRY(acpi_restorecpu) #undef SDT_SYSTSS #undef SDT_SYSBSY - /* Restore other callee saved registers. */ - movq PCB_R15(%rdi), %r15 - movq PCB_R14(%rdi), %r14 - movq PCB_R13(%rdi), %r13 - movq PCB_R12(%rdi), %r12 - movq PCB_RBP(%rdi), %rbp - movq PCB_RSP(%rdi), %rsp - movq PCB_RBX(%rdi), %rbx - /* Restore debug registers. */ movq PCB_DR0(%rdi), %rax movq %rax, %dr0 @@ -145,6 +136,7 @@ ENTRY(acpi_restorecpu) /* Restore FPU state. */ fninit + movq WAKEUP_CTX(fpusave), %rbx movq WAKEUP_CTX(xsmask), %rax testq %rax, %rax jz 1f @@ -153,19 +145,26 @@ ENTRY(acpi_restorecpu) movl $XCR0, %ecx /* xsetbv */ .byte 0x0f, 0x01, 0xd1 - movq WAKEUP_CTX(fpusave), %rcx -/* xrstor (%rcx) */ - .byte 0x0f, 0xae, 0x29 +/* xrstor (%rbx) */ + .byte 0x0f, 0xae, 0x2b jmp 2f 1: - movq WAKEUP_CTX(fpusave), %rcx - fxrstor (%rcx) + fxrstor (%rbx) 2: /* Reload CR0. */ movq PCB_CR0(%rdi), %rax movq %rax, %cr0 + /* Restore other callee saved registers. */ + movq PCB_R15(%rdi), %r15 + movq PCB_R14(%rdi), %r14 + movq PCB_R13(%rdi), %r13 + movq PCB_R12(%rdi), %r12 + movq PCB_RBP(%rdi), %rbp + movq PCB_RSP(%rdi), %rsp + movq PCB_RBX(%rdi), %rbx + /* Restore return address. */ movq PCB_RIP(%rdi), %rax movq %rax, (%rsp)