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

Re: [Xen-devel] [PATCH 1/2] xen, libxc: Introduced XEN_DOMCTL_emulate_each_rep



Hi Razvan,

On 15/09/15 10:19, Razvan Cojocaru wrote:
> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index 9e0fef5..214a22a 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -1180,6 +1180,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>              copyback = 1;
>          break;
>  
> +    case XEN_DOMCTL_emulate_each_rep:
> +        d->arch.hvm_domain.emulate_each_rep = !!op->u.emulate_each_rep.op;

The common code should never access directly to an arch field.

Actually this will break on ARM because you introduced the field only
for x86.

Please move this new domctl in arch_do_domctl.

> +        ret = 0;
> +        break;
> +
>      default:
>          ret = arch_do_domctl(op, d, u_domctl);
>          break;
> diff --git a/xen/include/asm-x86/hvm/domain.h 
> b/xen/include/asm-x86/hvm/domain.h
> index 992d5d1..b8fbe5e 100644
> --- a/xen/include/asm-x86/hvm/domain.h
> +++ b/xen/include/asm-x86/hvm/domain.h
> @@ -136,6 +136,7 @@ struct hvm_domain {
>      bool_t                 mem_sharing_enabled;
>      bool_t                 qemu_mapcache_invalidate;
>      bool_t                 is_s3_suspended;
> +    bool_t                 emulate_each_rep;
>  
>      /*
>       * TSC value that VCPUs use to calculate their tsc_offset value.
> diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> index 794d4d5..efc42a8 100644
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -1063,6 +1063,12 @@ struct xen_domctl_psr_cat_op {
>  typedef struct xen_domctl_psr_cat_op xen_domctl_psr_cat_op_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cat_op_t);
>  
> +struct xen_domctl_emulate_each_rep {
> +    int32_t op;
> +};
> +typedef struct xen_domctl_emulate_each_rep xen_domctl_emulate_each_rep_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_emulate_each_rep_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -1140,6 +1146,7 @@ struct xen_domctl {
>  #define XEN_DOMCTL_monitor_op                    77
>  #define XEN_DOMCTL_psr_cat_op                    78
>  #define XEN_DOMCTL_soft_reset                    79
> +#define XEN_DOMCTL_emulate_each_rep              80
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -1202,6 +1209,7 @@ struct xen_domctl {
>          struct xen_domctl_psr_cmt_op        psr_cmt_op;
>          struct xen_domctl_monitor_op        monitor_op;
>          struct xen_domctl_psr_cat_op        psr_cat_op;
> +        struct xen_domctl_emulate_each_rep  emulate_each_rep;

IHMO this should be exposed only for x86 as we don't have a such
instruction on ARM.

>          uint8_t                             pad[128];
>      } u;
>  };
> 
        
Regards,

-- 
Julien Grall

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