All of lore.kernel.org
 help / color / mirror / Atom feed
* Mini-OS: new_pt_frame fails
@ 2007-03-08 14:32 Julian Stecklina
  2007-03-08 14:49 ` Keir Fraser
  2007-03-08 16:54 ` Jacob Gorm Hansen
  0 siblings, 2 replies; 4+ messages in thread
From: Julian Stecklina @ 2007-03-08 14:32 UTC (permalink / raw)
  To: xen-devel

Hello,

as some might have read in my previous postings, I have a Mini-OS dom0
that constructs a Mini-OS domU on x86 xen-3.0.4-testing. As the memory
layout my Dom0 builds does not guarantee, that pages the DomU Mini-OS 
tries to
use as page tables are mapped to existing memory, I changed new_pt_frame
in arch/x86/mm.c in the following way:

The pt_pfn is mapped R/W, then it is zeroed by a memset(). After that it
is mapped with the correct protection flags and pinned. The problem is
that the first mapping fails:

Mapping memory range 0xc0400000 - 0xc1000000
MINI_OS(file=mm.c, line=68) Allocating new L1 pt frame for pt_pfn=36,
mfn=ca8, prev_l_mfn=cad, offset=301
(XEN) .../xen-3.0.4-testing.hg/xen/include/asm/mm.h:184:d1 Error pfn 0:
rd=ffbe8100, od=ffbf4100, caf=80000002, taf=e8000002
(XEN) mm.c:456:d1 Could not get page ref for pfn 0
(XEN) mm.c:2225:d1 Could not get page for normal update
New PT could not be mapped R/W.

Now I am puzzled what these hypervisor errors mean, and what I could 
have done wrong? The code in question is the following:

     mmu_updates[0].ptr = ((pgentry_t)tab[l2_table_offset(pt_page)] &
PAGE_MASK) +
                          sizeof(pgentry_t) * l1_table_offset(pt_page);
     mmu_updates[0].val = ((pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT) 
| _PAGE_RW | _PAGE_PRESENT;
     if(HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF) < 0)
     {
          printk("New PT could not be mapped R/W.\n");
          do_exit();
     }


Any help is appreciated.

Regards,
Julian

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

* Re: Mini-OS: new_pt_frame fails
  2007-03-08 14:32 Mini-OS: new_pt_frame fails Julian Stecklina
@ 2007-03-08 14:49 ` Keir Fraser
  2007-03-08 16:54 ` Jacob Gorm Hansen
  1 sibling, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2007-03-08 14:49 UTC (permalink / raw)
  To: Julian Stecklina, xen-devel




On 8/3/07 14:32, "Julian Stecklina" <der_julian@web.de> wrote:

> Mapping memory range 0xc0400000 - 0xc1000000
> MINI_OS(file=mm.c, line=68) Allocating new L1 pt frame for pt_pfn=36,
> mfn=ca8, prev_l_mfn=cad, offset=301
> (XEN) .../xen-3.0.4-testing.hg/xen/include/asm/mm.h:184:d1 Error pfn 0:
> rd=ffbe8100, od=ffbf4100, caf=80000002, taf=e8000002
> (XEN) mm.c:456:d1 Could not get page ref for pfn 0
> (XEN) mm.c:2225:d1 Could not get page for normal update
> New PT could not be mapped R/W.

'pfn 0' (actually it's mfn 0) looks suspicious. Like you passed the wrong
ptr value to the mmu_update.

 -- Keir

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

* Re: Mini-OS: new_pt_frame fails
  2007-03-08 14:32 Mini-OS: new_pt_frame fails Julian Stecklina
  2007-03-08 14:49 ` Keir Fraser
@ 2007-03-08 16:54 ` Jacob Gorm Hansen
  2007-03-14 11:19   ` Grzegorz Milos
  1 sibling, 1 reply; 4+ messages in thread
From: Jacob Gorm Hansen @ 2007-03-08 16:54 UTC (permalink / raw)
  To: Julian Stecklina; +Cc: xen-devel

On Thu, 2007-03-08 at 15:32 +0100, Julian Stecklina wrote:
> Hello,
> 
> as some might have read in my previous postings, I have a Mini-OS dom0
> that constructs a Mini-OS domU on x86 xen-3.0.4-testing. As the memory
> layout my Dom0 builds does not guarantee, that pages the DomU Mini-OS 
> tries to
> use as page tables are mapped to existing memory, I changed new_pt_frame
> in arch/x86/mm.c in the following way:

Cool, on a related note I have recently written at blkfront for mini-os,
but not had time to cook up a proper patch for submission. This means
that my 'cstrap' bootloader now works from disk, as well as over HTTP.
If anyone would like to play with my minios blkfront please let me know.

The blockfront can also be found in my xen-3.0.3-based hg tree at
http://www.distlab.dk/hg/index.cgi/xen-evilman.hg

Regards,
Jacob

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

* Re: Mini-OS: new_pt_frame fails
  2007-03-08 16:54 ` Jacob Gorm Hansen
@ 2007-03-14 11:19   ` Grzegorz Milos
  0 siblings, 0 replies; 4+ messages in thread
From: Grzegorz Milos @ 2007-03-14 11:19 UTC (permalink / raw)
  To: Jacob Gorm Hansen; +Cc: xen-devel, Julian Stecklina

I'm interested in blkfront. I'll port it to unstable and clean up if 
necessary.

Thanks
Gregor

Jacob Gorm Hansen wrote:
> On Thu, 2007-03-08 at 15:32 +0100, Julian Stecklina wrote:
>> Hello,
>>
>> as some might have read in my previous postings, I have a Mini-OS dom0
>> that constructs a Mini-OS domU on x86 xen-3.0.4-testing. As the memory
>> layout my Dom0 builds does not guarantee, that pages the DomU Mini-OS 
>> tries to
>> use as page tables are mapped to existing memory, I changed new_pt_frame
>> in arch/x86/mm.c in the following way:
> 
> Cool, on a related note I have recently written at blkfront for mini-os,
> but not had time to cook up a proper patch for submission. This means
> that my 'cstrap' bootloader now works from disk, as well as over HTTP.
> If anyone would like to play with my minios blkfront please let me know.
> 
> The blockfront can also be found in my xen-3.0.3-based hg tree at
> http://www.distlab.dk/hg/index.cgi/xen-evilman.hg
> 
> Regards,
> Jacob
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

end of thread, other threads:[~2007-03-14 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-08 14:32 Mini-OS: new_pt_frame fails Julian Stecklina
2007-03-08 14:49 ` Keir Fraser
2007-03-08 16:54 ` Jacob Gorm Hansen
2007-03-14 11:19   ` Grzegorz Milos

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.