Debian

Xen 只能看到 512MB 的系統 RAM。應該是8GB。(UEFI 啟動)

  • June 27, 2012

我正在從 Debian Squeeze、核心 2.6.32-5-xen-amd64 引導 Xen 4.0。dom0 上的“xm dmesg”顯示:

Xen-e801 RAM map:
0000000000000000 - 0000000000091400 (usable)
0000000000100000 - 0000000020000000 (usable)
System RAM: 511MB (523844kB)

“xm 資訊”顯示:

total_memory         : 511
free_memory          : 42

引導載入程序為 grub2 EFI(Debian 軟體包 grub-efi-amd64 版本 1.99-14),配置如下:

multiboot /xen-4.0-amd64.gz placeholder
module /vmlinuz-2.6.32-5-xen-amd64 placeholder root=/dev/mapper/VG00-root ro reboot=acpi
module /initrd.img-2.6.32-5-xen-amd64

知道為什麼 Xen 只檢測到 512MB 嗎?有沒有人在uefi環境下成功啟動過xen?

更新:嘗試了 Debian Wheezy 的 Xen 4.1 並添加了 no-real-mode 以嘗試強制它使用多引導記憶體映射而不是 e801,似乎不起作用:

(XEN) Xen version 4.1.2 (Debian 4.1.2-1) (waldi@debian.org) (gcc version 4.6.2 (Debian 4.6.2-5) ) Sat Nov 26 17:29:46 UTC 2011
(XEN) Bootloader: GRUB 1.99-14
(XEN) Command line: placeholder no-real-mode e820-verbose
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 1 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Initial Xen-e801 RAM map:
(XEN)  0000000000000000 - 0000000000091400 (usable)
(XEN)  0000000000100000 - 0000000020000000 (usable)
(XEN) Checking MTRR ranges...
(XEN)  MTRR cap: d0a type: c00
(XEN)  MTRR[0]: base 6 mask e00000800
(XEN)  MTRR[1]: base 200000006 mask fc0000800
(XEN)  MTRR[2]: base bb800000 mask fff800800
(XEN)  MTRR[3]: base bc000000 mask ffc000800
(XEN)  MTRR[4]: base c0000000 mask fc0000800
(XEN)  MTRR[5]: base 23fe00000 mask fffe00800
(XEN)  MTRR[6]: base bb000006 mask fff800000
(XEN)  MTRR[7]: base 0 mask 0
(XEN)  MTRR[8]: base 0 mask 0
(XEN)  MTRR[9]: base 0 mask 0
(XEN) Xen-e801 RAM map:
(XEN)  0000000000000000 - 0000000000091400 (usable)
(XEN)  0000000000100000 - 0000000020000000 (usable)
(XEN) System RAM: 511MB (523844kB)
(XEN) ACPI: RSDP 000FCB00, 0024 (r2 ALASKA)
(XEN) ACPI: XSDT BA61D068, 004C (r1 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: FACP BA627250, 00F4 (r4 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: DSDT BA61D140, A10B (r2 ALASKA    A M I        0 INTL 20051117)
(XEN) ACPI: FACS BADD3F80, 0040
(XEN) ACPI: APIC BA627348, 0092 (r3 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: SSDT BA6273E0, 01D6 (r1 AMICPU     PROC        1 MSFT  3000001)
(XEN) ACPI: MCFG BA6275B8, 003C (r1 ALASKA    A M I  1072009 MSFT       97)
(XEN) ACPI: HPET BA6275F8, 0038 (r1 ALASKA    A M I  1072009 AMI.        4)
(XEN) Domain heap initialised
(XEN) ACPI: 32/64X FACS address mismatch in FADT - badd3f80/0000000000000000, using 32
(XEN) Processor #0 6:10 APIC version 21
(XEN) Processor #2 6:10 APIC version 21
(XEN) Processor #4 6:10 APIC version 21
(XEN) Processor #6 6:10 APIC version 21
(XEN) Processor #1 6:10 APIC version 21
(XEN) Processor #3 6:10 APIC version 21
(XEN) Processor #5 6:10 APIC version 21
(XEN) Processor #7 6:10 APIC version 21
(XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Table is not found!
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 3411.257 MHz processor.
(XEN) Initing memory sharing.
(XEN) I/O virtualisation disabled
(XEN) Enabled directed EOI with ioapic_ack_old on!
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using old ACK method
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN)  - Unrestricted Guest
(XEN) EPT supports 2MB super page.
(XEN) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging detected.
(XEN) Brought up 8 CPUs
(XEN) *** LOADING DOMAIN 0 ***
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1937000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   000000001a000000->000000001c000000 (104427 pages to be allocated)
(XEN)  Init. ramdisk: 000000001df1c000->000000001fbffc00
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff81937000
(XEN)  Init. ramdisk: ffffffff81937000->ffffffff8361ac00
(XEN)  Phys-Mach map: ffffffff8361b000->ffffffff83705678
(XEN)  Start info:    ffffffff83706000->ffffffff837064b4
(XEN)  Page tables:   ffffffff83707000->ffffffff83726000
(XEN)  Boot stack:    ffffffff83726000->ffffffff83727000
(XEN)  TOTAL:         ffffffff80000000->ffffffff83800000
(XEN)  ENTRY ADDRESS: ffffffff8169f200
(XEN) Dom0 has maximum 8 VCPUs
(XEN) Scrubbing Free RAM: done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: Errors and warnings
(XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
(XEN) Freed 216kB init memory.

通過註釋掉使用 BIOS e801 和 e820 映射的部分來“修復”。不知道為什麼非實模式不起作用。

diff -ur orig/xen-4.0.1//xen/arch/x86/setup.c mod/xen-4.0.1//xen/arch/x86/setup.c
--- orig/xen-4.0.1//xen/arch/x86/setup.c        2010-08-29 15:13:22.000000000 +0000
+++ mod/xen-4.0.1//xen/arch/x86/setup.c 2012-01-28 01:33:22.000000000 +0000
@@ -589,6 +589,8 @@
    if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) != 0 )
        EARLY_FAIL("Misaligned CPU0 stack.\n");

+#if 0
+    /* disable raw e801 and e820 for now in favor of multiboot provided maps */
    if ( e820_raw_nr != 0 )
    {
        memmap_type = "Xen-e820";
@@ -604,7 +606,9 @@
        e820_raw[1].type = E820_RAM;
        e820_raw_nr = 2;
    }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else 
+#endif 
+    if ( mbi->flags & MBI_MEMMAP )
    {
        memmap_type = "Multiboot-e820";
        while ( (bytes < mbi->mmap_length) && (e820_raw_nr < E820MAX) )

xm dmesg 現在顯示適當數量的 RAM

(XEN) Xen version 4.0.1 (Debian 4.0.1-4nobios1) (@) (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Jan 28 01:33:24 UTC 2012
(XEN) Bootloader: GRUB 1.99-14
(XEN) Command line: placeholder no-real-mode e820-verbose
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 2 MBR signatures
(XEN)  Found 2 EDD information structures
(XEN) Initial Multiboot-e820 RAM map:
(XEN)  0000000000000000 - 00000000000a0000 (usable)
(XEN)  0000000000100000 - 0000000020000000 (usable)
(XEN)  0000000020000000 - 0000000020200000 (reserved)
(XEN)  0000000020200000 - 0000000040000000 (usable)
(XEN)  0000000040000000 - 0000000040200000 (reserved)
(XEN)  0000000040200000 - 00000000ba5cc000 (usable)
(XEN)  00000000ba5cc000 - 00000000ba628000 (ACPI NVS)
(XEN)  00000000ba628000 - 00000000bab36000 (reserved)
(XEN)  00000000bab36000 - 00000000bab39000 (ACPI NVS)
(XEN)  00000000bab39000 - 00000000bad9f000 (reserved)
(XEN)  00000000bad9f000 - 00000000badb0000 (ACPI NVS)
(XEN)  00000000badb0000 - 00000000badc4000 (reserved)
(XEN)  00000000badc4000 - 00000000badc5000 (reserved)
(XEN)  00000000badc5000 - 00000000badc7000 (reserved)
(XEN)  00000000badc7000 - 00000000badc9000 (usable)
(XEN)  00000000badc9000 - 00000000badca000 (ACPI NVS)
(XEN)  00000000badca000 - 00000000badcb000 (reserved)
(XEN)  00000000badcb000 - 00000000badd2000 (reserved)
(XEN)  00000000badd2000 - 00000000baddc000 (ACPI NVS)
(XEN)  00000000baddc000 - 00000000bade9000 (reserved)
(XEN)  00000000bade9000 - 00000000bae2a000 (reserved)
(XEN)  00000000bae2a000 - 00000000bae35000 (reserved)
(XEN)  00000000bae35000 - 00000000bae38000 (reserved)
(XEN)  00000000bae38000 - 00000000bae7b000 (ACPI NVS)
(XEN)  00000000bae7b000 - 00000000bb000000 (usable)
(XEN)  00000000bb800000 - 00000000bfa00000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff000000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000023fe00000 (usable)
(XEN) Checking MTRR ranges...
(XEN)  MTRR cap: d0a type: c00
(XEN)  MTRR[0]: base 6 mask e00000800
(XEN)  MTRR[1]: base 200000006 mask fc0000800
(XEN)  MTRR[2]: base bb800000 mask fff800800
(XEN)  MTRR[3]: base bc000000 mask ffc000800
(XEN)  MTRR[4]: base c0000000 mask fc0000800
(XEN)  MTRR[5]: base 23fe00000 mask fffe00800
(XEN)  MTRR[6]: base bb000006 mask fff800000
(XEN)  MTRR[7]: base 0 mask 0
(XEN)  MTRR[8]: base 0 mask 0
(XEN)  MTRR[9]: base 0 mask 0
(XEN) Multiboot-e820 RAM map:
(XEN)  0000000000000000 - 00000000000a0000 (usable)
(XEN)  0000000000100000 - 0000000020000000 (usable)
(XEN)  0000000020000000 - 0000000020200000 (reserved)
(XEN)  0000000020200000 - 0000000040000000 (usable)
(XEN)  0000000040000000 - 0000000040200000 (reserved)
(XEN)  0000000040200000 - 00000000ba5cc000 (usable)
(XEN)  00000000ba5cc000 - 00000000ba628000 (ACPI NVS)
(XEN)  00000000ba628000 - 00000000bab36000 (reserved)
(XEN)  00000000bab36000 - 00000000bab39000 (ACPI NVS)
(XEN)  00000000bab39000 - 00000000bad9f000 (reserved)
(XEN)  00000000bad9f000 - 00000000badb0000 (ACPI NVS)
(XEN)  00000000badb0000 - 00000000badc7000 (reserved)
(XEN)  00000000badc7000 - 00000000badc9000 (usable)
(XEN)  00000000badc9000 - 00000000badca000 (ACPI NVS)
(XEN)  00000000badca000 - 00000000badd2000 (reserved)
(XEN)  00000000badd2000 - 00000000baddc000 (ACPI NVS)
(XEN)  00000000baddc000 - 00000000bae38000 (reserved)
(XEN)  00000000bae38000 - 00000000bae7b000 (ACPI NVS)
(XEN)  00000000bae7b000 - 00000000bb000000 (usable)
(XEN)  00000000bb800000 - 00000000bfa00000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff000000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000023fe00000 (usable)
(XEN) ACPI: RSDP 000FCB00, 0024 (r2 ALASKA)
(XEN) ACPI: XSDT BA61D068, 004C (r1 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: FACP BA627210, 00F4 (r4 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: DSDT BA61D140, A0CD (r2 ALASKA    A M I        0 INTL 20051117)
(XEN) ACPI: FACS BADD3F80, 0040
(XEN) ACPI: APIC BA627308, 0092 (r3 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: SSDT BA6273A0, 01D6 (r1 AMICPU     PROC        1 MSFT  3000001)
(XEN) ACPI: MCFG BA627578, 003C (r1 ALASKA    A M I  1072009 MSFT       97)
(XEN) ACPI: HPET BA6275B8, 0038 (r1 ALASKA    A M I  1072009 AMI.        4)
(XEN) System RAM: 8096MB (8291276kB)

引用自:https://serverfault.com/questions/342109