On Tue, 04 Mar 2008 07:18:48 -0800, "Jeremy Fitzhardinge"
<jeremy@xxxxxxxx> said:
Mark McLoughlin wrote:
This is a bit magic, is it worth splitting it out as something likeYes, is_paravirt() already exists for this purpose.
is_paravirt_environment() ?
Hi,
If it exists, it is well-hidden. A grep for is_paravirt on the testing
tree turns up nothing. Did you get the name right?
The code looking at the boot params will only work if we actually booted via the paravirt Linux boot protocol, which Xen doesn't at present.
I chose to code it exactly this way, because it is what is used in
head_32.S to choose how to start the kernel. Or is this code not
executed at all?
[excerpt form head_32.S]
cmpw $0x207, pa(boot_params + BP_version)
jb default_entry
/* Paravirt-compatible boot parameters. Look to see what
architecture
we're booting under. */
movl pa(boot_params + BP_hardware_subarch), %eax
cmpl $num_subarch_entries, %eax
jae bad_subarch
movl pa(subarch_entries)(,%eax,4), %eax
subl $__PAGE_OFFSET, %eax
jmp *%eax
[and]
subarch_entries:
.long default_entry /* normal x86/PC */
.long lguest_entry /* lguest hypervisor */
.long xen_entry /* Xen hypervisor */
num_subarch_entries = (. - subarch_entries) / 4
[end]
If this is indeed not executed, is there a way to detect whether
we can expect the environment to behave like a normal pc in terms
of magic addresses, bios areas, isa reserved address space and so
on?