From nobody Mon Feb 9 10:47:59 2026 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=1571673541; cv=none; d=zoho.com; s=zohoarc; b=kBbT0huoMNdMq03ULz6GO7yhJGTQmZ+NfkWJrCMTasObgXy2lDyEWHduHGPINf/tY/jIm8bugAPExwipZ8RvhB/k/w964VLskm+j69XhFokmwsO8Dtwy+kdDC1QYbPJGtlhtbiBV9p0lGizMKYdlnE7DyuMf/Rv9psjq2xXEpXw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571673541; 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; bh=W2dXIgM0aXa9Cm7Q6LpbIxGWKbDDrNHH09vrJHrF3P0=; b=fY8Or6KeJLRX5q9tjn++3vgQoj6ASu3TktgQpOX2dEVy3KOLv3kMpeojHRqbH2nxX+hQuh6IgAnmvz9i7U/xB5oeuaxgBKfiL61fySwCkF3boTgNv7X6MZYpc25Qoqxyxrq9E59x9X0DCpgMZM8GClO0kXp3GM4ckpbWh2X1rCQ= 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 1571673541954797.0075333717003; Mon, 21 Oct 2019 08:59:01 -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 1iMa4L-0008Oj-5x; Mon, 21 Oct 2019 15:58:05 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iMa4J-0008O2-Sr for xen-devel@lists.xenproject.org; Mon, 21 Oct 2019 15:58:03 +0000 Received: from mail-wm1-x344.google.com (unknown [2a00:1450:4864:20::344]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7c1217e6-f41b-11e9-beca-bc764e2007e4; Mon, 21 Oct 2019 15:57:29 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id q70so6756663wme.1 for ; Mon, 21 Oct 2019 08:57:29 -0700 (PDT) Received: from debian.mshome.net (54.163.200.146.dyn.plus.net. [146.200.163.54]) by smtp.gmail.com with ESMTPSA id x12sm5667410wru.93.2019.10.21.08.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 08:57:28 -0700 (PDT) X-Inumbo-ID: 7c1217e6-f41b-11e9-beca-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=f6in2kwAF9sUzg2Mb4eb4h7EVvG820SHOVnsWYNNk9o=; b=MUKAOFhlOV0lipkA3Qj18xiI6jhWf6fmWwWPwtnJAQzlhbmMRVzmaR0NXuyaM3yipW HOsi01QexFr6Q83AJHRNVrlChT1Fkk93sxOhWiXsmIL0f2ZKitcm/73nC0K+NLF7+k+p XNxgHpVNeerACM3motyD2xj5Ms89+puPCEb2bdG6WgiGKIzc5rFhdWxBa3PN+kEilxYA WzsXBSzxopWNanWlRO2dko8eQQTxn9xuGvBCMKwGk+5bsz+u6zQg0uZ+HTo6KuMzjuzm ktJtP/45Vu4dlEIb3prsn0fYjtMlgX+2cvUvn71CAnSls/Qm/rvTx2TZg0+qttjsc3T/ X6zA== 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=f6in2kwAF9sUzg2Mb4eb4h7EVvG820SHOVnsWYNNk9o=; b=JLlFyr3Dz2RFt6k38GPzWRohTurEEMUZ1l1msd8nblRlcKUL3/PJlL5q+TZvcOcYvD lGsm+agTAYdpJOmW5GWwf8mK7ND09dbnQipM58iLZdV7Yv0tfc7R091QQ9D3Rqssx8ZS H0VlUVWbi8Q4rp3d7ejytwlrz4QRL0O5eSvxhs1PpJ6GSQP8cER8iqePNmhhTna3JiWF N5GziDXe/xaz1ymzb1rFveiz2PHblHv4Sx1xPiEDYPsC3wDx1ASnPFhzAaRAzwumpD8T 9ugjtnyWvk2W3qIJvuroVl8QTNa9ieYF2+ENnni7mqxNX3Slsrc1d9w8s/6VMf/uEVjL 4Jxg== X-Gm-Message-State: APjAAAVkvrQYG+Sfrj7CHEhElg4Xab4+Nhst3KM/jr3A/WNRmG1GLivz Vr3FNhYo1eWdSqdcEfVi7S5QtbkWzHA= X-Google-Smtp-Source: APXvYqxHE3iK/0W6DtLJyb6xZXf4NNJOheJkAeLWWTme7Y7mktHsl4XmDpU67XhLM0PcvmGGFT/xtQ== X-Received: by 2002:a7b:c444:: with SMTP id l4mr19445804wmi.21.1571673448928; Mon, 21 Oct 2019 08:57:28 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 21 Oct 2019 16:57:17 +0100 Message-Id: <20191021155718.28653-9-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191021155718.28653-1-liuwe@microsoft.com> References: <20191021155718.28653-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next v3 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 Reviewed-by: Paul Durrant --- V3: Address Roger's comment, add ASSERTs --- xen/arch/x86/guest/hypervisor.c | 6 ++++++ xen/arch/x86/setup.c | 6 +++++- xen/include/asm-x86/guest/hypervisor.h | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/guest/hypervisor.c b/xen/arch/x86/guest/hyperviso= r.c index 33bf1a769d..a666ad9526 100644 --- a/xen/arch/x86/guest/hypervisor.c +++ b/xen/arch/x86/guest/hypervisor.c @@ -46,6 +46,12 @@ bool hypervisor_probe(void) return false; } =20 +const char *hypervisor_name(void) +{ + ASSERT(hops); + 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..b583722f5d 100644 --- a/xen/include/asm-x86/guest/hypervisor.h +++ b/xen/include/asm-x86/guest/hypervisor.h @@ -36,15 +36,18 @@ 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 +#include #include =20 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) { ASSERT_UNREACHABLE(); return N= ULL; } =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