lkml.org 
[lkml]   [2019]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/2] KVM: x86: Implement the arch-specific hook to report the VM UUID
From
Date
On 14.05.19 08:16, Filippo Sironi wrote:
> On x86, we report the UUID in DMI System Information (i.e., DMI Type 1)
> as VM UUID.
>
> Signed-off-by: Filippo Sironi <sironi@amazon.de>
> ---
> arch/x86/kernel/kvm.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index 5c93a65ee1e5..441cab08a09d 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -25,6 +25,7 @@
> #include <linux/kernel.h>
> #include <linux/kvm_para.h>
> #include <linux/cpu.h>
> +#include <linux/dmi.h>
> #include <linux/mm.h>
> #include <linux/highmem.h>
> #include <linux/hardirq.h>
> @@ -694,6 +695,12 @@ bool kvm_para_available(void)
> }
> EXPORT_SYMBOL_GPL(kvm_para_available);
>
> +const char *kvm_para_get_uuid(void)
> +{
> + return dmi_get_system_info(DMI_PRODUCT_UUID);

This adds a new dependency on CONFIG_DMI. Probably best to guard it with
an #if IS_ENABLED(CONFIG_DMI).

The concept seems sound though.


Alex

> +}
> +EXPORT_SYMBOL_GPL(kvm_para_get_uuid);
> +
> unsigned int kvm_arch_para_features(void)
> {
> return cpuid_eax(kvm_cpuid_base() | KVM_CPUID_FEATURES);
>

\
 
 \ /
  Last update: 2019-05-16 15:57    [W:0.676 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site