All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trammell Hudson <hudson@osresearch.net>
To: xen-devel@lists.xensource.com
Subject: Page fault on mapped pages with reserved bits set
Date: Wed, 20 Jun 2007 17:59:10 -0400	[thread overview]
Message-ID: <20070620215910.GE13971@osresearch.net> (raw)

I'm porting a light weight kernel to run under the Xen hypervisor
and have run into a problem while trying to switch to my page tables
on x86-64.  After a minor problem with switching to the new PML4
table that was cleared up when Mark Williamson suggested mapping
everything read-only in the current map before switching, as well
as switching the memory management code to use the hypervisor calls
to manipulate the pages and I now fault on the first write after
the new mapping.

The console error message is:

(XEN) Unhandled page fault in domain 33 on VCPU 0 (ec=0003)
(XEN) Pagetable walk from 0000006000520978:
(XEN)  L4[0x000] = 0000000026838025 0000000000000011
(XEN)  L3[0x180] = 00000000330a9025 0000000000000018
(XEN)  L2[0x002] = 0000000023d6d025 0000000000000024 
(XEN)  L1[0x120] = 0010000026fd1027 0000000000000520
(XEN) domain_crash_sync called from entry.S
(XEN) Domain 33 (vcpu#0) crashed on cpu#0:

The mapping corresponds with what was setup, other than the user and
reserved bits being set for the L1 entry.  Since this is x86-64,
I understand that Xen has set the user bit for my guest kernel,
but according to my paging extensions overview, the RSV bit may
trigger a page fault:

   If set (RSV=1), may cause a page fault.  Setting this bit only
   causes a page fault during page translation.  If the referenced
   page entry is in the TLB, then setting this bit, and referencing
   the page will not cause a page fault.  If the entry is not in
   the TLB, or gets flushed from the TLB, then the next reference
   to this page will cause a page fault.  The page fault error code
   on the stack will have the RSV bit set (bit-3).

I can't handle the page fault, since my kernel's page fault routine
faults if it tries to do anything that writes to memory, such as
push a return address on the stack.  To generate the error message
above I had to disable my kernel's trap table to let Xen handle it.
Otherwise the fault address is in my handler rather than in the
instruction after setting MMUEXT_BASE_PTR.

Any suggestions on things to try?

Thanks!
-- Trammell

             reply	other threads:[~2007-06-20 21:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-20 21:59 Trammell Hudson [this message]
2007-06-20 22:10 ` Page fault on mapped pages with reserved bits set Keir Fraser
2007-06-20 22:23   ` Trammell Hudson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070620215910.GE13971@osresearch.net \
    --to=hudson@osresearch.net \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.