From nobody Tue Nov 11 08:52:00 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569855763; cv=none; d=zoho.com; s=zohoarc; b=PmrIpb5mGVtfOSqczOwd8jmLjIc90GCprlPqTWTc/3wWlhqcbni4VixcTM5KIVhaKhFtpfgbXwvaUtW8ppy9lwTw85szEZi8g6i4b7oIh9DJ6azlKqJ09vauTgAGT+/t2sXUnhCfh99OyirqVypNQS9KAvx9aEMtVXRVUAyutkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569855763; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vCoS4mz0Mpv87pH0DMIu60hMH0TbP+4Kj1ssNLLraDw=; b=ma5bFqkqHPQ27zzML//ZxJzL5Q/7KZstYCgcwpvJ5XZvAFWakjE4lujTs65wbhpHl/MCE4CBknfqUgqij14ttv3baAEPETnob52tQbVnGdYvd+eqWfnZXbflqjcqG/NobgM1Ev2HZ8OJYCW9Du/Qfk4yY1CPk8hT8QW0QhCx3Mc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569855763160605.8581914515539; Mon, 30 Sep 2019 08:02:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iExB5-0006Kh-Rj; Mon, 30 Sep 2019 15:01:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iExB4-0006Jo-AF for xen-devel@lists.xenproject.org; Mon, 30 Sep 2019 15:01:30 +0000 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by localhost (Halon) with ESMTPS id 1a8a1548-e393-11e9-8628-bc764e2007e4; Mon, 30 Sep 2019 15:00:56 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id m18so13137365wmc.1 for ; Mon, 30 Sep 2019 08:00:56 -0700 (PDT) Received: from debian.mshome.net (207.148.159.143.dyn.plus.net. [143.159.148.207]) by smtp.gmail.com with ESMTPSA id f143sm32870852wme.40.2019.09.30.08.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2019 08:00:54 -0700 (PDT) X-Inumbo-ID: 1a8a1548-e393-11e9-8628-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iyiOgqrZxFUGRGfUCjGuZn7FzXfpH61oMe3dzY2NCCg=; b=RnaBNo+g88s5ScTLq1f9UR5Pwr2m+NZAzF0m/CeCOp5JXdWutjRcUNGDSpcQoV3exO oC7JA8k8SrwAZKA82J4F/rNfg3Wc9wH4gqjEogFYo2rNaceLdmEoDPCGxkFxr67J0VMo uiNirK7/qH2MvLPciOw3gapnceYwuboXyI/370E219yjOv40rKt0ZajHbN343MWxdJPn JQIlvGnozFayU6EwL+B3vgBe9TJLkPfxpldx2/dOG7ufKfHb6DrxxvjJWcDOc28pFRRr /KsB/Nh9rBCB7LBf9L9W6UezZXUJopya1DKUbAimmFmgvNpme5m9W/RJRtJIBu2HCf13 z0Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iyiOgqrZxFUGRGfUCjGuZn7FzXfpH61oMe3dzY2NCCg=; b=CMAFEPfUif1+hbWBLEB62KGE5oOW/H3kJAWWt+KhygMqePYlRk38MC9n9Wabgbv3Gl FA0JzxSAcIToK+HzmCt4QlZ28YkujtJb+0VZhJYbQghL3plMRyYWatQtf7/Pwcg6P4Hc pLGZZLaYSalMjwdOaboFXkgubDTTncvdfpkRllnITMnQYySWXHBPQUI2oSY6Dc/gh2MP nIGr5kOz+mUTc9r+E/tkKa9Vfd62lQX+dbazxWXBJNAznJYHv7O0dukiVerQcJ4oZpzZ 0uwUKk6WEYNm8FNSHScDwUMsEdmQiW7OVS4Yo7zPYA0F0hcawk2VjAJ4UJUJJ/ce9LD1 Rp0g== X-Gm-Message-State: APjAAAXJfbbFLPZ6gcgQWcI5lsp1WWBjNKfHBdHE+BNMxU790cf4oXev LDfDIh2feHlImzziYsXRPTwW3Y5GQUE= X-Google-Smtp-Source: APXvYqwOBR+rM15fjyUePABCbF2i3PLVBkhYoBDStz+QB1AflVfmXILzGTjTV/v2KZF7/+s1yh4QSA== X-Received: by 2002:a1c:c506:: with SMTP id v6mr16406444wmf.160.1569855655190; Mon, 30 Sep 2019 08:00:55 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 30 Sep 2019 16:00:42 +0100 Message-Id: <20190930150044.5734-9-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190930150044.5734-1-liuwe@microsoft.com> References: <20190930150044.5734-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next v2 8/9] x86: be more verbose when running on a hypervisor X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Andrew Cooper , Michael Kelley , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Wei Liu --- xen/arch/x86/guest/hypervisor.c | 5 +++++ xen/arch/x86/setup.c | 6 +++++- xen/include/asm-x86/guest/hypervisor.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/guest/hypervisor.c b/xen/arch/x86/guest/hyperviso= r.c index 30453b6a7a..8161b26c5a 100644 --- a/xen/arch/x86/guest/hypervisor.c +++ b/xen/arch/x86/guest/hypervisor.c @@ -43,6 +43,11 @@ bool hypervisor_probe(void) return !!hops; } =20 +const char *hypervisor_name(void) +{ + return hops->name; +} + void hypervisor_setup(void) { if ( hops && hops->setup ) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 0ee11b15a6..cf5a7b8e1e 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -689,6 +689,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) int i, j, e820_warn =3D 0, bytes =3D 0; bool acpi_boot_table_init_done =3D false, relocated =3D false; int ret; + bool running_on_hypervisor; struct ns16550_defaults ns16550 =3D { .data_bits =3D 8, .parity =3D 'n', @@ -763,7 +764,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) * allocing any xenheap structures wanted in lower memory. */ kexec_early_calculations(); =20 - hypervisor_probe(); + running_on_hypervisor =3D hypervisor_probe(); =20 parse_video_info(); =20 @@ -789,6 +790,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) =20 printk("Xen image load base address: %#lx\n", xen_phys_start); =20 + if ( running_on_hypervisor ) + printk("Running on %s\n", hypervisor_name()); + #ifdef CONFIG_VIDEO printk("Video information:\n"); =20 diff --git a/xen/include/asm-x86/guest/hypervisor.h b/xen/include/asm-x86/g= uest/hypervisor.h index 38344e2e89..a7d75bf9cf 100644 --- a/xen/include/asm-x86/guest/hypervisor.h +++ b/xen/include/asm-x86/guest/hypervisor.h @@ -36,6 +36,7 @@ bool hypervisor_probe(void); void hypervisor_setup(void); void hypervisor_ap_setup(void); void hypervisor_resume(void); +const char *hypervisor_name(void); =20 #else =20 @@ -45,6 +46,7 @@ static inline bool hypervisor_probe(void) { return false;= } static inline void hypervisor_setup(void) {} static inline void hypervisor_ap_setup(void) {} static inline void hypervisor_resume(void) {} +static inline char *hypervisor_name(void) { return NULL; } =20 #endif /* CONFIG_GUEST */ =20 --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel