Lin-bao Zhang
2011-Aug-30 05:24 UTC
[Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
in a same , I have xen-kernel and common kernel installed , in grub.conf , just like this: title Red Hat Enterprise Linux Server (2.6.18-268.el5xen) root (hd0,0) kernel /boot/xen.gz-2.6.18-268.el5 loglvl=all guest_loglvl=all sync_console console_to_ring com1=115200,8n1 console=com1 module /boot/vmlinuz-2.6.18-268.el5xen ro root=LABEL=/1 console=hvc0 earlyprintk=xen nomodeset module /boot/initrd-2.6.18-268.el5xen.img title Red Hat Enterprise Linux Server (2.6.18-268.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-268.el5 ro root=LABEL=/1 console=tty0 console=ttyS0,115200 initrd /boot/initrd-2.6.18-268.el5.img -------------- but I found difference about e820map from the two kernels : common kernel: -------------------------------- BIOS-provided physical RAM map: BIOS-e820: 0000000000010000 - 0000000000090400 (usable) BIOS-e820: 0000000000090400 - 0000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000007f5f0000 (usable) BIOS-e820: 000000007f5f0000 - 000000007f62c000 (ACPI data) BIOS-e820: 000000007f62c000 - 000000007f62d000 (usable) BIOS-e82: 000000007f62d000 - 00000000779d000 (reserved) BIOS-e820: 0000000779d000 - 000000007f7a0000 (ACPI data) BIOS-e0: 00000007f7a0000 - 0000000090000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fee10000 (reserved) BIOS-e820: 00000000ff800000 - 0000000100000000 (eservd) BIOS-e820: 0000000100000000 -0000000480000000 (usable) BIOS-e820: 0000002000000000 - 0000002400000000 (usable) BIOS-e820: 0000004000000000 - 0000004400000000 (usable) BIOS-e820: 0000006000000000 - 00000600000000 (usable) xen-kernel: Xen-e820 RAM map: (XEN) 0000000000000000 - 0000000000090400 (usable) (XEN) 0000000000090400 - 00000000000a0000 (reserved) (XEN) 00000000000f0000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 000000007f5f0000 (usable) (XEN) 000000007f5f0000 - 000000007f62c000 (ACPI data) (XEN) 000000007f62c000 - 000000007f62d000 (usable) (XEN) 000000007f62d000 - 000000007f79d000 (reserved) (XEN) 000000007f79d000 - 000000007f7a0000 (ACPI data) (XEN) 000000007f7a0000 - 0000000090000000 (reserved) (XEN) 00000000fec00000 - 00000000fee10000 (reserved) (XEN) 00000000ff800000 - 0000000100000000 (reserved) (XEN) 0000000100000000 - 0000000480000000 (usable) (XEN) 0000002000000000 - 0000002400000000 (usable) (XEN) 0000004000000000 - 0000004400000000 (usable) (XEN) 0000006000000000 - 0000006400000000 (usable) (XEN) System RAM: 65525MB (67098116kB) I diff them in a picture : as my existing knowledge , e820 map information is provided by BIOS ,it should be same for all OS(windows and linux) , OS just use it . but why xen-kernel''s e820 map is different from that of common-kernel. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Lin-bao Zhang
2011-Aug-30 07:44 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
sorry for lost that differing result of picture(I just paste it here ,it seems it can''t work), so , I paste this picture link:https://lh3.googleusercontent.com/-SfaWAj7_hzQ/TlyUQhgoUcI/AAAAAAAAAVk/Ax_ucBYVbD4/s800/e820%252520map.jpg I also upload my machine''s all booting messages including BIOS/grub/linuxkernel. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2011-Aug-30 14:00 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
On Mon, Aug 29, 2011 at 10:24:59PM -0700, Lin-bao Zhang wrote:> in a same , I have xen-kernel and common kernel installed , > in grub.conf , just like this: > > title Red Hat Enterprise Linux Server (2.6.18-268.el5xen) > root (hd0,0) > kernel /boot/xen.gz-2.6.18-268.el5 loglvl=all guest_loglvl=all sync_console console_to_ring com1=115200,8n1 console=com1 > module /boot/vmlinuz-2.6.18-268.el5xen ro root=LABEL=/1 console=hvc0 earlyprintk=xen nomodesetYou don''t need nomodeset on ''2.6.18'' kernels.> module /boot/initrd-2.6.18-268.el5xen.img > > title Red Hat Enterprise Linux Server (2.6.18-268.el5) > root (hd0,0) > kernel /boot/vmlinuz-2.6.18-268.el5 ro root=LABEL=/1 console=tty0 console=ttyS0,115200 > initrd /boot/initrd-2.6.18-268.el5.img > > -------------- > but I found difference about e820map from the two kernels : > > common kernel: -------------------------------- > BIOS-provided physical RAM map: > BIOS-e820: 0000000000010000 - 0000000000090400 (usable) > BIOS-e820: 0000000000090400 - 0000000000a0000 (reserved) > BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) > BIOS-e820: 0000000000100000 - 000000007f5f0000 (usable) > BIOS-e820: 000000007f5f0000 - 000000007f62c000 (ACPI data) > BIOS-e820: 000000007f62c000 - 000000007f62d000 (usable) > BIOS-e82: 000000007f62d000 - 00000000779d000 (reserved) > BIOS-e820: 0000000779d000 - 000000007f7a0000 (ACPI data) > BIOS-e0: 00000007f7a0000 - 0000000090000000 (reserved) > BIOS-e820: 00000000fec00000 - 00000000fee10000 (reserved) > BIOS-e820: 00000000ff800000 - 0000000100000000 (eservd) > BIOS-e820: 0000000100000000 -0000000480000000 (usable) > BIOS-e820: 0000002000000000 - 0000002400000000 (usable) > BIOS-e820: 0000004000000000 - 0000004400000000 (usable) > BIOS-e820: 0000006000000000 - 00000600000000 (usable) > > xen-kernel: > Xen-e820 RAM map: > (XEN) 0000000000000000 - 0000000000090400 (usable) > (XEN) 0000000000090400 - 00000000000a0000 (reserved) > (XEN) 00000000000f0000 - 0000000000100000 (reserved) > (XEN) 0000000000100000 - 000000007f5f0000 (usable) > (XEN) 000000007f5f0000 - 000000007f62c000 (ACPI data) > (XEN) 000000007f62c000 - 000000007f62d000 (usable) > (XEN) 000000007f62d000 - 000000007f79d000 (reserved) > (XEN) 000000007f79d000 - 000000007f7a0000 (ACPI data) > (XEN) 000000007f7a0000 - 0000000090000000 (reserved) > (XEN) 00000000fec00000 - 00000000fee10000 (reserved) > (XEN) 00000000ff800000 - 0000000100000000 (reserved) > (XEN) 0000000100000000 - 0000000480000000 (usable) > (XEN) 0000002000000000 - 0000002400000000 (usable) > (XEN) 0000004000000000 - 0000004400000000 (usable) > (XEN) 0000006000000000 - 0000006400000000 (usable) > (XEN) System RAM: 65525MB (67098116kB) > > I diff them in a picture :Huh? Can you just do a diff of the two texts or just do <=== on the email to point to it?> > > as my existing knowledge , e820 map information is provided by BIOS ,it should be same for all OS(windows and linux) , OS just use it . > but why xen-kernel''s e820 map is different from that of common-kernel. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Lin-bao Zhang
2011-Aug-30 15:30 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
>> I diff them in a picture :>Huh? Can you just do a diff of the two texts or just >do <=== on the email to point to it?orry for lost that differing result of picture(I just paste it here ,it seems it can''t work), so , I paste this picture link:https://lh3.googleusercontent.com/-SfaWAj7_hzQ/TlyUQhgoUcI/AAAAAAAAAVk/Ax_ucBYVbD4/s800/e820%252520map.jpg I also upload my machine''s all booting messages including BIOS/grub/linuxkernel. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2011-Aug-30 16:10 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
On Tue, Aug 30, 2011 at 08:30:32AM -0700, Lin-bao Zhang wrote:> > > >> I diff them in a picture : > > >Huh? Can you just do a diff of the two texts or just > >do <=== on the email to point to it? > orry for lost that differing result of picture(I just paste it here ,it seems it can''t work),I am having a hard time believing you can''t paste it (which you did in the previous email) and adding this in what you pasted: Xen: 00000000fff80000 - 0000000100000000 (reserved) Xen: 0000000100000000 - 0000000144b15000 (usable) <==== THIS ONE?> so , I paste this picture link:https://lh3.googleusercontent.com/-SfaWAj7_hzQ/TlyUQhgoUcI/AAAAAAAAAVk/Ax_ucBYVbD4/s800/e820%252520map.jpgAh, That. It is an extra 8MB phantom area that is used to setup mappings with other guests.> > I also upload my machine''s all booting messages including BIOS/grub/linuxkernel.There is no need for all of that. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Lin-bao Zhang
2011-Aug-31 07:44 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
I am sorry for my fault in capturing logs. from the picture, we can obviously find the common kernel''s BIOS e820map has mistake. I captured these logs from serial port , it seems that serial port has lost some key words,sometimes it will lost ''f'' ,so confused me. for example: I am sorry for waste your time. very sorry! You can ignore my old emails about this difference. let''s begin now: I used "dmesg " to get common kernel''s e820 map. this is different from XEN hypervisor''s e820 map: common kernel''s e820 map is like this: ------ BIOS-provided physical RAM map: BIOS-e820: 0000000000010000 - 0000000000090400 (usable) BIOS-e820: 0000000000090400 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000007f5f0000 (usable) BIOS-e820: 000000007f5f0000 - 000000007f62c000 (ACPI data) BIOS-e820: 000000007f62c000 - 000000007f62d000 (usable) BIOS-e820: 000000007f62d000 - 000000007f79d000 (reserved) BIOS-e820: 000000007f79d000 - 000000007f7a0000 (ACPI data) BIOS-e820: 000000007f7a0000 - 0000000090000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fee10000 (reserved) BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved) BIOS-e820: 0000000100000000 - 0000000480000000 (usable) BIOS-e820: 0000002000000000 - 0000002400000000 (usable) BIOS-e820: 0000004000000000 - 0000004400000000 (usable) BIOS-e820: 0000006000000000 - 0000006400000000 (usable) ------- then , I differ them just like this:https://lh4.googleusercontent.com/-HDA7ZNp_Bc0/Tl3a_sYgl-I/AAAAAAAAAV4/3Bt8LIziSlg/s800/e820%252520map_xen_and_commonkernel.jpg they are basicly same. only difference : (XEN) 0000000000000000 - 0000000000090400 (usable) common kernel: BIOS-e820: 0000000000010000 - 0000000000090400 (usable) I don''t think this difference is important for xen-hypervisor . when xen-hypervisor has been excuted, BIOS and grub has been ended, so xen-hypervisor can operate any memory area. xen-hypervisor can use low memory( < 1M) . based on my existed knowledge ,I know that : 0- 3FF 0000:0000-0000:03FF RAM real-mode interrupt vector table (IVT) 400- 4FF 0040:0000-0040:00FF BIOS data area (BDA) 1, IVT and BDA occupied 0x500 Bytes. "After all the BIOS functions have been called, and your kernel is loaded into memory somewhere, the bootloader or kernel may exit Real Mode forever (often by going into 32bit Protected Mode). If the kernel never uses Real Mode again, then the first 0x500 bytes of memory in the PC may be reused and overwritten. (However, it is very common to temporarily return to Real Mode in order to change the Video Display Mode.)" 2, grub stage1.S will be loaded 0x7c00 ~ 0x7dff (512Bytes). Grub stage2 will be loaded 0x8000 . from 0x8000~0x10000 ,about 32K,it seems that this 32K will be used by grub. some other information can be found at: http://wiki.osdev.org/Memory_Map_(x86)#.22Low.22_memory_.28.3C_1_MiB.29 -- now xen-hypervisor has been executed ,we can destroy any parts of grub and BIOS. so I think ,xen-hypervisor can arbitrarily any parts below 0x10000 (64K). _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2011-Aug-31 07:54 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
On 31/08/2011 08:44, "Lin-bao Zhang" <zhang.linbao@yahoo.com> wrote:> now xen-hypervisor has been executed ,we can destroy any parts of grub and > BIOS. > so I think ,xen-hypervisor can arbitrarily any parts below 0x10000 (64K).We keep our lives simple and do not dynamically allocate any memory below 1MB. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2011-Sep-01 08:02 UTC
Re: [Xen-devel] difference between xen hypervisor and common kernel on handling BIOS''s e820 map ?
On Tue, 2011-08-30 at 17:10 +0100, Konrad Rzeszutek Wilk wrote:> On Tue, Aug 30, 2011 at 08:30:32AM -0700, Lin-bao Zhang wrote: > > > > > > >> I diff them in a picture : > > > > >Huh? Can you just do a diff of the two texts or just > > >do <=== on the email to point to it? > > orry for lost that differing result of picture(I just paste it here ,it seems it can''t work), > > I am having a hard time believing you can''t paste it (which you did in the previous email) > and adding this in what you pasted: > > Xen: 00000000fff80000 - 0000000100000000 (reserved) > Xen: 0000000100000000 - 0000000144b15000 (usable) <==== THIS ONE? > > > so , I paste this picture link:https://lh3.googleusercontent.com/-SfaWAj7_hzQ/TlyUQhgoUcI/AAAAAAAAAVk/Ax_ucBYVbD4/s800/e820%252520map.jpg > > Ah, That. It is an extra 8MB phantom area that is used to setup mappings with > other guests.It''s described as being to "balance backend allocations", which AIUI means it''s there to provide an extra 8M of (empty) PFN space for the backend drivers to use for the page arrays where they map foreign pages. This might have made sense in the old days when netback/blkback would allocate there array and return the backing MFNs to Xen but in mainline we only shadow those MFNs rather than returning them to the hypervisor, don''t we? So the slack doesn''t really make sense any more. I fully expect 8M bears no relationship to the actual size used by the backends these days. Ian.> > > > > I also upload my machine''s all booting messages including BIOS/grub/linuxkernel. > > There is no need for all of that. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel