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

Re: [Xen-devel] [PATCH RFC 07/31] xen/x86: Export host featureset via SYSCTL



>>> On 16.12.15 at 22:24, <andrew.cooper3@xxxxxxxxxx> wrote:
> @@ -190,6 +191,56 @@ long arch_do_sysctl(
>          }
>          break;
>  
> +    case XEN_SYSCTL_get_featureset:
> +    {
> +        uint32_t *featureset;

const

> +        unsigned int nr;
> +
> +        /* Request for maximum number of features? */
> +        if ( guest_handle_is_null(sysctl->u.featureset.features) )
> +        {
> +            sysctl->u.featureset.nr_features = XEN_NR_FEATURESET_ENTRIES;
> +            if ( __copy_to_guest(u_sysctl, sysctl, 1) )

__copy_field_to_guest()?

> +                ret = -EFAULT;
> +            break;
> +        }
> +
> +        /* Clip the number of entries. */
> +        nr = min_t(unsigned int, sysctl->u.featureset.nr_features,
> +                   XEN_NR_FEATURESET_ENTRIES);

Let's try to avoid min_t() wherever possible.

> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -764,6 +764,24 @@ struct xen_sysctl_tmem_op {
>  typedef struct xen_sysctl_tmem_op xen_sysctl_tmem_op_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tmem_op_t);
>  
> +/*
> + * XEN_SYSCTL_get_featureset (x86 specific)

Depending on your further intention this and/or ...

> + *
> + * Return information about the maximum sets of features which can be offered
> + * to different types of guests.  This is all strictly information as found 
> in
> + * `cpuid` feature leaves with no synthetic alterations.
> + */
> +struct xen_sysctl_featureset {
> +#define XEN_SYSCTL_featureset_host      0

... this need to carry "CPU" in their names.

Jan


_______________________________________________
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®.