All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Florian Wagner <f_wagner@syscomp.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Cannot access memory beyond end of bootstrap direct-map area
Date: Thu, 18 Mar 2010 22:03:26 +0000	[thread overview]
Message-ID: <C7C853AF.2BD4F%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <20100318101816.69943f0c@auedv3.syscomp.de>

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

On 18/3/10 09:18, "Florian Wagner" <f_wagner@syscomp.de> wrote:

>> But I will help someone get 32-bit Xen working with GRUB2 if they are
>> really stuck and are capable of applying, building and testing my
>> patches.
> 
> I am stuck with a bunch of 32bit systems and willing and capable of
> applying and testing patches.

Okay, please try the attached patch. You only need to rebuild/install the
hypervisor itself (xen.gz). If it works okay for you I will apply it to the
next stable releases of 4.0 and 3.4.

 -- Keir


> 
> Regards
> Florian Wagner
> 
> --------------
> 
> Florian Wagner
> Abteilung EDV
> Telefon: 0821 / 4201 - 453
> Fax: 0821 / 4201 - 411
> E-Mail: f_wagner@syscomp.de
> 
> Syscomp Biochemische Dienstleistungen GmbH
> August-Wessels-Straße 5, 86154 Augsburg
> Postfach 102506, 86015 Augsburg
> Telefon: 0821 / 4201 - 0
> Fax: 0821 / 417992
> Web: http://www.syscomp.de
> E-Mail: syscomp@syscomp.de
> 
> Geschäftsführer:
>   Dr. med. Bernd Schottdorf
>   Gabriele Schottdorf
> 
> Registergericht Augsburg HRB 8670


[-- Attachment #2: 00-reloc --]
[-- Type: application/octet-stream, Size: 2314 bytes --]

diff -r 7b63f677f245 xen/arch/x86/boot/Makefile
--- a/xen/arch/x86/boot/Makefile	Thu Mar 18 11:03:07 2010 +0000
+++ b/xen/arch/x86/boot/Makefile	Thu Mar 18 18:05:31 2010 +0000
@@ -4,6 +4,6 @@
 
 BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\+BOOT_TRAMPOLINE[[:space:]]\+,,p' $(BASEDIR)/include/asm-x86/config.h)
 %.S: %.c
-	RELOC=$(BOOT_TRAMPOLINE) $(MAKE) -f build32.mk $@
+	RELOC=$(BOOT_TRAMPOLINE) XEN_BITSPERLONG=$(patsubst x86_%,%,$(TARGET_SUBARCH)) $(MAKE) -f build32.mk $@
 
 reloc.S: $(BASEDIR)/include/asm-x86/config.h
diff -r 7b63f677f245 xen/arch/x86/boot/build32.mk
--- a/xen/arch/x86/boot/build32.mk	Thu Mar 18 11:03:07 2010 +0000
+++ b/xen/arch/x86/boot/build32.mk	Thu Mar 18 18:05:31 2010 +0000
@@ -22,6 +22,6 @@
 	$(LD) $(LDFLAGS_DIRECT) -N -Ttext $(RELOC) -o $@ $<
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c $< -o $@
+	$(CC) $(CFLAGS) -DXEN_BITSPERLONG=$(XEN_BITSPERLONG) -c $< -o $@
 
 reloc.o: $(BASEDIR)/include/asm-x86/config.h
diff -r 7b63f677f245 xen/arch/x86/boot/reloc.c
--- a/xen/arch/x86/boot/reloc.c	Thu Mar 18 11:03:07 2010 +0000
+++ b/xen/arch/x86/boot/reloc.c	Thu Mar 18 18:05:31 2010 +0000
@@ -70,8 +70,28 @@
             (module_t *)mbi->mods_addr, mbi->mods_count * sizeof(module_t));
         mbi->mods_addr = (u32)mods;
         for ( i = 0; i < mbi->mods_count; i++ )
+        {
+#if XEN_BITSPERLONG == 32
+            /*
+             * 32-bit Xen only maps bottom 1GB of memory at boot time.
+             * Relocate modules which extend beyond this (GRUB2 in particular
+             * likes to place modules as high as possible below 4GB).
+             */
+#define BOOTMAP_END (1ul<<30) /* 1GB */
+            static void *mod_alloc = (void *)BOOTMAP_END;
+            u32 mod_len = mods[i].mod_end - mods[i].mod_start;
+            if ( mods[i].mod_end > BOOTMAP_END )
+            {
+                mod_alloc = (void *)
+                    (((unsigned long)mod_alloc - mod_len) & ~15ul);
+                mods[i].mod_start = (u32)memcpy(
+                    mod_alloc, (char *)mods[i].mod_start, mod_len);
+                mods[i].mod_end = mods[i].mod_start + mod_len;
+            }
+#endif
             if ( mods[i].string )
                 mods[i].string = (u32)reloc_mbi_string((char *)mods[i].string);
+        }
     }
 
     if ( mbi->flags & MBI_MEMMAP )

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

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

  parent reply	other threads:[~2010-03-18 22:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18  9:18 Cannot access memory beyond end of bootstrap direct-map area Florian Wagner
2010-03-18  9:22 ` Keir Fraser
2010-03-18 22:03 ` Keir Fraser [this message]
2010-03-24  7:16   ` Florian Wagner
2010-03-24  8:35     ` Keir Fraser
2010-03-24  9:32       ` Florian Wagner
  -- strict thread matches above, loose matches on Subject: below --
2009-08-27 17:28 cannot " Pascal Bouchareine
2009-08-27 18:55 ` Keir Fraser
2009-08-27 21:41   ` Pascal Bouchareine
2009-08-28  6:38     ` Keir Fraser
2009-08-28  7:44       ` Pascal Bouchareine

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=C7C853AF.2BD4F%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=f_wagner@syscomp.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.