All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 09/16] x86: provide stubs, declarations and macros in hvm.h
Date: Thu, 13 Sep 2018 16:31:34 +0100	[thread overview]
Message-ID: <20180913153134.pw4cimbqknuznawv@zion.uk.xensource.com> (raw)
In-Reply-To: <5B92226A02000078001E6270@prv1-mh.provo.novell.com>

On Fri, Sep 07, 2018 at 01:02:02AM -0600, Jan Beulich wrote:
> >>> On 04.09.18 at 18:15, <wei.liu2@citrix.com> wrote:
> > @@ -675,6 +678,100 @@ static inline bool altp2m_vcpu_emulate_ve(struct vcpu *v)
> >          d_->arch.hvm.pi_ops.vcpu_block(v_);                     \
> >  })
> >  
> > +#else  /* CONFIG_HVM */
> > +
> > +#define hvm_enabled false
> > +
> > +/*
> > + * List of inline functions above, of which only declarations are
> > + * needed because DCE will kick in.
> > + */
> 
> With this comment I think ...
> 
> > +int hvm_guest_x86_mode(struct vcpu *v);
> > +unsigned long hvm_get_shadow_gs_base(struct vcpu *v);
> > +void hvm_set_info_guest(struct vcpu *v);
> > +void hvm_cpuid_policy_changed(struct vcpu *v);
> > +void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset, uint64_t at_tsc);
> > +
> > +static inline bool hvm_is_singlestep_supported(void)
> 
> ... there should be another comment above here to sort of
> terminate that first comment's effect.

OK.

> 
> > +static inline int hvm_cpu_up(void)
> > +{
> > +    return 0;
> > +}
> > +
> > +static inline void hvm_cpu_down(void) {}
> > +
> > +static inline void hvm_flush_guest_tlbs(void) {}
> > +
> > +static inline void hvm_update_host_cr3(struct vcpu *v)
> > +{
> > +    ASSERT_UNREACHABLE();
> > +}
> 
> Here and below - why ASSERT_UNREACHABLE() instead of the declaration
> only approach above? (If it really needs to be this way, I think it would
> help if the patch description said why.)
> 

Shadow code has some code paths which are HVM only but haven't been
cleaned up. I will add a comment to that effect.


> > +static inline int hvm_event_pending(struct vcpu *v)
> > +{
> > +    return 0;
> > +}
> 
> Would there be an issue if you made this return bool and take pointer
> to const right away, even without touching the "full" function? Perhaps
> the const part would apply to other stubs here as well.

I wanted to keep make them have the same prototype. I'm happy to make
the changes here.

> 
> > +#define is_viridian_domain(d) ({(void)(d); false;})
> > +#define has_viridian_time_ref_count(d) ({(void)(d); false;})
> > +#define hvm_long_mode_active(v) ({(void)(v); false;})
> > +#define hvm_pae_enabled(v) ({(void)(v); false;})
> > +#define hvm_get_guest_time(v) ({(void)(v); 0;})
> 
> Perhaps simply without the need to use a gcc extension
> 
> #define is_viridian_domain(d) ((void)(d), false)

Done (for this and others).

Wei.

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

  reply	other threads:[~2018-09-13 15:31 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 16:15 [PATCH v3 00/16] Make CONFIG_HVM work Wei Liu
2018-09-04 16:15 ` [PATCH v3 01/16] x86: change name of parameter for various invlpg functions Wei Liu
2018-09-06 11:12   ` George Dunlap
2018-09-13 16:11   ` George Dunlap
2018-09-04 16:15 ` [PATCH v3 02/16] x86: introduce and use a set of internal emulation flags Wei Liu
2018-09-06 13:27   ` Jan Beulich
2018-09-06 13:47     ` Wei Liu
2018-09-04 16:15 ` [PATCH v3 03/16] x86: XENMEM_resource_ioreq_server is HVM only Wei Liu
2018-09-04 16:24   ` Paul Durrant
2018-09-04 16:42   ` Wei Liu
2018-09-06 13:29     ` Jan Beulich
2018-09-04 16:15 ` [PATCH v3 04/16] x86: monitor.o is currently " Wei Liu
2018-09-04 16:35   ` Razvan Cojocaru
2018-09-04 16:15 ` [PATCH v3 05/16] x86: PIT emulation is common to both PV and HVM Wei Liu
2018-09-06 14:26   ` Jan Beulich
2018-09-04 16:15 ` [PATCH v3 06/16] libxl: don't set PoD target for PV guests Wei Liu
2018-09-07 13:44   ` Ian Jackson
2018-09-04 16:15 ` [PATCH v3 07/16] x86/p2m/pod: make it build with !CONFIG_HVM Wei Liu
2018-09-04 17:08   ` Razvan Cojocaru
2018-09-04 17:10     ` Razvan Cojocaru
2018-09-04 17:24   ` Julien Grall
2018-09-06 10:57     ` Wei Liu
2018-09-06 15:30       ` George Dunlap
2018-09-06 15:05   ` Jan Beulich
2018-09-06 16:06     ` George Dunlap
2018-09-04 16:15 ` [PATCH v3 08/16] x86/hvm: rearrange content of hvm.h Wei Liu
2018-09-07  6:52   ` Jan Beulich
2018-09-04 16:15 ` [PATCH v3 09/16] x86: provide stubs, declarations and macros in hvm.h Wei Liu
2018-09-07  7:02   ` Jan Beulich
2018-09-13 15:31     ` Wei Liu [this message]
2018-09-04 16:15 ` [PATCH v3 10/16] x86/mm: put nested p2m code under CONFIG_HVM Wei Liu
2018-09-06 16:20   ` George Dunlap
2018-09-13 15:46     ` Wei Liu
2018-09-13 16:01       ` George Dunlap
2018-09-07  7:06   ` Jan Beulich
2018-09-13 15:07     ` Wei Liu
2018-09-14  8:01       ` Jan Beulich
2018-09-04 16:15 ` [PATCH v3 11/16] x86/mm: put HVM only " Wei Liu
2018-09-04 17:10   ` Razvan Cojocaru
2018-09-07  7:12   ` Jan Beulich
2018-09-07 21:27   ` Tamas K Lengyel
2018-09-13 15:43     ` Wei Liu
2018-09-13 16:31       ` Tamas K Lengyel
2018-09-04 16:15 ` [PATCH v3 12/16] x86/mm: put paging_update_nestedmode " Wei Liu
2018-09-13 16:39   ` George Dunlap
2018-09-04 16:15 ` [PATCH v3 13/16] xen: connect guest creation with CONFIG_{HVM, PV} Wei Liu
2018-09-04 16:15 ` [PATCH v3 14/16] x86: expose CONFIG_HVM Wei Liu
2018-09-07  7:15   ` Jan Beulich
2018-09-13 16:01     ` Wei Liu
2018-09-14  8:07       ` Jan Beulich
2018-09-14 10:36         ` Wei Liu
2018-09-04 16:15 ` [PATCH v3 15/16] x86/pvshim: disable HVM for PV shim Wei Liu
2018-09-07  7:18   ` Jan Beulich
2018-09-07  7:46     ` Wei Liu
2018-09-07  7:48       ` Wei Liu
2018-09-04 16:15 ` [PATCH v3 16/16] xen: decouple HVM and IOMMU capabilities Wei Liu
2018-09-13 15:52   ` Ian Jackson

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=20180913153134.pw4cimbqknuznawv@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@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.