Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5733658ybp; Tue, 15 Oct 2019 04:20:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlFAryRZGO+SqA+Kp7qlXPMvrf65NYfMoQb5Fi55IqmNtykNT9QL76mkNxsl6k+fW/NDiL X-Received: by 2002:a50:cbcd:: with SMTP id l13mr32778102edi.18.1571138427935; Tue, 15 Oct 2019 04:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571138427; cv=none; d=google.com; s=arc-20160816; b=KRuDF31IldgCFj8eOfvwLuUHHBg0BFlbG7aYibqrXpSADKucEUxJaz+8DbJtH1/lXp Qei4/MXsSw+Xg3Q9GVY2yLW3tO67wNnuFwv5xYGKTPrci7XEF3f+xj97pLBR3SeyJtnP ij4MQMJPOqf/HZvbxtnjNYdGN4r5HPD4qJfnWGkzyLsvBZMMAWH+uf9axokX8x+6WCbk hdJ2khaZ3fjQAALHJ4/Qtvyv3O7a6nv5VrjNIEEB3b5QdwWhcvvtNfl0lp1DW9hrnxeH Ju+Yb+cS7upkBZSXvA1iuOE8OgTQIJPYYJMrrRH0+nI3RLZWM4PaCIfjpc/DRDhjWczL J8EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UZ54kdpq4dN0xg7tNl0XTAZQNDmTsrGCpCblje38bPk=; b=oazNo2eeLTSWPQE2LeGGojX8vgIxEv67eaWIEjt4wf1cqOo13eAlZ0mldbmrfqTGay dtWJf/zxkw0gaLRbeDO8EW624NoALGbgvyc5TXg7+xYCkJO4Dl7Ixc9sap8VowmIhjMp pKOsWSvO7zv3yTiBA0wCCj1ksT+FiRnigMOKHu3/K9+OF+5dGumbMKZPEzHPKgAOOD2J 2G7nssM0qOHYxST1UR7weq8qJXE/lz5ejcY/Czcf5hQevwnyDXQVgQ5DORT3bav1CAGA GOhao8O/a+427fHILz+RvBB4ky5Ab1pg5pkW1G4Vx8An/qsA4ogrFGSHB3C2Mrbt2mLH 1Yfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UZEyVDHV; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si12623075edv.393.2019.10.15.04.20.04; Tue, 15 Oct 2019 04:20:27 -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=@kernel.org header.s=default header.b=UZEyVDHV; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbfJOJjN (ORCPT + 99 others); Tue, 15 Oct 2019 05:39:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbfJOJjN (ORCPT ); Tue, 15 Oct 2019 05:39:13 -0400 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0FA2721927; Tue, 15 Oct 2019 09:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571132352; bh=DB8hF9mrIlctxtCr1I2Tw2azLiFwJDjpe2ZayJysOdo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UZEyVDHVYglO8OnckdBRF5pL9SfDRyCftG2g8kENvBr1hAlvhpPmfJgzzaY3G94Ni sach113/P/YHhuPGD1kIcoO4hYqcR5XVhNVJEv9wbK9qHgRiz82Ibo+HQ6w7EfgcJp m/np8cyrF5RXtuKCCzeIfJga43GOqZ7ErsPMVJlc= Received: by mail-qk1-f178.google.com with SMTP id 201so18518392qkd.13; Tue, 15 Oct 2019 02:39:12 -0700 (PDT) X-Gm-Message-State: APjAAAWOtpKccO9hRsD34pROzsb0DQ0KXdN2t9+LovCeurioOuS/0Hco PyKFBi3ehzaNUMaHQrXi3mNOo77vvjfey8p+N8Q= X-Received: by 2002:a37:715:: with SMTP id 21mr31540556qkh.148.1571132351050; Tue, 15 Oct 2019 02:39:11 -0700 (PDT) MIME-Version: 1.0 References: <20191015092937.11244-1-parri.andrea@gmail.com> In-Reply-To: <20191015092937.11244-1-parri.andrea@gmail.com> From: Wei Liu Date: Tue, 15 Oct 2019 10:39:00 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/hyperv: Set pv_info.name to "Hyper-V" To: Andrea Parri Cc: Linux Kernel List , Linux on Hyper-V List , x86@kernel.org, "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Michael Kelley , Vitaly Kuznetsov , Dexuan Cui Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Oct 2019 at 10:30, Andrea Parri wrote: > > Michael reported that the x86/hyperv initialization code printed the > following dmesg when running in a VM on Hyper-V: > > [ 0.000738] Booting paravirtualized kernel on bare hardware > > Let the x86/hyperv initialization code set pv_info.name to "Hyper-V"; > with this addition, the dmesg read: > > [ 0.000138] Booting paravirtualized kernel on Hyper-V > > Reported-by: Michael Kelley > Signed-off-by: Andrea Parri > --- > arch/x86/kernel/cpu/mshyperv.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c > index 105844d542e5..c7d1801fa88b 100644 > --- a/arch/x86/kernel/cpu/mshyperv.c > +++ b/arch/x86/kernel/cpu/mshyperv.c > @@ -154,6 +154,8 @@ static uint32_t __init ms_hyperv_platform(void) This function is for platform detection only. > if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) > return 0; > > + pv_info.name = "Hyper-V"; > + At this point we're not sure if Linux is really running on Hyper-V yet. Setting pv_info.name should be moved to the init_platform hook, i.e. ms_hyperv_init_platform. Wei. > cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS, > &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]); > > -- > 2.17.1 >