From owner-freebsd-hackers Thu Sep 20 0:18:50 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id A8FF537B411; Thu, 20 Sep 2001 00:18:46 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8K7HI706415; Thu, 20 Sep 2001 03:18:03 -0400 (EDT) (envelope-from arr@watson.org) Date: Thu, 20 Sep 2001 03:17:18 -0400 (EDT) From: "Andrew R. Reiter" To: Peter Wemm Cc: Julian Elischer , John Baldwin , hackers@FreeBSD.ORG Subject: Re: JKH Project: x86: pcb_ext In-Reply-To: <20010920060311.C6E9B380A@overcee.netplex.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 19 Sep 2001, Peter Wemm wrote: : :One comment: : :- cmpl $0, PCB_USERLDT(%edx) /* if there is one */ :+ movl TD_PROC(%ecx), %eax /* load struct proc from CURTHREAD */ :+ leal P_MD(%eax), %eax /* get mdproc from proc */ :+ cmpl $0, MD_LDT(%eax) /* if there is one */ : : :This can be written as: : movl TD_PROC(%ecx), %eax : cmpl $0, P_MD+MD_LDT(%eax) : :This is evaluated at assemble time. Yea, Kinda dumb on my part :-/ : :And this change: : movl %eax,PCPU(CURRENTLDT) /* store what we have */ : jmp 2f : :-1: pushl %edx /* call a non-trusting routine */ :+1: pushl %eax /* call a non-trusting routine */ : call set_user_ldt /* to check and load the ldt */ :- popl %edx :+ popl %eax : 2: : :is not good.. you still need to save %edx since set_user_ldt is free :to trash it (%edx is the secondary return value from a C function). : Hmm interesting. Thanks. :eg: :0xc02e75c4 : mov 0x10(%ebx),%edx :0xc02e75c7 : mov %edx,(%eax,%ecx,1) :0xc02e75ca : mov 0x14(%ebx),%edx :0xc02e75cd : mov %edx,0x4(%eax,%ecx,1) : :The code after this in swtch.s depends on %edx being preserved. : :Cheers, :-Peter :-- :Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au :"All of this is for nothing if we don't go to the stars" - JMS/B5 : : *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message