Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp652574yba; Thu, 16 May 2019 06:58:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKgffy/V2gn0pJywNIDTK2UvPZY8ZGjbN7Uiu01Ni6RvOeSt6oN17J8poO1wCTxv1dFVK+ X-Received: by 2002:a65:610b:: with SMTP id z11mr30554482pgu.204.1558015098224; Thu, 16 May 2019 06:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558015098; cv=none; d=google.com; s=arc-20160816; b=Sn1q4b/BRCdrUa+/XZuqihkrIKSnxQrNKi61+eTIt7JdXS+vj3l6Vy3XkM7gcipiW9 mzArD2MbphnwJjB9der1GmqCj6v50S66xwotGH+fiZ11PPJwO0jhWPb1FH8U8c72Wzms zlJgBnVgF4OmKTTEU/NbJlUXLwxL7G+NSQbnmZdhSxir/D3NpyCfRwZkISpS8svbFrQX 5Y4aJPb2VHZAJaTgtnzW+8dscJ96xHLkN/4Sinkl2FYQwEl9UiOAqLgWryHYcZyBM2L8 JhYiQ4wvNo1AECBZbnTlGw1+X3H6AfERQToX2JRd6Jqv2Cw2Bu+b7/AXoE9kmJ79jaoB 3vDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=d3tF05X6+IMz0z3pdmsgwMoJMbbYKYQyJW/W5t9SFtI=; b=IwCrP2IwYua291dYcAz2xVG/b2ZpFzDu+PhlugL7pQrE7oW0Vp9dJmc2QHKPmEDcPw iInqVyzHR2/yx4AyBjw2HT8aTNdsTTG+nUsAamKc+0pDtlTIXzxg9Kz4w5QHq1KmatlQ t+4sJmZZ1CFjqC1YnxvC2CKl9uzUR9Od5EkKUfPpKyrLEXnyDFxdi6IwOFH80hClg1TS 5Iyq2ht5un2Cqm0Sg2GuBedRyrj05Go9n7A99HgIvnk2N6YW9PifT3LV1840ZUMLrpj5 oHSxuilXupyqJtoOQd5cIlxbVrzqY5Egbt6ONZI5sgU4BWetf5NfvJPXdDtPmPb7z5v7 YJ0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="k2B77y/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si5187340pgx.421.2019.05.16.06.58.02; Thu, 16 May 2019 06:58:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="k2B77y/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbfEPN4M (ORCPT + 99 others); Thu, 16 May 2019 09:56:12 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:64141 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbfEPN4M (ORCPT ); Thu, 16 May 2019 09:56:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1558014971; x=1589550971; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=d3tF05X6+IMz0z3pdmsgwMoJMbbYKYQyJW/W5t9SFtI=; b=k2B77y/v8CaQC0rGb6Xqbv96CORAbw7wm1ve0QiujIWZVQYmLpybVI5I Mq/5fFi63ZZIFN139tHLU3bXfgQvYLHu4CABqsoGFY4oxPEG73vNm9ZHV GqOTaFdTro8T1PZoiQjEcrpVjl+Qxfxo8CBZNZ5J516YOM9QYd/EeJ5nT o=; X-IronPort-AV: E=Sophos;i="5.60,476,1549929600"; d="scan'208";a="402404736" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 May 2019 13:56:04 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id x4GDu3Lg022882 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 16 May 2019 13:56:04 GMT Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 16 May 2019 13:56:03 +0000 Received: from macbook-2.local (10.43.161.34) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 16 May 2019 13:56:02 +0000 Subject: Re: [PATCH v2 2/2] KVM: x86: Implement the arch-specific hook to report the VM UUID To: Filippo Sironi , , , , , , , , References: <1539078879-4372-1-git-send-email-sironi@amazon.de> <1557847002-23519-1-git-send-email-sironi@amazon.de> <1557847002-23519-3-git-send-email-sironi@amazon.de> From: Alexander Graf Message-ID: Date: Thu, 16 May 2019 06:56:01 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1557847002-23519-3-git-send-email-sironi@amazon.de> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.161.34] X-ClientProxiedBy: EX13D12UWC002.ant.amazon.com (10.43.162.253) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > #include > #include > +#include > #include > #include > #include > @@ -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); >