v4 changes:
- Stop using ssize_t, use long instead
- Return -MSGSIZE for message bigger than 2GB
- Fixup size handling
- Rename protocol with message_type to avoid the
confusion with the IP protocol flag
- Replaced V4V_DOMID_ANY value with DOMID_INVALID
- Replaced v4v_pfn_t with xen_pfn_t
- Add padding to struct v4v_info
- Fixup hypercall documentation
- Move V4V_ROUNDUP to v4v.c
- Remove v4v_utils.h (we could potentially add it later).
v3 changes:
- Switch to event channel
- Allocated a unbound event channel
per domain.
- Add a new v4v call to share the
event channel port.
- Public headers with actual type definition
- Align all the v4v type to 64 bits
- Modify v4v MAGIC numbers because we won''t
but backward compatible anymore
- Merge insert and insertv
- Merge send and sendv
- Turn all the lock prerequisite from comment
to ASSERT()
- Make use or write_atomic instead of volatile pointers
- Merge v4v_memcpy_to_guest_ring and
v4v_memcpy_to_guest_ring_from_guest
- Introduce copy_from_guest_maybe that can take
a void * and a handle as src address.
- Replace 6 arguments hypercalls with 5 arguments hypercalls.
v2 changes:
- Cleanup plugin header
- Include basic access control
- Use guest_handle_for_field
Jan Beulich (1):
xen: Introduce guest_handle_for_field
Jean Guyader (3):
xen: virq, remove VIRQ_XC_RESERVED
xen: events, exposes evtchn_alloc_unbound_domain
xen: Add V4V implementation
xen/arch/x86/hvm/hvm.c | 9 +-
xen/arch/x86/x86_32/entry.S | 2 +
xen/arch/x86/x86_64/compat/entry.S | 2 +
xen/arch/x86/x86_64/entry.S | 2 +
xen/common/Makefile | 1 +
xen/common/domain.c | 13 +-
xen/common/event_channel.c | 39 +-
xen/common/v4v.c | 1907 ++++++++++++++++++++++++++++++++++++
xen/include/asm-x86/guest_access.h | 3 +
xen/include/public/v4v.h | 305 ++++++
xen/include/public/xen.h | 3 +-
xen/include/xen/event.h | 3 +
xen/include/xen/sched.h | 4 +
xen/include/xen/v4v.h | 133 +++
14 files changed, 2408 insertions(+), 18 deletions(-)
create mode 100644 xen/common/v4v.c
create mode 100644 xen/include/public/v4v.h
create mode 100644 xen/include/xen/v4v.h
--
1.7.9.5
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
This helper turns a field of a GUEST_HANDLE in a GUEST_HANDLE. Signed-off-by: Jean Guyader <jean.guyader@citrix.com> --- xen/include/asm-x86/guest_access.h | 3 +++ 1 file changed, 3 insertions(+) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
VIRQ_XC_RESERVED was reserved for V4V but we have switched to event channels so this place holder is no longer required. Signed-off-by: Jean Guyader <jean.guyader@citrix.com> --- xen/include/public/xen.h | 1 - 1 file changed, 1 deletion(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Jean Guyader
2012-Sep-13 18:09 UTC
[PATCH 3/4] xen: events, exposes evtchn_alloc_unbound_domain
Exposes evtchn_alloc_unbound_domain to the rest of Xen so we can create allocated unbound evtchn within Xen. Signed-off-by: Jean Guyader <jean.guyader@citrix.com> --- xen/common/event_channel.c | 39 +++++++++++++++++++++++++++------------ xen/include/xen/event.h | 3 +++ 2 files changed, 30 insertions(+), 12 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Setup of v4v domains a domain gets created and cleanup when a domain die. Wire up the v4v hypercall. Include v4v internal and public headers. Signed-off-by: Jean Guyader <jean.guyader@citrix.com> --- xen/arch/x86/hvm/hvm.c | 9 +- xen/arch/x86/x86_32/entry.S | 2 + xen/arch/x86/x86_64/compat/entry.S | 2 + xen/arch/x86/x86_64/entry.S | 2 + xen/common/Makefile | 1 + xen/common/domain.c | 13 +- xen/common/v4v.c | 1907 ++++++++++++++++++++++++++++++++++++ xen/include/public/v4v.h | 305 ++++++ xen/include/public/xen.h | 2 +- xen/include/xen/sched.h | 4 + xen/include/xen/v4v.h | 133 +++ 11 files changed, 2375 insertions(+), 5 deletions(-) create mode 100644 xen/common/v4v.c create mode 100644 xen/include/public/v4v.h create mode 100644 xen/include/xen/v4v.h _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
On 13 September 2012 19:09, Jean Guyader <jean.guyader@citrix.com> wrote:> > This helper turns a field of a GUEST_HANDLE in > a GUEST_HANDLE. > > Signed-off-by: Jean Guyader <jean.guyader@citrix.com>This patch is from Jan, sorry about that. Signed-off-by: Jan Beulich <JBeulich@suse.com> Jean
>>> On 13.09.12 at 20:09, Jean Guyader <jean.guyader@citrix.com> wrote: >+typedef struct v4v_iov >+{ >+ uint64_t iov_base; >+ uint32_t iov_len; >+} v4v_iov_t;Lost padding here?>+struct v4v_ring >+{ >+ uint64_t magic; >+ v4v_ring_id_t id; >+ uint32_t len; >+ uint32_t rx_ptr; >+ uint32_t tx_ptr; >+ uint8_t reserved[32]; >+ uint8_t ring[0]; >+};Zero-sized arrays are not standard C (not even C11 iirc), this is purely a GNU extension. This appears again elsewhere in this file.>+typedef struct v4v_ring_data_ent >+{ >+ v4v_addr_t ring; >+ uint16_t flags; >+ uint16_t pad; >+ uint32_t space_required; >+ uint32_t max_message_size; >+} v4v_ring_data_ent_t;For me, this sums up to 20 bytes.>+typedef struct v4v_ring_data >+{ >+ uint64_t magic; >+ uint32_t nent; >+ uint32_t pad; >+ uint64_t reserved[4]; >+ v4v_ring_data_ent_t data[0]; >+} v4v_ring_data_t;Consequently, sizeof(v4v_ring_data_t) will differ for 32- and 64-bit x86 guests. I can''t tell whether that would matter though (due to the intended, but again wrongly done, trailing variable size array).>+ * V4VOP_register_ringThis conflicts with ...>+ * >+ * Registers a ring with Xen, if a ring with the same v4v_ring_id exists, >+ * this ring takes its place, registration will not change tx_ptr >+ * unless it is invalid >+ * >+ * do_v4v_op(V4VOP_unregister_ring,... this.>+ * v4v_ring, XEN_GUEST_HANDLE(xen_pfn_t),Missing indirection here? I doubt you want a structure passed by value... (Again reoccurs further down.)>+ * V4VOP_unregister_ringAgain conflicting with ...>+ * >+ * Unregister a ring. >+ * >+ * do_v4v_op(V4VOP_send, v4v_ring, NULL, 0, 0)... this.>+ * do_v4v_op(V4VOP_send, >+ * v4v_send_addr_t addr, >+ * void* buf,XEN_GUEST_HANDLE(void) or, given this is a send, probably rather XEN_GUEST_HANDLE(const_void). But then again this would conflict with the real do_v4v_op() declaration. Jan