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

Re: [Xen-devel] [PATCH v4 07/16] xen/mem_event: Abstract architecture specific sanity checks






On Fri, Sep 5, 2014 at 11:28 AM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>> On 05.09.14 at 10:58, <tklengyel@xxxxxxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/p2m.h
> +++ b/xen/include/asm-x86/p2m.h
> @@ -611,6 +611,20 @@ long p2m_set_mem_access(struct domain *d, unsigned long start_pfn, uint32_t nr,
>  int p2m_get_mem_access(struct domain *d, unsigned long pfn,
>                         xenmem_access_t *access);
>
> +/* Sanity check for mem_event hardware support */
> +static inline bool_t p2m_mem_event_sanity_check(struct domain *d)
> +{
> +    /* Only HAP is supported */
> +    if ( !hap_enabled(d) )
> +        return 0;
> +
> +    /* Currently only EPT is supported */
> +    if ( !cpu_has_vmx )
> +        return 0;
> +
> +    return 1;
> +}

For simple inline functions like this, may I suggest have them a use
simple return statement:

    return hap_enabled(d) && cpu_has_vmx;


Surely, my aim here really was just to minimize look&feel changes compared to existing code. The current approach might be a tiny bit faster on domains without hap, but not like it really would count for much, so I'm OK with having the compact one-liner version.
 
This is the more that the first comment is redundant with the
second, i.e. the single statement would then need to be
accompanied only by the second of them.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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