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

Re: [Xen-devel] [PATCH v3] x86/altp2m: Add a subop for obtaining the mem access of a page



>>> On 25.07.18 at 13:16, <apop@xxxxxxxxxxxxxxx> wrote:
> --- a/xen/include/public/hvm/hvm_op.h
> +++ b/xen/include/public/hvm/hvm_op.h
> @@ -234,7 +234,7 @@ struct xen_hvm_altp2m_view {
>  typedef struct xen_hvm_altp2m_view xen_hvm_altp2m_view_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_view_t);
>  
> -struct xen_hvm_altp2m_set_mem_access {
> +struct xen_hvm_altp2m_mem_access {
>      /* view */
>      uint16_t view;
>      /* Memory type */
> @@ -243,8 +243,8 @@ struct xen_hvm_altp2m_set_mem_access {
>      /* gfn */
>      uint64_t gfn;
>  };
> -typedef struct xen_hvm_altp2m_set_mem_access xen_hvm_altp2m_set_mem_access_t;
> -DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_set_mem_access_t);
> +typedef struct xen_hvm_altp2m_mem_access xen_hvm_altp2m_mem_access_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_mem_access_t);
>  
>  struct xen_hvm_altp2m_set_mem_access_multi {
>      /* view */
> @@ -296,6 +296,8 @@ struct xen_hvm_altp2m_op {
>  #define HVMOP_altp2m_change_gfn           8
>  /* Set access for an array of pages */
>  #define HVMOP_altp2m_set_mem_access_multi 9
> +/* Get the access of a page of memory from a certain view */
> +#define HVMOP_altp2m_get_mem_access       10
>      domid_t domain;
>      uint16_t pad1;
>      uint32_t pad2;
> @@ -303,7 +305,7 @@ struct xen_hvm_altp2m_op {
>          struct xen_hvm_altp2m_domain_state         domain_state;
>          struct xen_hvm_altp2m_vcpu_enable_notify   enable_notify;
>          struct xen_hvm_altp2m_view                 view;
> -        struct xen_hvm_altp2m_set_mem_access       set_mem_access;
> +        struct xen_hvm_altp2m_mem_access           mem_access;
>          struct xen_hvm_altp2m_change_gfn           change_gfn;
>          struct xen_hvm_altp2m_set_mem_access_multi set_mem_access_multi;
>          uint8_t pad[64];

This being exposed to guests, the interface has to be considered
stable imo, in which case you can't rename things like this. You'd
need __XEN_INTERFACE_VERSION__ dependent logic (just like is the
case further up in the file).

Also, to you, George, and whoever else advocates for this, another
remark regarding the guest accessibility here (at the risk of getting
flamed once again): The less capable (afaict)
XENMEM_access_op_{g,s}et_access (previously
HVMOP_{g,s}et_mem_access) are tools accessible only. I find such
an inconsistency rather odd.

Jan



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

 


Rackspace

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