From owner-freebsd-hackers Wed Jul 29 12:13:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA06036 for freebsd-hackers-outgoing; Wed, 29 Jul 1998 12:13:10 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA05908 for ; Wed, 29 Jul 1998 12:12:36 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.8.8/8.8.5) with SMTP id UAA16623; Wed, 29 Jul 1998 20:13:36 +0100 (BST) Date: Wed, 29 Jul 1998 20:13:36 +0100 (BST) From: Doug Rabson To: zhihuizhang cc: hackers Subject: Re: Still confused with PTDpde/APTDpde In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 29 Jul 1998, zhihuizhang wrote: > > > > The address of xx is 30. If we declare xx in C as: > > > > pd_entry_t xx; > > > > then one can use xx to reference the pd_entry_t which is stored at address > > 30. > > So the compiler treats .set directives as setting the addresses of > absolute symbols. If I understand correctly, PTmap, PTD, PTDpde, > APTmap, APTD, and APTDpde are all stored at fixed virtual addresses -- > special VAs that are inaccessible to normal use. Thats exactly right, as I understand things. > > This confused me as well when I reviewed the i386 pmap before porting it > > to alpha. When we access an alternate address space's page tables, we > > install it in APTmap by setting APTDpde to the alternate's page directory. > > Since the alternate address space has its own self referencial mapping at > > directory index PTDPTDI, the page directory for it is available at > > address APTD. > > > > After hard thinking, I finally notice that APTDpde is set as > > .set _APTDpde,_PTD + (APTDPTDI * PDESIZE) > NOT as > > .set _APTDpde,_APTD + (APTDPTDI * PDESIZE) > > So what you said above makes sense to me. Also, I find a possible bug > in the same place (locore.s - Stable FreeBSD). Instead of > > .set _APTD,_APTmap + (APTDPTDI * PAGE_SIZE) > > we should say > > .set _APTD,_APTmap + (PTDPTDI * PAGE_SIZE) > > Fortunately, the symbol _APTD (in assembly) and the variable APTD (in C) > are not in actual use. > > If I do not understand correctly, please let me know. I think that you are correct about the definition of APTD being wrong. If the meaning of APTD is intended to be, 'the directory of the alternate address space' then it should be defined in terms of PTDPTDI, not APTDPTDI. > > Thanks very much for your help. You are welcome. I have some of this fairly fresh after working on the alpha pmap and I'm glad to help. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 951 1891 Fax: +44 181 381 1039 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message