Thread (9 messages) 9 messages, 5 authors, 2015-12-02

Re: [PATCH 1/6] x86: Add VMWare Host Communication Macros

flat view

From: Xavier Deguillard <hidden>
Date: 2015-12-01 22:32:38

Possibly related (same subject, not in this thread)

Hey Sinclair,

On Tue, Dec 01, 2015 at 02:18:47PM -0800, Sinclair Yeh wrote:
quoted hunk ↗ jump to hunk
+/**
+ * Hypervisor-specific bi-directional communication channel.  Should never
+ * execute on bare metal hardware.  The caller must make sure to check for
+ * supported hypervisor before using these macros.
+ *
+ * Several of the parameters are both input and output and must be initialized.
+ *
+ * @in1: [IN] Message Len or Message Cmd (HB)
+ * @in2: [IN] Message Len (HB) or Message Cmd
Can you make in1 always be the "Message Cmd" and in2 always be the
"Message len"?
quoted hunk ↗ jump to hunk
+ * @port_num: [IN] port number + [channel id]
+ * @magic: [IN] hypervisor magic value
+ * @eax: [OUT] value of EAX register
+ * @ebx: [OUT] e.g. status from an HB message status command
+ * @ecx: [OUT] e.g. status from a non-HB message status command
+ * @edx: [OUT] e.g. channel id
+ * @si: [INOUT] set to 0 if not used
+ * @di: [INOUT] set to 0 if not used
+ * @bp: [INOUT] set to 0 if not used
+ */
+#define VMW_PORT(in1, in2, port_num, magic, eax, ebx, ecx, edx, si, di) \
+({                                                                      \
+	__asm__ __volatile__ ("inl %%dx" :                              \
Are those '\' aligned in the code?
quoted hunk ↗ jump to hunk
+
+#define VMW_PORT_HB_OUT(in1, in2, port_num, magic,      \
+			eax, ebx, ecx, edx, si, di, bp) \
+({                                                      \
+	__asm__ __volatile__ ("movq %13, %%rbp;"        \
Same here.
quoted hunk ↗ jump to hunk
+
+#define VMW_PORT_HB_IN(in1, in2, port_num, magic,            \
+		       eax, ebx, ecx, edx, si, di, bp)       \
+({                                                           \
+	__asm__ __volatile__ ("push %%rbp; movq %13, %%rbp;" \
Same.

Xavier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help