From owner-svn-src-projects@FreeBSD.ORG Sun Apr 21 07:48:39 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E61B688; Sun, 21 Apr 2013 07:48:39 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36F489AC; Sun, 21 Apr 2013 07:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3L7mcVd098675; Sun, 21 Apr 2013 07:48:38 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3L7mckq098673; Sun, 21 Apr 2013 07:48:38 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201304210748.r3L7mckq098673@svn.freebsd.org> From: "Cherry G. Mathew" Date: Sun, 21 Apr 2013 07:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r249717 - in projects/amd64_xen_pv/sys/amd64: amd64 xen X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 07:48:39 -0000 Author: cherry Date: Sun Apr 21 07:48:38 2013 New Revision: 249717 URL: http://svnweb.freebsd.org/changeset/base/249717 Log: Use per thread kernel stacks rather than thread0's. Approved by: gibbs(implicit) Modified: projects/amd64_xen_pv/sys/amd64/amd64/cpu_switch.S projects/amd64_xen_pv/sys/amd64/xen/machdep.c Modified: projects/amd64_xen_pv/sys/amd64/amd64/cpu_switch.S ============================================================================== --- projects/amd64_xen_pv/sys/amd64/amd64/cpu_switch.S Sun Apr 21 06:46:41 2013 (r249716) +++ projects/amd64_xen_pv/sys/amd64/amd64/cpu_switch.S Sun Apr 21 07:48:38 2013 (r249717) @@ -323,6 +323,12 @@ done_tss: /* Update the TSS_RSP0 pointer for the next interrupt */ movq %r8,COMMON_TSS_RSP0(%rdx) movq %rsi,PCPU(CURTHREAD) /* into next thread */ +#ifdef XEN + pushq %r8 + movq %r8, %rdi + callq xen_set_proc + popq %r8 +#endif #ifndef XEN /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) @@ -388,9 +394,10 @@ load_dr: movq %r11,%dr6 movq %rax,%dr7 jmp done_load_dr - +#endif /* !XEN */ do_tss: movq %rdx,PCPU(TSSP) movq %rdx,%rcx +#ifndef XEN movq PCPU(TSS),%rax movw %cx,2(%rax) shrq $16,%rcx @@ -402,18 +409,6 @@ do_tss: movq %rdx,PCPU(TSSP) movb $0x89,5(%rax) /* unset busy */ movl $TSSSEL,%eax ltr %ax -#else -do_tss: - pushq %rsi - pushq %rdx - pushq %r8 - - movq %r8, %rdi - callq xen_set_proc - - popq %r8 - popq %rdx - popq %rsi #endif /* !XEN */ jmp done_tss Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Sun Apr 21 06:46:41 2013 (r249716) +++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Sun Apr 21 07:48:38 2013 (r249717) @@ -1343,7 +1343,7 @@ void xen_set_proc(struct pcb *newpcb) { HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), - (unsigned long) PCPU_GET(rsp0)); + (unsigned long) newpcb & ~0xFul); } char *console_page;