[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 7/8] x86: be more verbose when running on a hypervisor



> -----Original Message-----
> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of Wei
> Liu
> Sent: 21 November 2019 19:51
> To: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Cc: Wei Liu <liuwe@xxxxxxxxxxxxx>; Wei Liu <wl@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Michael Kelley <mikelley@xxxxxxxxxxxxx>; Jan
> Beulich <jbeulich@xxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Subject: [Xen-devel] [PATCH v4 7/8] x86: be more verbose when running on a
> hypervisor
> 
> Also replace xen_guest with running_on_hypervisor boolean.
> 
> Signed-off-by: Wei Liu <liuwe@xxxxxxxxxxxxx>
> ---
> 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;

Why not stash hops here? Then you can...

>      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);

...avoid calling hypervisor_probe() again here.

  Paul

> 
>  #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. */
> --
> 2.20.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.