diff mbox series

[v5,7/8] x86: be more verbose when running on a hypervisor

Message ID 20191130115737.15752-8-liuwe@microsoft.com (mailing list archive)
State New, archived
Headers show
Series Port Xen to Hyper-V | expand

Commit Message

Wei Liu Nov. 30, 2019, 11:57 a.m. UTC
Also replace reference to xen_guest.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
---
Changes in v5:
1. Cache and use hypervisor name instead
---
 xen/arch/x86/setup.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jan Beulich Dec. 3, 2019, 2:54 p.m. UTC | #1
On 30.11.2019 12:57, Wei Liu wrote:
> Also replace reference to xen_guest.
> 
> Signed-off-by: Wei Liu <liuwe@microsoft.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

However, ...

> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -700,6 +700,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          .max_grant_frames = -1,
>          .max_maptrack_frames = -1,
>      };
> +    const char *hypervisor_name;
>  
>      /* Critical region without IDT or TSS.  Any fault is deadly! */
>  
> @@ -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();
> +    hypervisor_name = hypervisor_probe();

... you no longer calling this function multiple time, why does
patch 4 still put in a respective guard?

Jan
Wei Liu Dec. 3, 2019, 4:37 p.m. UTC | #2
On Tue, Dec 03, 2019 at 03:54:35PM +0100, Jan Beulich wrote:
> On 30.11.2019 12:57, Wei Liu wrote:
> > Also replace reference to xen_guest.
> > 
> > Signed-off-by: Wei Liu <liuwe@microsoft.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> 
> However, ...
> 
> > --- a/xen/arch/x86/setup.c
> > +++ b/xen/arch/x86/setup.c
> > @@ -700,6 +700,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> >          .max_grant_frames = -1,
> >          .max_maptrack_frames = -1,
> >      };
> > +    const char *hypervisor_name;
> >  
> >      /* Critical region without IDT or TSS.  Any fault is deadly! */
> >  
> > @@ -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();
> > +    hypervisor_name = hypervisor_probe();
> 
> ... you no longer calling this function multiple time, why does
> patch 4 still put in a respective guard?

Remnant from previous iterations.

I can submit a follow-up patch to drop that -- do really want to
invalidate all the reviews and acks I got so far.

Wei.

> 
> Jan
Jan Beulich Dec. 3, 2019, 4:58 p.m. UTC | #3
On 03.12.2019 17:37, Wei Liu wrote:
> On Tue, Dec 03, 2019 at 03:54:35PM +0100, Jan Beulich wrote:
>> On 30.11.2019 12:57, Wei Liu wrote:
>>> Also replace reference to xen_guest.
>>>
>>> Signed-off-by: Wei Liu <liuwe@microsoft.com>
>>
>> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> Thanks.
> 
>>
>> However, ...
>>
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -700,6 +700,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>>>          .max_grant_frames = -1,
>>>          .max_maptrack_frames = -1,
>>>      };
>>> +    const char *hypervisor_name;
>>>  
>>>      /* Critical region without IDT or TSS.  Any fault is deadly! */
>>>  
>>> @@ -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();
>>> +    hypervisor_name = hypervisor_probe();
>>
>> ... you no longer calling this function multiple time, why does
>> patch 4 still put in a respective guard?
> 
> Remnant from previous iterations.
> 
> I can submit a follow-up patch to drop that -- do really want to
> invalidate all the reviews and acks I got so far.

According to my records patch 4 had no acks except mine, which you
could keep with this change (in fact I was thinking of making it
dependent upon the dropping of this leftover). Subsequent patches
may only need re-basing, which doesn't imply dropping of any acks.

