|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 11/13] x86/altp2m: define and implement alternate p2m HVMOP types.
On 01/07/15 19:09, Ed White wrote:
> Signed-off-by: Ed White <edmund.h.white@xxxxxxxxx>
I am still very much unconvinced by the argument against having a single
HVMOP_altp2m and a set of subops. do_domctl() and do_sysctl() are
examples of a subop style hypercall with different XSM settings for
different subops.
Furthermore, factoring out a do_altp2m_op() handler would allow things
like the hvm_altp2m_supported() check to be made common. Factoring
further to having a named common header of a subop and a domid at the
head of every subop structure would allow all the domain rcu locking to
become common outside of the subop switch.
In addition,
> + case HVMOP_altp2m_vcpu_enable_notify:
> + {
> + struct domain *curr_d = current->domain;
> + struct vcpu *curr = current;
> + struct xen_hvm_altp2m_vcpu_enable_notify a;
> + p2m_type_t p2mt;
> +
> + if ( copy_from_guest(&a, arg, 1) )
> + return -EFAULT;
> +
> + if ( !is_hvm_domain(curr_d) || !hvm_altp2m_supported() ||
> + !curr_d->arch.altp2m_active ||
> + gfn_x(vcpu_altp2m(curr).veinfo_gfn) != INVALID_GFN)
Brackets around the boolean operation on this line, and a space inside
the final bracket.
> +/* Notify that a page of memory is to have specific access types */
> +#define HVMOP_altp2m_set_mem_access 30
> +struct xen_hvm_altp2m_set_mem_access {
> + /* Domain to be updated. */
> + domid_t domid;
> + /* view */
> + uint16_t view;
> + /* Memory type */
> + uint16_t hvmmem_access; /* xenmem_access_t */
Explicit padding bytes here please.
> + /* 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);
> +
> +/* Change a p2m entry to have a different gfn->mfn mapping */
> +#define HVMOP_altp2m_change_gfn 31
> +struct xen_hvm_altp2m_change_gfn {
> + /* Domain to be updated. */
> + domid_t domid;
> + /* view */
> + uint16_t view;
And here.
~Andrew
> + /* old gfn */
> + uint64_t old_gfn;
> + /* new gfn, INVALID_GFN (~0UL) means revert */
> + uint64_t new_gfn;
> +};
> +typedef struct xen_hvm_altp2m_change_gfn xen_hvm_altp2m_change_gfn_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_change_gfn_t);
> +
> #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
>
> /*
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |