Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757163AbbLAWck (ORCPT ); Tue, 1 Dec 2015 17:32:40 -0500 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]:37363 "EHLO smtp-outbound-2.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756440AbbLAWcj (ORCPT ); Tue, 1 Dec 2015 17:32:39 -0500 Date: Tue, 1 Dec 2015 14:32:38 -0800 From: Xavier Deguillard To: Sinclair Yeh Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Alok Kataria , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 1/6] x86: Add VMWare Host Communication Macros Message-ID: <20151201223238.GM24642@xdeguillard-ws.eng.vmware.com> References: <1449008047-8252-1-git-send-email-syeh@vmware.com> <1449008332-9394-1-git-send-email-syeh@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449008332-9394-1-git-send-email-syeh@vmware.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1995 Lines: 54 Hey Sinclair, On Tue, Dec 01, 2015 at 02:18:47PM -0800, Sinclair Yeh wrote: > +/** > + * 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"? > + * @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? > + > +#define VMW_PORT_HB_OUT(in1, in2, port_num, magic, \ > + eax, ebx, ecx, edx, si, di, bp) \ > +({ \ > + __asm__ __volatile__ ("movq %13, %%rbp;" \ Same here. > + > +#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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/