From: Grzegorz Milos <gm281@cam.ac.uk>
To: Julian Stecklina <der_julian@web.de>
Cc: xen-devel@lists.xensource.com
Subject: Re: Mini-OS in dom0 - virtual memory problems
Date: Tue, 30 Jan 2007 21:48:26 +0000 [thread overview]
Message-ID: <45BFBD2A.5060509@cam.ac.uk> (raw)
In-Reply-To: <epaci3$o96$1@sea.gmane.org>
[-- 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
next prev parent reply other threads:[~2007-01-30 21:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-01-31 19:57 ` Julian Stecklina
2007-02-01 0:06 ` Grzegorz Milos
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=45BFBD2A.5060509@cam.ac.uk \
--to=gm281@cam.ac.uk \
--cc=der_julian@web.de \
--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.