[RFC] First (incomplete) cut of Xen paravirt binding

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

 



Jeremy Fitzhardinge wrote
> This all makes me think it would be more awkward than helpful to have 
> the Xen boot path go through the normal startup_32 path.
>   

If you move the CPUID code out of head.S into C, it gets a lot cleaner:

        /* CPUID is virtualized. Now get vendor info. */
        cpuid(0, &new_cpu_data.cpuid_level,
              (int *)&new_cpu_data.x86_vendor_id[0],
              (int *)&new_cpu_data.x86_vendor_id[8],
              (int *)&new_cpu_data.x86_vendor_id[4]);

        /* Get feature bits. */
        cpuid(1, &eax, &ebx, &ecx, &edx);

        new_cpu_data.x86 = (eax >> 8) & 0xf;
        new_cpu_data.x86_model = (eax >> 4) & 0xf;
        new_cpu_data.x86_mask = eax & 0xf;
        new_cpu_data.x86_capability[0] = edx;
        new_cpu_data.hard_math = 1;

> Zach proposed a change to the beginning of startup_32 to see if its 
> running in ring != 0 or if paging is already enabled, and then jumping 
> to a startup_paravirt entrypoint.  That's workable, but it essentially 
> means we're creating a distinct hypervisor boot protocol.  That's not 
> necessarily a bad thing - and it could be made to look more like the 
> normal boot protocol - but because the setup code is so simple there 
> doesn't seem to be a lot to be gained from it.  In the Xen case, it 
> makes more sense to simply have a separate Xen-specific entrypoint to do 
> a little bit of setup before jumping into start_kernel.
>   

Why do you insist that Xen have a separate kernel entry point?  
Publishing and maintaining multiple entry points is messy.  Please come 
up with a convincing argument that can't be thwarted with a couple lines 
of code.  The only thing you need to do is stash %esi to save the Xen 
start info.  It might not be a bad idea to preserve the full BSP 
register state on entry, even for native hardware.  And we can certainly 
accomodate stashing %esi away.  You'll get to run the hypervisor 
specific code a few instructions later, when we call out to fill in the 
paravirt-ops table based on %ebx.  And then you can write paravirt_ops 
hooks for the things Xen has changed - command line, physical e820 map, 
and do everything in C-code along the standard Linux startup path.

Zach


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux