From: Chen Baozi Subject: Re: About booting Xen with UEFI on FastModel Date: Tue, 17 Dec 2013 12:52:26 +0800 Message-ID: <39800349-18CE-48DA-A8F7-121F4AB57326@gmail.com> References: <4B4B63C4-DD1A-447B-9922-2CF687A080A1@gmail.com> <1386603359.7812.21.camel@kazak.uk.xensource.com> <1386759544.30271.42.camel@kazak.uk.xensource.com> <387CD685-32A0-46E9-9534-4F630F702A05@gmail.com> <1386761354.30271.59.camel@kazak.uk.xensource.com> Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1386761354.30271.59.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: List Developer Xen List-Id: xen-devel@lists.xenproject.org On Dec 11, 2013, at 19:29, Ian Campbell wrote: > On Wed, 2013-12-11 at 19:06 +0800, Chen Baozi wrote: >> On Dec 11, 2013, at 18:59, Ian Campbell wrote: >> = >>> On Wed, 2013-12-11 at 13:06 +0800, Chen Baozi wrote: >>>> Hi Ian, >>>> = >>>> On Dec 9, 2013, at 23:35, Ian Campbell wrote: >>>> = >>>>> On Mon, 2013-12-09 at 23:15 +0800, Chen Baozi wrote: >>>>>> Hi all, >>>>>> = >>>>>> I noticed that upstream UEFI is now supported ARMv8 on FastModel. >>>>>> I=92ve tried it to boot Linux with it. And it works. But it seems >>>>>> it still cannot load Xen hypervisor properly. I=92m now looking for >>>>>> the reasons. Is there any difference for a firmware to load Xen >>>>>> and Linux kernel? >>>>> = >>>>> I think you are the first one to try Xen on EFI. >>>>> = >>>>> Are you using the EFI stub with Linux or are you launching via a >>>>> bootloader e.g. Grub-EFI? >>>> = >>>> After reading the source code, I think it is neither the EFI stub >>>> or a bootloader. A Linux Loader EFI application has been developed >>>> for ARM in EFI. >>> = >>> Do you have a link? I'm curious. >> = >> Instructions to EFI on AArch64: >> = >> http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=3DArmPla= tformPkg/AArch64 >> = >> And I=92m using the git clone of its svn repository: >> = >> https://github.com/tianocore/edk2.git >> = >> Under the tree, the Linux Loader locates at: >> = >> ArmPkg/Application/LinuxLoader > = > Ah that, yes I think that boots Linux using the zImage protocol. > = >>> = >>>> It is able to boot Linux either by tagged list or >>>> dtb method. However, it hardcoded the start address of 0x80000 = >>>> when loading Linux kernel, which make it unworkable for Xen after >>>> paging is enable. > = > 0x80000 is a problem due to the alignment not being 2M I think? > = > Really should look into fixing that. (would probably mean allowing Xen > to span 2 consecutive 2MB blocks and some additional fiddling during > bring up) Yes, it is. I hacked EFI to make it boot Xen with a 2M aligned address. And it seems to be OK. But I=92m afraid it is not simply allowing Xen to span 2 consecutive 2MB blocks, for it cannot deal with the different offsets within the page ( 0x80080000 % 2M !=3D 0x80200000 % 2M). = IMHO, there might be 3 ways to solve this problem: 1. If Xen bootstrap code detected it at an address not aligned with 2MB, then it copies itself to (x19 + 4M)\2M. 2. Modify LinuxLoader of EFI to load zImage at 2M aligned address. 3. Use smaller (e.g. 4K) page size in start-of-day page table. > = >> But I=92m not sure whether there would be other >>>> problems for it to boot Xen. And I=92ll continue to work on it until >>>> it can boot Xen successfully at the end. >>> = >>> Have fun ;-) >>> = >>>> (At least, there are early printk messages on the UART now, :-)) >>> = >>>> = >>>> Cheers, >>>> = >>>> Baozi