* Mini-OS in dom0 - virtual memory problems
@ 2007-01-25 13:49 Julian Stecklina
2007-01-25 13:55 ` Julian Stecklina
2007-01-30 21:48 ` Grzegorz Milos
0 siblings, 2 replies; 5+ messages in thread
From: Julian Stecklina @ 2007-01-25 13:49 UTC (permalink / raw)
To: xen-devel
Hello,
I am trying to port Mini-OS (from xen-3.0.4-testing) to the domain 0
environment. Setting the right flags in x86_32.S and changing the start
of the text section to 0xC0100000 enabled it to boot. I expected that
most of the Mini-OS's functionality to be working except everything that
relied on the Xenbus.
To my surprise there was an error setting up the virtual memory. Here is
the console log:
Bootstrapping...
Xen Minimal OS!
start_info: c0135000
nr_pages: 26700 shared_inf: 00bed000
pt_base: c0136000 mod_start: 0x0
mod_len: 0
flags: 0x3
cmd_line:
stack: c0117040-c0119040
MM: Init
_text: c0100000
_etext: c010a3b4
_edata: c010b760
stack start: c0117040
_end: c0119494
start_pfn: 3b
max_pfn: 684c
Mapping memory range 0xc0500000 - 0xc694c000
(XEN) mm.c:1664:d0 Bad type (saw e8000001 != exp 20000000) for mfn 1c3b
(pfn 3b)
(XEN) mm.c:1960:d0 Error while pinning mfn 1c3b
ERROR: pinning failed
Do_exit called!
The first message from the hypervisor seems very strange. I would be
very thankful, if anyone can point to the source of the problem.
Regards,
Julian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mini-OS in dom0 - virtual memory problems
2007-01-25 13:49 Mini-OS in dom0 - virtual memory problems Julian Stecklina
@ 2007-01-25 13:55 ` Julian Stecklina
2007-01-30 21:48 ` Grzegorz Milos
1 sibling, 0 replies; 5+ messages in thread
From: Julian Stecklina @ 2007-01-25 13:55 UTC (permalink / raw)
To: xen-devel
Julian Stecklina wrote:
> To my surprise there was an error setting up the virtual memory. Here is
> the console log:
Perhaps this is helping, too:
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN) Dom0 alloc.: 01c00000->02000000 (25676 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN) Loaded kernel: c0100000->c0119494
(XEN) Init. ramdisk: c011a000->c011a000
(XEN) Phys-Mach map: c011a000->c0134130
(XEN) Start info: c0135000->c013546c
(XEN) Page tables: c0136000->c0138000
(XEN) Boot stack: c0138000->c0139000
(XEN) TOTAL: c0000000->c0400000
(XEN) ENTRY ADDRESS: c0100000
Regards,
Julian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mini-OS in dom0 - virtual memory problems
2007-01-25 13:49 Mini-OS in dom0 - virtual memory problems Julian Stecklina
2007-01-25 13:55 ` Julian Stecklina
@ 2007-01-30 21:48 ` Grzegorz Milos
2007-01-31 19:57 ` Julian Stecklina
1 sibling, 1 reply; 5+ messages in thread
From: Grzegorz Milos @ 2007-01-30 21:48 UTC (permalink / raw)
To: Julian Stecklina; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 2008 bytes --]
Mini-OS assumes that the start of the text section is also the beginning
of virtual address space[1]. However, it is generally bad idea not to
start virtual address space at 4Mb boundary. The easiest way to fix your
problem is to move text to 0xc0000000 or 0xc0400000. More extensive fix,
which decouples VIRT_START from &_text is also possible, but I don't see
a reason why it would be needed. Instead I've included a runtime check.
Keir could you apply the patch?
Thanks
Gregor
[1]
include/x86/arch_mm.h line 209:
#define VIRT_START ((unsigned long)&_text)
Julian Stecklina wrote:
> Hello,
>
> I am trying to port Mini-OS (from xen-3.0.4-testing) to the domain 0
> environment. Setting the right flags in x86_32.S and changing the start
> of the text section to 0xC0100000 enabled it to boot. I expected that
> most of the Mini-OS's functionality to be working except everything that
> relied on the Xenbus.
>
> To my surprise there was an error setting up the virtual memory. Here is
> the console log:
>
> Bootstrapping...
> Xen Minimal OS!
> start_info: c0135000
> nr_pages: 26700 shared_inf: 00bed000
> pt_base: c0136000 mod_start: 0x0
> mod_len: 0
> flags: 0x3
> cmd_line:
> stack: c0117040-c0119040
> MM: Init
> _text: c0100000
> _etext: c010a3b4
> _edata: c010b760
> stack start: c0117040
> _end: c0119494
> start_pfn: 3b
> max_pfn: 684c
> Mapping memory range 0xc0500000 - 0xc694c000
> (XEN) mm.c:1664:d0 Bad type (saw e8000001 != exp 20000000) for mfn 1c3b
> (pfn 3b)
> (XEN) mm.c:1960:d0 Error while pinning mfn 1c3b
> ERROR: pinning failed
> Do_exit called!
>
> The first message from the hypervisor seems very strange. I would be
> very thankful, if anyone can point to the source of the problem.
>
> Regards,
> Julian
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
[-- Attachment #2: mini-os.patch --]
[-- Type: text/plain, Size: 685 bytes --]
diff -r 34ab61cd89bb extras/mini-os/arch/x86/setup.c
--- a/extras/mini-os/arch/x86/setup.c Tue Jan 30 21:26:45 2007 +0000
+++ b/extras/mini-os/arch/x86/setup.c Tue Jan 30 21:45:46 2007 +0000
@@ -75,6 +75,13 @@ void
void
arch_init(start_info_t *si)
{
+ if(VIRT_START & (L1_PAGETABLE_ENTRIES * PAGE_SIZE - 1))
+ {
+ printk("Virt address space has to start on 4Mb(2Mb for PAE) boundary. "
+ "\nPlease adjust start of the text section. Exiting\n");
+ do_exit();
+ }
+
/* Copy the start_info struct to a globally-accessible area. */
/* WARN: don't do printk before here, it uses information from
shared_info. Use xprintk instead. */
[-- Attachment #3: 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] 5+ messages in thread
* Re: Mini-OS in dom0 - virtual memory problems
2007-01-30 21:48 ` Grzegorz Milos
@ 2007-01-31 19:57 ` Julian Stecklina
2007-02-01 0:06 ` Grzegorz Milos
0 siblings, 1 reply; 5+ messages in thread
From: Julian Stecklina @ 2007-01-31 19:57 UTC (permalink / raw)
To: xen-devel
Grzegorz Milos wrote:
> Mini-OS assumes that the start of the text section is also the beginning
> of virtual address space[1]. However, it is generally bad idea not to
> start virtual address space at 4Mb boundary. The easiest way to fix your
> problem is to move text to 0xc0000000 or 0xc0400000. More extensive fix,
> which decouples VIRT_START from &_text is also possible, but I don't see
> a reason why it would be needed. Instead I've included a runtime check.
> Keir could you apply the patch?
I changed the beginning of text to 0xC0000000 and the page table setup
seems to work, as does the rest of Mini-OS (except XenBus of course).
Thank you very much!
Regards,
Julian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: Mini-OS in dom0 - virtual memory problems
2007-01-31 19:57 ` Julian Stecklina
@ 2007-02-01 0:06 ` Grzegorz Milos
0 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Milos @ 2007-02-01 0:06 UTC (permalink / raw)
To: Julian Stecklina; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 897 bytes --]
>> Mini-OS assumes that the start of the text section is also the
>> beginning of virtual address space[1]. However, it is generally bad
>> idea not to start virtual address space at 4Mb boundary. The easiest
>> way to fix your problem is to move text to 0xc0000000 or 0xc0400000.
>> More extensive fix, which decouples VIRT_START from &_text is also
>> possible, but I don't see a reason why it would be needed. Instead
>> I've included a runtime check. Keir could you apply the patch?
>
> I changed the beginning of text to 0xC0000000 and the page table setup
> seems to work, as does the rest of Mini-OS (except XenBus of course).
> Thank you very much!
There was indeed a XenBus bug, where request structures wouldn't be
marked as free (Keir could you apply the attached patch?), however I
don't think that's what you are referring to. What problems do you observe?
Cheers
Gregor
[-- Attachment #2: mini-os.patch --]
[-- Type: text/plain, Size: 644 bytes --]
diff -r 34ab61cd89bb extras/mini-os/xenbus/xenbus.c
--- a/extras/mini-os/xenbus/xenbus.c Tue Jan 30 21:26:45 2007 +0000
+++ b/extras/mini-os/xenbus/xenbus.c Wed Jan 31 23:57:41 2007 +0000
@@ -178,6 +178,7 @@ static void release_xenbus_id(int id)
BUG_ON(!req_info[id].in_use);
spin_lock(&req_lock);
nr_live_reqs--;
+ req_info[id].in_use = 0;
if (nr_live_reqs == NR_REQS - 1)
wake_up(&req_wq);
spin_unlock(&req_lock);
@@ -212,6 +213,7 @@ static int allocate_xenbus_id(void)
probe = o_probe + 1;
spin_unlock(&req_lock);
init_waitqueue_head(&req_info[o_probe].waitq);
+
return o_probe;
}
[-- Attachment #3: 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] 5+ messages in thread
end of thread, other threads:[~2007-02-01 0:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 13:49 Mini-OS in dom0 - virtual memory problems Julian Stecklina
2007-01-25 13:55 ` Julian Stecklina
2007-01-30 21:48 ` Grzegorz Milos
2007-01-31 19:57 ` Julian Stecklina
2007-02-01 0:06 ` 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.