Anthony Liguori wrote:
quoted text > This patch refactors the current hypercall infrastructure to better
support
quoted text > live
> migration and SMP. It eliminates the hypercall page by trapping the
UD
quoted text > exception that would occur if you used the wrong hypercall instruction
for the
quoted text > underlying architecture and replacing it with the right one lazily.
>
> It also introduces the infrastructure to probe for hypercall available
via
quoted text > CPUID leaves 0x40000000. CPUID leaf 0x40000001 should be filled out
by
quoted text > userspace.
>
> A fall-out of this patch is that the unhandled hypercalls no longer
trap to
quoted text > userspace. There is very little reason though to use a hypercall to
> communicate
> with userspace as PIO or MMIO can be used. There is no code in tree
that uses
quoted text > userspace hypercalls.
>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
> diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
> index 3b29256..cc5dfb4 100644
> --- a/include/linux/kvm_para.h
> +++ b/include/linux/kvm_para.h
> @@ -1,73 +1,110 @@
> #ifndef __LINUX_KVM_PARA_H
> #define __LINUX_KVM_PARA_H
>
> -/*
> - * Guest OS interface for KVM paravirtualization
> - *
> - * Note: this interface is totally experimental, and is certain to
change
quoted text > - * as we make progress.
> +/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx.
It
quoted text > + * should be used to determine that a VM is running under KVM.
<snip>
quoted text > +
> +static inline int kvm_para_available(void)
> +{
> + unsigned int eax, ebx, ecx, edx;
> + char signature[13];
> +
> + cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx);
> + memcpy(signature + 0, &ebx, 4);
> + memcpy(signature + 4, &ecx, 4);
> + memcpy(signature + 8, &edx, 4);
> + signature[12] = 0;
> +
> + if (strcmp(signature, "KVMKVMKVM") == 0)
quoted text > + return 1;
> +
> + return 0;
> +}
I think we should compare 12 characters (not just 9, as far as my eyes
tell), and can we use some cute one, like "FantasticKVM"? ;-)
Jun
---
Intel Open Source Technology Center
-
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
RE: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructur... , Nakajima, Jun , (Mon Sep 17, 5:56 pm)