All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wl@xen.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Wei Liu" <liuwe@microsoft.com>, "Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Michael Kelley" <mikelley@microsoft.com>,
	"Xen Development List" <xen-devel@lists.xenproject.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v4 6/8] x86: switch xen guest implementation to use hypervisor framework
Date: Sat, 30 Nov 2019 11:49:04 +0000	[thread overview]
Message-ID: <20191130114904.uh5gonv3v72acsl5@debian> (raw)
In-Reply-To: <adb846a4-1adc-b02d-6924-0ffb23da2832@suse.com>

On Fri, Nov 29, 2019 at 02:50:18PM +0100, Jan Beulich wrote:
> On 21.11.2019 19:50, Wei Liu wrote:
> > +void __init hypervisor_setup(void)
> > +{
> > +    if ( hops && hops->setup )
> > +        hops->setup();
> > +}
> > +
> > +void hypervisor_ap_setup(void)
> > +{
> > +    if ( hops && hops->ap_setup )
> > +        hops->ap_setup();
> > +}
> > +
> > +void hypervisor_resume(void)
> > +{
> > +    if ( hops && hops->resume )
> > +        hops->resume();
> > +}
> 
> I assume these don't get executed frequently enough for
> alternatives indirect call patching to matter? Down the road, if
> any more frequently executed hooks should appear, we will want
> to switch to that model though. This has the added benefit of
> there then being only one runtime instance of struct
> hypervisor_ops; all per-hypervisor ones would become
> __initconstrel.
> 

All the routines listed here are run very infrequently.

I agree that when more frequently executed hooks appear we will want to
look into alternatives.

> > @@ -326,6 +310,31 @@ void hypervisor_resume(void)
> >          pv_console_init();
> >  }
> >  
> > +static const struct hypervisor_ops xg_ops = {
> 
> With this new xg_ prefix, ...
> 
> > +    .name = "Xen",
> > +    .setup = xen_setup,
> > +    .ap_setup = xen_ap_setup,
> > +    .resume = xen_resume,
> 
> ... I'd like to suggest to use it for these ones too (if they
> need to have a prefix in the first place, which I doubt, but
> which I know others view differently).
> 

Since they are only visible to this file I think not having a prefix
should be fine. 

> > +const struct hypervisor_ops * __init xen_probe(void)
> 
> For this one the call is a little more difficult, but for
> consistency I think xg_ would be slightly better here as well.

No problem. Changed it to xg_probe.

> 
> Nit: Strictly speaking there's a stray blank after *. We
> normally have ones only ahead of *, but not after.

Fixed.

Wei.

> 
> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-11-30 11:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 18:50 [Xen-devel] [PATCH v4 0/8] Port Xen to Hyper-V Wei Liu
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 1/8] x86: introduce CONFIG_GUEST and move code Wei Liu
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 2/8] x86: add missing headers in hypercall.h Wei Liu
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 3/8] x86: drop hypervisor_cpuid_base Wei Liu
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 4/8] x86: introduce hypervisor framework Wei Liu
2019-11-22 10:31   ` Durrant, Paul
2019-11-29 13:38     ` Jan Beulich
2019-11-29 13:43   ` Jan Beulich
2019-11-29 18:08   ` Andrew Cooper
2019-11-30 11:48     ` Wei Liu
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 5/8] x86: rename hypervisor_{alloc, free}_unused_page Wei Liu
2019-11-22 10:57   ` Durrant, Paul
2019-11-29 13:39     ` Jan Beulich
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 6/8] x86: switch xen guest implementation to use hypervisor framework Wei Liu
2019-11-22 11:02   ` Durrant, Paul
2019-11-22 11:51     ` Wei Liu
2019-11-29 13:50   ` Jan Beulich
2019-11-30 11:49     ` Wei Liu [this message]
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 7/8] x86: be more verbose when running on a hypervisor Wei Liu
2019-11-22 11:04   ` Durrant, Paul
2019-11-29 14:31   ` Jan Beulich
2019-11-29 14:34     ` Jan Beulich
2019-11-29 18:15   ` Andrew Cooper
2019-11-30 11:49     ` Wei Liu
2019-11-21 18:50 ` [Xen-devel] [PATCH v4 8/8] x86: introduce CONFIG_HYPERV and detection code Wei Liu
2019-11-22 11:11   ` Durrant, Paul
2019-11-29 14:35     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191130114904.uh5gonv3v72acsl5@debian \
    --to=wl@xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=liuwe@microsoft.com \
    --cc=mikelley@microsoft.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.