From patchwork Thu Nov 21 18:50:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11256841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 869E56C1 for ; Thu, 21 Nov 2019 18:52:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 627992067D for ; Thu, 21 Nov 2019 18:52:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rl9AWJu6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 627992067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iXrYA-0007Kz-Vy; Thu, 21 Nov 2019 18:51:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iXrY9-0007K7-HP for xen-devel@lists.xenproject.org; Thu, 21 Nov 2019 18:51:29 +0000 X-Inumbo-ID: dbd84f74-0c8f-11ea-b678-bc764e2007e4 Received: from mail-wr1-x443.google.com (unknown [2a00:1450:4864:20::443]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id dbd84f74-0c8f-11ea-b678-bc764e2007e4; Thu, 21 Nov 2019 18:51:00 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id i12so5746535wro.5 for ; Thu, 21 Nov 2019 10:51:00 -0800 (PST) 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=lUPue3nJI1BlCj5R+fUwF507OE2ynKQH95Wp7cLyvA0=; b=rl9AWJu69RO7Wpww06KuYN/PM5btN7iuOVIeGur8pTn3ThpiikXCLuSUeESpH7pOD+ YboI4mcouxi6ygjjjew0iRLEscAlj4ySJtLiBoVd4mpNvULxDNf0J8cvUnO3u9cT17AS 6REDDnrqhkixYFlvbDoAL9DSZn2j3C86McitktZJpeDVaGToYgMLp30CrJm0IUa0/yWB 22hNGwzP1RyfmK2MuCDxEVH7qyj8gM0bTkLcImbjMUw1uZSKURIQDyBjjuu65DHwmoht EQP6Gboli/g/CE13o9Ryz4fju+G6x9cY+NPbXMQb1GB7fJn2ZvBGhRxRsodxYrD9gGn7 woCQ== 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=lUPue3nJI1BlCj5R+fUwF507OE2ynKQH95Wp7cLyvA0=; b=OrfWP5BQl5xAj0+vO6ORe220U+RUX98bs3ft0bl/qxiCgJf1M0iXoyzO6+QPfPm+Q4 sp2xRTo3X8SXsTbDDBS+15Kp6CSuB0Z42Ng7nBGL7rPyHv/e1olHqM+52H32TGu612v0 h0ghmFdAw9yUUwlU7hvdJTj4a9mdoB4psTA4L9RX/gpt4yDOrh/90ogepUMnYFsukDNR Zd6Y9N6g326AROTntT+kKt9LFStWSr+f6tT6vtmYxzSWdxELDCiISpCguimLALhFTk26 dJ1Ypy24KIiCW8JT8RxOyHAKpMIBIvnfOQ8q2tMHUb+a1v+TrWUd0Cldkjdv1B44ToBm M+TQ== X-Gm-Message-State: APjAAAVkms+ZiOCdv6Buw5IQpIyM/vQPpz7O80fkeINhY/U2B3v2Op4d Fw+yowT3kQPcFOFMKMwJvBfGcueZZv6WLA== X-Google-Smtp-Source: APXvYqzBZnQji8OBG2EMtpgCl/T/nh84H5uA+Y6VkGieSstfs7XbTrcHbi3MUg3tYmPmmk4Fb/BFNQ== X-Received: by 2002:adf:ed4b:: with SMTP id u11mr12050615wro.215.1574362259105; Thu, 21 Nov 2019 10:50:59 -0800 (PST) Received: from debian.mshome.net (74.162.147.147.dyn.plus.net. [147.147.162.74]) by smtp.gmail.com with ESMTPSA id f24sm535776wmb.37.2019.11.21.10.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 10:50:58 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Thu, 21 Nov 2019 18:50:48 +0000 Message-Id: <20191121185049.16666-8-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191121185049.16666-1-liuwe@microsoft.com> References: <20191121185049.16666-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 7/8] 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_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Also replace xen_guest with running_on_hypervisor boolean. Signed-off-by: Wei Liu --- Changes in v4: 1. Access ->name directly. 2. Drop Roger's review tag. --- xen/arch/x86/setup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 19606d909b..123436b35a 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 = 0, bytes = 0; bool acpi_boot_table_init_done = false, relocated = false; int ret; + bool running_on_hypervisor; struct ns16550_defaults ns16550 = { .data_bits = 8, .parity = '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(); - hypervisor_probe(); + running_on_hypervisor = !!hypervisor_probe(); parse_video_info(); @@ -788,6 +789,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) printk("Command line: %s\n", cmdline); printk("Xen image load base address: %#lx\n", xen_phys_start); + if ( running_on_hypervisor ) + printk("Running on %s\n", hypervisor_probe()->name); #ifdef CONFIG_VIDEO printk("Video information:\n"); @@ -1569,7 +1572,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) max_cpus = nr_cpu_ids; } - if ( xen_guest ) + if ( running_on_hypervisor ) hypervisor_setup(); /* Low mappings were only needed for some BIOS table parsing. */