Jan
Wei Liu Dec. 3, 2019, 5:09 p.m. UTC | #4
On Tue, Dec 03, 2019 at 05:58:28PM +0100, Jan Beulich wrote:
> On 03.12.2019 17:37, Wei Liu wrote:
> > On Tue, Dec 03, 2019 at 03:54:35PM +0100, Jan Beulich wrote:
> >> On 30.11.2019 12:57, Wei Liu wrote:
> >>> Also replace reference to xen_guest.
> >>>
> >>> Signed-off-by: Wei Liu <liuwe@microsoft.com>
> >>
> >> Acked-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Thanks.
> > 
> >>
> >> However, ...
> >>
> >>> --- a/xen/arch/x86/setup.c
> >>> +++ b/xen/arch/x86/setup.c
> >>> @@ -700,6 +700,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> >>>          .max_grant_frames = -1,
> >>>          .max_maptrack_frames = -1,
> >>>      };
> >>> +    const char *hypervisor_name;
> >>>  
> >>>      /* Critical region without IDT or TSS.  Any fault is deadly! */
> >>>  
> >>> @@ -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();
> >>> +    hypervisor_name = hypervisor_probe();
> >>
> >> ... you no longer calling this function multiple time, why does
> >> patch 4 still put in a respective guard?
> > 
> > Remnant from previous iterations.
> > 
> > I can submit a follow-up patch to drop that -- do really want to
> > invalidate all the reviews and acks I got so far.
> 
> According to my records patch 4 had no acks except mine, which you
> could keep with this change (in fact I was thinking of making it
> dependent upon the dropping of this leftover). Subsequent patches
> may only need re-basing, which doesn't imply dropping of any acks.

OK. In that case, I will drop it locally. If that causes any substantial
changes, I will post another version; otherwise I will just keep all the
tags and push this series soon-ish.

How does that sound to you?

Wei.

> 
> Jan
Wei Liu Dec. 3, 2019, 5:22 p.m. UTC | #5
On Tue, Dec 03, 2019 at 05:09:43PM +0000, Wei Liu wrote:
> On Tue, Dec 03, 2019 at 05:58:28PM +0100, Jan Beulich wrote:
> > On 03.12.2019 17:37, Wei Liu wrote:
> > > On Tue, Dec 03, 2019 at 03:54:35PM +0100, Jan Beulich wrote:
> > >> On 30.11.2019 12:57, Wei Liu wrote:
> > >>> Also replace reference to xen_guest.
> > >>>
> > >>> Signed-off-by: Wei Liu <liuwe@microsoft.com>
> > >>
> > >> Acked-by: Jan Beulich <jbeulich@suse.com>
> > > 
> > > Thanks.
> > > 
> > >>
> > >> However, ...
> > >>
> > >>> --- a/xen/arch/x86/setup.c
> > >>> +++ b/xen/arch/x86/setup.c
> > >>> @@ -700,6 +700,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> > >>>          .max_grant_frames = -1,
> > >>>          .max_maptrack_frames = -1,
> > >>>      };
> > >>> +    const char *hypervisor_name;
> > >>>  
> > >>>      /* Critical region without IDT or TSS.  Any fault is deadly! */
> > >>>  
> > >>> @@ -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();
> > >>> +    hypervisor_name = hypervisor_probe();
> > >>
> > >> ... you no longer calling this function multiple time, why does
> > >> patch 4 still put in a respective guard?
> > > 
> > > Remnant from previous iterations.
> > > 
> > > I can submit a follow-up patch to drop that -- do really want to
> > > invalidate all the reviews and acks I got so far.
> > 
> > According to my records patch 4 had no acks except mine, which you
> > could keep with this change (in fact I was thinking of making it
> > dependent upon the dropping of this leftover). Subsequent patches
> > may only need re-basing, which doesn't imply dropping of any acks.
> 
> OK. In that case, I will drop it locally. If that causes any substantial
> changes, I will post another version; otherwise I will just keep all the
> tags and push this series soon-ish.
> 
> How does that sound to you?

And it turns out it is indeed trivial. Dropping that hunk in patch 4
only requires a minor fixup to patch 6.

Wei.

> 
> Wei.
> 
> > 
> > Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a6b354c29f..fc049eaac8 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -700,6 +700,7 @@  void __init noreturn __start_xen(unsigned long mbi_p)
         .max_grant_frames = -1,
         .max_maptrack_frames = -1,
     };
+    const char *hypervisor_name;
 
     /* Critical region without IDT or TSS.  Any fault is deadly! */
 
@@ -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();
+    hypervisor_name = 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 ( hypervisor_name )
+        printk("Running on %s\n", hypervisor_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 ( hypervisor_name )
         hypervisor_setup();
 
     /* Low mappings were only needed for some BIOS table parsing. */