All of lore.kernel.org
 help / color / mirror / Atom feed
* Setting up page directories and tables
@ 2007-04-27 20:11 Dave Pacheco
  2007-04-27 21:39 ` Keir Fraser
  2007-05-01 16:27 ` Mark Williamson
  0 siblings, 2 replies; 8+ messages in thread
From: Dave Pacheco @ 2007-04-27 20:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Joel Weinberger


[-- Attachment #1.1: Type: text/plain, Size: 1669 bytes --]

I'm working on a small OS which is similar in many ways to the Mini-OS (and
I've borrowed much code for the time being). One important difference is
that it supports multiple processes, each with its own address space. I'm
having problems setting this up under Xen.

This OS is designed for 32-bit x86 (no PAE), so I intend to use a two-level
paging system. Each process has a page directory - one page with entries
which point to page tables, whose entries describe actual pages. As far as I
can tell, this is what's done in the Mini-OS source, with page directories
referred to as L1 page tables, and what I'm calling page tables referred to
as L2 page tables.

So when creating a process, I do the following:
    allocate a page P for the process's page directory
    fill P with zeros
    update the existing page table mapping for P (previously set up by what
is essentially the build_pagetable() code from Mini-OS) to give it L1_PROT &
~_PAGE_RW
        (using HYPERVISOR_mmu_update(...))
    pin the page (using HYPERVISOR_mmuext_op({MMUEXT_PIN_L1_TABLE, ...}...))

All of these steps succeed (the hypercall returns 0, and the argument
indicating how many updates succeeded is 1 in both cases). But later, when
switching into the context of this process, I try to update the user base
pointer with

 HYPERVISOR_mmuext_op({MMUEXT_NEW_USER_BASEPTR, mfn of P}...).

This call fails (returns -1, and indicates that 0 operations succeeded). Why
might that be? As I've established, the page is zero'd out (so it's not
invalid), and it seems to be mapped properly (not writable, pinned L1 page
table). So why would this operation fail?

Thanks in advance,
Dave Pacheco

[-- Attachment #1.2: Type: text/html, Size: 1872 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-05-02  0:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-27 20:11 Setting up page directories and tables Dave Pacheco
2007-04-27 21:39 ` Keir Fraser
2007-04-28  0:56   ` Dave Pacheco
2007-04-28  1:14     ` Jeremy Fitzhardinge
2007-05-01 19:32       ` Dave Pacheco
2007-05-01 21:42         ` Jeremy Fitzhardinge
2007-05-02  0:41         ` Mark Williamson
2007-05-01 16:27 ` Mark Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.