xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Florian Wagner <f_wagner@syscomp.de>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Cannot access memory beyond end of bootstrap direct-map area
Date: Wed, 24 Mar 2010 08:16:15 +0100	[thread overview]
Message-ID: <20100324081615.4eb1b83d@auedv3.syscomp.de> (raw)
In-Reply-To: <C7C853AF.2BD4F%keir.fraser@eu.citrix.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1724 bytes --]

> 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.

The patch didn't apply cleanly to the xen 3.4.2 release so I modified
it to do so (see attached reloc-3.4.2).

All it did is turn the original problem into another one. I now get a
"elf_init: not an ELF binary" error instead.

For reference I've attached the full Xen Hypervisor output of unpatched
and patched versions. Also the GRUB2 entries I use to boot look like
this:

  menuentry "Xen Unpatched" {
    insmod ext2
    set root='(hd0,4)'
    multiboot /xen-unpatched.gz dummy=dummy noreboot com1=38400,8n1 console=com1 sync_console
    module /vmlinuz-2.6.26-2-xen-686 dummy=dummy root=UUID=29475092-583f-4a90-9bac-c5afda9ac352 ro pci=nomsi
    module /initrd.img-2.6.26-2-xen-686
  }
  
  menuentry "Xen Patched" {
    insmod ext2
    set root='(hd0,4)'
    multiboot /xen-patched.gz dummy=dummy noreboot com1=38400,8n1 console=com1 sync_console
    module /vmlinuz-2.6.26-2-xen-686 dummy=dummy root=UUID=29475092-583f-4a90-9bac-c5afda9ac352 ro pci=nomsi
    module /initrd.img-2.6.26-2-xen-686
  }


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 #1.1.2: output-patched.txt --]
[-- Type: text/plain, Size: 2910 bytes --]

 __  __            _____ _  _    ____  
 \ \/ /___ _ __   |___ /| || |  |___ \ 
  \  // _ \ '_ \    |_ \| || |_   __) |
  /  \  __/ | | |  ___) |__   _| / __/ 
 /_/\_\___|_| |_| |____(_) |_|(_)_____|
                                       
(XEN) Xen version 3.4.2 (root@syscomp.de) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) Tue Mar 23 14:48:26 CET 2010
(XEN) Latest ChangeSet: unavailable
(XEN) Console output is synchronous.
(XEN) Command line: noreboot com1=38400,8n1 console=com1 sync_console
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN) Disc information:
(XEN)  Found 1 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009f800 (usable)
(XEN)  000000000009f800 - 00000000000a0000 (reserved)
(XEN)  00000000000ca000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 000000007fef0000 (usable)
(XEN)  000000007fef0000 - 000000007feff000 (ACPI data)
(XEN)  000000007feff000 - 000000007ff00000 (ACPI NVS)
(XEN)  000000007ff00000 - 000000007ff80000 (usable)
(XEN)  000000007ff80000 - 0000000080000000 (reserved)
(XEN)  00000000fec00000 - 00000000fec04000 (reserved)
(XEN)  00000000fee00000 - 00000000fee01000 (reserved)
(XEN)  00000000fff80000 - 0000000100000000 (reserved)
(XEN) System RAM: 2047MB (2096188kB)
(XEN) ACPI: RSDP 000F7100, 0014 (r0 PTLTD )
(XEN) ACPI: RSDT 7FEFCF28, 002C (r1 PTLTD    RSDT    6040000  LTP        0)
(XEN) ACPI: FACP 7FEFEF2E, 0074 (r1 AMD    TECATE    6040000 PTL     F4240)
(XEN) ACPI: DSDT 7FEFCF54, 1FDA (r1    AMD  AMDACPI  6040000 MSFT  100000D)
(XEN) ACPI: FACS 7FEFFFC0, 0040
(XEN) ACPI: APIC 7FEFEFA2, 005E (r1 PTLTD        APIC    6040000  LTP        0)
(XEN) Xen heap: 9MB (9768kB)
(XEN) Domain heap initialised
(XEN) Processor #1 6:8 APIC version 16
(XEN) Processor #0 6:8 APIC version 16
(XEN) IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 2000.113 MHz processor.
(XEN) CPU0: AMD Athlon(tm) MP 2400+ stepping 01
(XEN) Booting processor 1/0 eip 8c000
(XEN) CPU1: AMD Athlon(tm) Processor stepping 01
(XEN) Total of 2 processors activated.
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) checking TSC synchronization across 2 CPUs: passed.
(XEN) Platform timer is 3.579MHz ACPI PM Timer
(XEN) Brought up 2 CPUs
(XEN) I/O virtualisation disabled
(XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
(XEN) mtrr: your CPUs had inconsistent fixed MTRR settings
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_init: not an ELF binary
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) ****************************************
(XEN) 
(XEN) Manual reset required ('noreboot' specified)

