From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: david.vrabel@citrix.com, JGross@suse.com,
Matt Fleming <matt@codeblueprint.co.uk>,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
roger.pau@citrix.com
Subject: Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest
Date: Fri, 14 Oct 2016 15:34:45 -0400 [thread overview]
Message-ID: <fc448a0b-bb35-7383-9e44-ed7a71b3c2d1@oracle.com> (raw)
In-Reply-To: <20161014191403.GA16777@localhost.localdomain>
On 10/14/2016 03:14 PM, Konrad Rzeszutek Wilk wrote:
>
>> +
>> + memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
>> +
>> + memmap.nr_entries = ARRAY_SIZE(pvh_bootparams.e820_map);
>> + set_xen_guest_handle(memmap.buffer, pvh_bootparams.e820_map);
>> + if (HYPERVISOR_memory_op(XENMEM_memory_map, &memmap)) {
>> + xen_raw_console_write("XENMEM_memory_map failed\n");
> Should we print the error value at least?
I will have to check again but IIRC there was something about not being
able to format strings properly this early. But if we can --- sure.
>> + BUG();
>> + }
>> +
>> + pvh_bootparams.e820_map[memmap.nr_entries].addr =
>> + ISA_START_ADDRESS;
> What if nr_entries is 128? Should we double-check for that?
>
OK.
>> + */
>> +void __init xen_prepare_pvh(void)
>> +{
>> + u32 eax, ecx, edx, msr;
> msr = 0 ?
Won't cpuid() (or cpuid_ebx()) overwrite it anyway?
>> + u64 pfn;
>> +
>> + xen_pvh = 1;
>> +
>> + cpuid(xen_cpuid_base() + 2, &eax, &msr, &ecx, &edx);
> cpuid_ebx ? And that way you don't have have ecx and edx?
>> + cli
>> + cld
>> +
>> + mov $_pa(gdt), %eax
>> + lgdt (%eax)
>> +
>> + movl $(__BOOT_DS),%eax
>> + movl %eax,%ds
>> + movl %eax,%es
>> + movl %eax,%ss
>> +
>> + /* Stash hvm_start_info */
>> + mov $_pa(pvh_start_info), %edi
>> + mov %ebx, %esi
> Should we derference the first byte or such to check for the magic
> string? Actually I am not even seeing the check in the C code?
Yes, good idea.
>> + .code64
>> +1:
>> + call xen_prepare_pvh
>> +
>> + /* startup_64 expects boot_params in %rsi */
> ..
>> + mov $_pa(pvh_bootparams), %rsi
>> + movq $_pa(startup_64), %rax
>> + jmp *%rax
>> +
>> +#else /* CONFIG_X86_64 */
>> +
>> + call setup_pgtable_32
>> +
>> + mov $_pa(initial_page_table), %eax
>> + movl %eax, %cr3
>> +
>> + movl %cr0, %eax
>> + orl $(X86_CR0_PG | X86_CR0_PE), %eax
>> + movl %eax, %cr0
>> +
>> + ljmp $__BOOT_CS,$1f
>> +1:
>> + call xen_prepare_pvh
>> + mov $_pa(pvh_bootparams), %esi
>> +
>> + /* startup_32 doesn't expect paging and PAE to be on */
> Should 'startup_32' be documented with this?
It is documented in Documentation/x86/boot.txt and in the startup_64 code.
-boris
next prev parent reply other threads:[~2016-10-14 19:34 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 18:05 [PATCH 0/8] PVH v2 support Boris Ostrovsky
2016-10-14 18:05 ` [PATCH 1/8] xen/x86: Remove PVH support Boris Ostrovsky
2016-10-14 18:31 ` [Xen-devel] " Konrad Rzeszutek Wilk
2016-10-18 13:46 ` Juergen Gross
2016-10-18 14:45 ` Boris Ostrovsky
2016-10-18 15:33 ` Juergen Gross
2016-10-18 15:42 ` Boris Ostrovsky
2016-10-14 18:05 ` [PATCH 2/8] x86/head: Refactor 32-bit pgtable setup Boris Ostrovsky
2016-10-14 18:31 ` hpa
2016-10-14 18:44 ` Boris Ostrovsky
2016-10-14 19:04 ` hpa
2016-10-14 19:18 ` Boris Ostrovsky
2016-10-31 12:33 ` Boris Ostrovsky
2016-12-01 15:33 ` Boris Ostrovsky
2016-12-02 9:45 ` Ingo Molnar
2016-12-02 14:04 ` Boris Ostrovsky
2016-12-02 16:08 ` Ingo Molnar
2016-12-02 17:52 ` hpa
2016-12-02 19:49 ` Boris Ostrovsky
2016-12-03 5:49 ` Ingo Molnar
2016-12-03 6:36 ` hpa
2016-10-14 18:05 ` [PATCH 3/8] xen/pvh: Import PVH-related Xen public interfaces Boris Ostrovsky
2016-10-14 18:34 ` [Xen-devel] " Konrad Rzeszutek Wilk
2016-10-21 10:58 ` Juergen Gross
2016-10-14 18:05 ` [PATCH 4/8] xen/pvh: Bootstrap PVH guest Boris Ostrovsky
2016-10-14 18:38 ` [Xen-devel] " Andrew Cooper
2016-10-14 18:55 ` Boris Ostrovsky
2016-10-14 19:12 ` Andrew Cooper
2016-10-14 19:14 ` Konrad Rzeszutek Wilk
2016-10-14 19:34 ` Boris Ostrovsky [this message]
2016-10-14 18:05 ` [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Boris Ostrovsky
2016-10-14 19:16 ` [Xen-devel] " Konrad Rzeszutek Wilk
2016-10-14 19:37 ` Boris Ostrovsky
2016-10-26 10:42 ` Roger Pau Monné
2016-10-26 14:50 ` Boris Ostrovsky
2016-10-26 15:18 ` Roger Pau Monné
2016-10-26 16:06 ` Boris Ostrovsky
2016-10-14 18:05 ` [PATCH 6/8] xen/pvh: Initialize grant table for PVH guests Boris Ostrovsky
2016-10-14 19:19 ` [Xen-devel] " Konrad Rzeszutek Wilk
2016-10-14 19:43 ` Boris Ostrovsky
2016-10-14 19:51 ` Konrad Rzeszutek Wilk
2016-10-14 20:02 ` Boris Ostrovsky
2016-10-18 16:08 ` Juergen Gross
2016-10-18 16:40 ` Boris Ostrovsky
2016-10-19 5:47 ` Juergen Gross
2016-10-14 18:05 ` [PATCH 7/8] xen/pvh: PVH guests always have PV devices Boris Ostrovsky
2016-10-14 19:17 ` [Xen-devel] " Konrad Rzeszutek Wilk
2016-10-18 15:54 ` Juergen Gross
2016-10-14 18:05 ` [PATCH 8/8] xen/pvh: Enable CPU hotplug Boris Ostrovsky
2016-10-14 18:41 ` [Xen-devel] " Andrew Cooper
2016-10-14 19:01 ` Boris Ostrovsky
2016-10-27 14:25 ` Boris Ostrovsky
2016-10-27 15:00 ` Andrew Cooper
2016-10-27 16:23 ` Boris Ostrovsky
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=fc448a0b-bb35-7383-9e44-ed7a71b3c2d1@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JGross@suse.com \
--cc=david.vrabel@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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
all inboxes | Powered by JetHome®