From owner-svn-src-projects@FreeBSD.ORG Fri Oct 17 23:03:36 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BCAB106568A; Fri, 17 Oct 2008 23:03:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD748FC14; Fri, 17 Oct 2008 23:03:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9HN3auM000567; Fri, 17 Oct 2008 23:03:36 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9HN3ZYl000564; Fri, 17 Oct 2008 23:03:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810172303.m9HN3ZYl000564@svn.freebsd.org> From: Kip Macy Date: Fri, 17 Oct 2008 23:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184003 - in projects/releng_6_xen/sys/i386: include xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 17 Oct 2008 23:03:36 -0000 Author: kmacy Date: Fri Oct 17 23:03:35 2008 New Revision: 184003 URL: http://svn.freebsd.org/changeset/base/184003 Log: - don't rely on expensive rcr2 emulation - fix trap handling to use old-style pass by value of the trapframe Modified: projects/releng_6_xen/sys/i386/include/cpufunc.h projects/releng_6_xen/sys/i386/xen/exception.s projects/releng_6_xen/sys/i386/xen/xen_machdep.c Modified: projects/releng_6_xen/sys/i386/include/cpufunc.h ============================================================================== --- projects/releng_6_xen/sys/i386/include/cpufunc.h Fri Oct 17 22:55:47 2008 (r184002) +++ projects/releng_6_xen/sys/i386/include/cpufunc.h Fri Oct 17 23:03:35 2008 (r184003) @@ -45,6 +45,7 @@ #ifdef XEN extern void xen_cli(void); extern void xen_sti(void); +extern u_int xen_rcr2(void); extern void xen_load_cr3(u_int data); extern void xen_tlb_flush(void); extern void xen_invlpg(u_int addr); @@ -410,6 +411,9 @@ rcr2(void) { u_int data; +#ifdef XEN + return (xen_rcr2()); +#endif __asm __volatile("movl %%cr2,%0" : "=r" (data)); return (data); } Modified: projects/releng_6_xen/sys/i386/xen/exception.s ============================================================================== --- projects/releng_6_xen/sys/i386/xen/exception.s Fri Oct 17 22:55:47 2008 (r184002) +++ projects/releng_6_xen/sys/i386/xen/exception.s Fri Oct 17 23:03:35 2008 (r184003) @@ -93,8 +93,6 @@ MCOUNT_LABEL(user) MCOUNT_LABEL(btrap) -#define TRAP(a) pushl $(a) ; jmp alltraps - IDTVEC(div) pushl $0; TRAP(T_DIVIDE) IDTVEC(dbg) @@ -182,11 +180,9 @@ alltraps: pushl %ds pushl %es pushl %fs - alltraps_with_regs_pushed: SET_KERNEL_SREGS FAKE_MCOUNT(TF_EIP(%esp)) - calltrap: call trap @@ -220,9 +216,7 @@ IDTVEC(lcall_syscall) pushl %fs SET_KERNEL_SREGS FAKE_MCOUNT(TF_EIP(%esp)) - pushl %esp call syscall - add $4, %esp MEXITCOUNT jmp doreti @@ -236,16 +230,14 @@ IDTVEC(lcall_syscall) SUPERALIGN_TEXT IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ - pushl $0xBEEF /* for debug */ + subl $4,%esp /* skip over tf_trapno */ pushal pushl %ds pushl %es pushl %fs SET_KERNEL_SREGS FAKE_MCOUNT(TF_EIP(%esp)) - pushl %esp call syscall - add $4, %esp MEXITCOUNT jmp doreti @@ -283,7 +275,6 @@ MCOUNT_LABEL(bintr) #ifdef DEV_ATPIC #include #endif - #ifdef DEV_APIC .data .p2align 4 @@ -385,8 +376,7 @@ doreti_popl_ds: addl $8,%esp .globl doreti_iret doreti_iret: -/* #jmp hypercall_page + (__HYPERVISOR_iret * 32) */ - iret + jmp hypercall_page + (__HYPERVISOR_iret * 32) .globl ecrit ecrit: /* @@ -459,8 +449,10 @@ critical_fixup_table: .byte 0x24 #pop %ecx .byte 0x28 #pop %eax .byte 0x2c,0x2c,0x2c #add $0x8,%esp +#if 0 .byte 0x34 #iret -/* .byte 0x34,0x34,0x34,0x34,0x34 #HYPERVISOR_iret */ +#endif +.byte 0x34,0x34,0x34,0x34,0x34 #HYPERVISOR_iret /* # Hypervisor uses this for application faults while it executes.*/ Modified: projects/releng_6_xen/sys/i386/xen/xen_machdep.c ============================================================================== --- projects/releng_6_xen/sys/i386/xen/xen_machdep.c Fri Oct 17 22:55:47 2008 (r184002) +++ projects/releng_6_xen/sys/i386/xen/xen_machdep.c Fri Oct 17 23:03:35 2008 (r184003) @@ -373,6 +373,13 @@ xen_sti(void) __sti(); } +u_int +xen_rcr2(void) +{ + + return (HYPERVISOR_shared_info->vcpu_info[curcpu].arch.cr2); +} + void _xen_machphys_update(vm_paddr_t mfn, vm_paddr_t pfn, char *file, int line) {