qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Booting kernels with PVHVM documentation?


From: Alex Bennée
Subject: Re: [Qemu-devel] Booting kernels with PVHVM documentation?
Date: Tue, 04 Jun 2019 19:34:09 +0100
User-agent: mu4e 1.3.2; emacs 26.1

Stefano Garzarella <address@hidden> writes:

> Hi Alex,
> sorry for the big delay, but I was traveling without my PC.
>
> On Wed, Mar 06, 2019 at 05:51:05PM +0000, Alex Bennée wrote:
>>
>> Hi,
>>
>> I've been looking at using PVH as an alternative to a long bios boot
>> sequence to boot some x86_64 test kernels for tests/tcg. I'm finding it
>> hard to piece together all the bits but I naively thought it would just
>> be a case of adding a few ELF NOTES to my boot.S with something like:
>>
>>           ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR 0x100000)
>>           ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR _start)
>>           ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY,   _ASM_PTR 0)    /* entry 
>> == virtbase */
>>           ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   _ASM_PTR 0)
>>
>>           .code64
>
> Can you try to use .code32?
> The pvh.bin optionrom will jump to the image in 32-bit mode.
> I don't have a lot of experience, but looking at arch/x86/platform/pvh/head.S
> (Linux), I saw that entry point is under .code32, than it will switch to
> 64-bit mode.

That doesn't seem to make any difference:

./qemu-system-x86_64 -monitor none -display none -chardev stdio,id=out -device 
isa-debugcon,chardev=out -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel 
./tests/hello -vga none
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note


<snip>
>
>>   * are they any special linker rules required for the Xen.notes?
>
> I don't know, but I'll investigate on it.
>
>>
>> And finally:
>>
>>   * is this idea of mine a weird abuse of the PVHVM boot protocol or
>>     does it make sense?
>
> IMHO it isn't an abuse and make sense to boot a bare-metal application
> directly in 32-bit mode using the PVH loader.
>
> If you want to share with me a part of your code, I'll try to play with
> it.

My current hacking branch is:

  https://github.com/stsquad/qemu/tree/testing/next-with-x86-64-tests

--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]