[-- Attachment #1.1.3: output-unpatched.txt --]
[-- Type: text/plain, Size: 2749 bytes --]

 __  __            _____ _  _    ____  
 \ \/ /___ _ __   |___ /| || |  |___ \ 
  \  // _ \ '_ \    |_ \| || |_   __) |
  /  \  __/ | | |  ___) |__   _| / __/ 
 /_/\_\___|_| |_| |____(_) |_|(_)_____|
                                       
(XEN) Xen version 3.4.2 (root@syscomp.de) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) Wed Mar 24 08:07:02 CET 2010
(XEN) Latest ChangeSet: unavailable
(XEN) Console output is synchronous.
(XEN) Command line: noreboot com1=38400,8n1 console=com1 sync_console
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN) Disc information:
(XEN)  Found 1 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009f800 (usable)
(XEN)  000000000009f800 - 00000000000a0000 (reserved)
(XEN)  00000000000ca000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 000000007fef0000 (usable)
(XEN)  000000007fef0000 - 000000007feff000 (ACPI data)
(XEN)  000000007feff000 - 000000007ff00000 (ACPI NVS)
(XEN)  000000007ff00000 - 000000007ff80000 (usable)
(XEN)  000000007ff80000 - 0000000080000000 (reserved)
(XEN)  00000000fec00000 - 00000000fec04000 (reserved)
(XEN)  00000000fee00000 - 00000000fee01000 (reserved)
(XEN)  00000000fff80000 - 0000000100000000 (reserved)
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Cannot access memory beyond end of bootstrap direct-map area
(XEN) ****************************************
(XEN) 
(XEN) Manual reset required ('noreboot' specified)
(XEN) Unknown interrupt (cr2=00000000)
(XEN)   ff204084  5fe00000  00000002  ff22be54  00000082  00000002  ff1d78dc  ff1d78dc  ff14efa6  0000e008  00000286  5fe00000  ff204084  00000002  00000000  00000082  5fe00000  00000082  ff122ec5  ff1d77bc  00000082  ff1d0768  ff22bea4  ff1d77c0  0000000a  60400000  ff1f8424  ff1d0768  00000001  ff1c56e4  ff1e8250  ff249ac0  6120a800  60243000  ff1f8997  ff203680  ff08c298  ff08cbd0  00000010  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  ff1e8250  ff08bf60  00000000  00000000  00000000  00000000  00000000  0008bf60  00000000  00000000  ff08bfc0  01295600  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  ffea4980  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000008  0000006e  00000001  00000003  000002f8  00000000  00000000  001e0d70  ff260040  0007feac  ff10006c  0008bfc0  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  fffff000

[-- Attachment #1.1.4: reloc-3.4.2 --]
[-- Type: application/octet-stream, Size: 2594 bytes --]

diff -Naur xen-3.4.2/xen/arch/x86/boot/build32.mk xen-3.4.2-patched/xen/arch/x86/boot/build32.mk
--- xen-3.4.2/xen/arch/x86/boot/build32.mk	2009-11-10 16:12:57.000000000 +0100
+++ xen-3.4.2-patched/xen/arch/x86/boot/build32.mk	2010-03-19 07:52:23.657000576 +0100
@@ -19,7 +19,7 @@
 	$(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0x8c000 -o $@ $<
+	$(LD) $(LDFLAGS_DIRECT) -N -Ttext $(RELOC) -o $@ $<
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c $< -o $@
+	$(CC) $(CFLAGS) -DXEN_BITSPERLONG=$(XEN_BITSPERLONG) -c $< -o $@
diff -Naur xen-3.4.2/xen/arch/x86/boot/Makefile xen-3.4.2-patched/xen/arch/x86/boot/Makefile
--- xen-3.4.2/xen/arch/x86/boot/Makefile	2009-11-10 16:12:57.000000000 +0100
+++ xen-3.4.2-patched/xen/arch/x86/boot/Makefile	2010-03-19 07:51:07.561270017 +0100
@@ -2,6 +2,6 @@
 
 head.o: reloc.S
 
-# NB. BOOT_TRAMPOLINE == 0x8c000
+BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\+BOOT_TRAMPOLINE[[:space:]]\+,,p' $(BASEDIR)/include/asm-x86/config.h)
 %.S: %.c
-	RELOC=0x8c000 $(MAKE) -f build32.mk $@
+	RELOC=$(BOOT_TRAMPOLINE) XEN_BITSPERLONG=$(patsubst x86_%,%,$(TARGET_SUBARCH)) $(MAKE) -f build32.mk $@
diff -Naur xen-3.4.2/xen/arch/x86/boot/reloc.c xen-3.4.2-patched/xen/arch/x86/boot/reloc.c
--- xen-3.4.2/xen/arch/x86/boot/reloc.c	2009-11-10 16:12:57.000000000 +0100
+++ xen-3.4.2-patched/xen/arch/x86/boot/reloc.c	2010-03-19 07:50:23.317529357 +0100
@@ -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 #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

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

  reply	other threads:[~2010-03-24  7:16 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
2010-03-24  7:16   ` Florian Wagner [this message]
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=20100324081615.4eb1b83d@auedv3.syscomp.de \
    --to=f_wagner@syscomp.de \
    --cc=keir.fraser@eu.citrix.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).