Date: Sun, 21 Apr 2013 07:48:38 +0000 (UTC) From: "Cherry G. Mathew" <cherry@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r249717 - in projects/amd64_xen_pv/sys/amd64: amd64 xen Message-ID: <201304210748.r3L7mckq098673@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304210748.r3L7mckq098673>