Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1501168
| From | Boris Ostrovsky <boris.ostrovsky@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest |
| Date | 2016-10-14 21:40 +0200 |
| Message-ID | <ssguK-5DH-13@gated-at.bofh.it> (permalink) |
| References | <ssffk-4Pd-17@gated-at.bofh.it> <ssffk-4Pd-27@gated-at.bofh.it> <ssgbn-5t6-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/8] PVH v2 support Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
[PATCH 7/8] xen/pvh: PVH guests always have PV devices Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [Xen-devel] [PATCH 7/8] xen/pvh: PVH guests always have PV devices Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-10-14 21:30 +0200
Re: [PATCH 7/8] xen/pvh: PVH guests always have PV devices Juergen Gross <jgross@suse.com> - 2016-10-18 18:00 +0200
[PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [Xen-devel] [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-10-14 21:20 +0200
Re: [Xen-devel] [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 21:40 +0200
Re: [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Roger Pau Monné <roger.pau@citrix.com> - 2016-10-26 12:50 +0200
Re: [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-26 16:50 +0200
Re: [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Roger Pau Monné <roger.pau@citrix.com> - 2016-10-26 17:20 +0200
Re: [PATCH 5/8] xen/pvh: Prevent PVH guests from using PIC, RTC and IOAPIC Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-26 18:10 +0200
[PATCH 8/8] xen/pvh: Enable CPU hotplug Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [Xen-devel] [PATCH 8/8] xen/pvh: Enable CPU hotplug Andrew Cooper <andrew.cooper3@citrix.com> - 2016-10-14 20:50 +0200
Re: [Xen-devel] [PATCH 8/8] xen/pvh: Enable CPU hotplug Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 21:10 +0200
[PATCH 4/8] xen/pvh: Bootstrap PVH guest Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest Andrew Cooper <andrew.cooper3@citrix.com> - 2016-10-14 20:50 +0200
Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 21:00 +0200
Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest Andrew Cooper <andrew.cooper3@citrix.com> - 2016-10-14 21:20 +0200
Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-10-14 21:20 +0200
Re: [Xen-devel] [PATCH 4/8] xen/pvh: Bootstrap PVH guest Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 21:40 +0200
[PATCH 2/8] x86/head: Refactor 32-bit pgtable setup Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [PATCH 2/8] x86/head: Refactor 32-bit pgtable setup hpa@zytor.com - 2016-10-14 20:40 +0200
Re: [PATCH 2/8] x86/head: Refactor 32-bit pgtable setup Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:50 +0200
Re: [PATCH 2/8] x86/head: Refactor 32-bit pgtable setup hpa@zytor.com - 2016-10-14 21:10 +0200
Re: [PATCH 2/8] x86/head: Refactor 32-bit pgtable setup Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 21:30 +0200
[PATCH 3/8] xen/pvh: Import PVH-related Xen public interfaces Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [Xen-devel] [PATCH 3/8] xen/pvh: Import PVH-related Xen public interfaces Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-10-14 20:40 +0200
Re: [PATCH 3/8] xen/pvh: Import PVH-related Xen public interfaces Juergen Gross <jgross@suse.com> - 2016-10-21 13:00 +0200
[PATCH 1/8] xen/x86: Remove PVH support Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-14 20:20 +0200
Re: [Xen-devel] [PATCH 1/8] xen/x86: Remove PVH support Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-10-14 20:40 +0200
Re: [PATCH 1/8] xen/x86: Remove PVH support Juergen Gross <jgross@suse.com> - 2016-10-18 15:50 +0200
Re: [PATCH 1/8] xen/x86: Remove PVH support Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-18 16:50 +0200
Re: [PATCH 1/8] xen/x86: Remove PVH support Juergen Gross <jgross@suse.com> - 2016-10-18 17:40 +0200
Re: [PATCH 1/8] xen/x86: Remove PVH support Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-10-18 17:50 +0200
csiph-web