From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PATCH] x86/cpu/vmware: use the full form of inl in VMWARE_PORT Date: Mon, 7 Oct 2019 17:44:14 -0700 Message-ID: <201910071743.1C48038A@keescook> References: <20191007192129.104336-1-samitolvanen@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20191007192129.104336-1-samitolvanen@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Sami Tolvanen Cc: Thomas Hellstrom , pv-drivers@vmware.com, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, clang-built-linux@googlegroups.com, Ingo Molnar , Borislav Petkov , hpa@zytor.com, Thomas Gleixner List-Id: virtualization@lists.linuxfoundation.org On Mon, Oct 07, 2019 at 12:21:29PM -0700, Sami Tolvanen wrote: > LLVM's assembler doesn't accept the short form inl (%%dx) instruction, > but instead insists on the output register to be explicitly specified: > > :1:7: error: invalid operand for instruction > inl (%dx) > ^ > LLVM ERROR: Error parsing inline asm > > Use the full form of the instruction to fix the build. > > Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook -Kees > --- > arch/x86/kernel/cpu/vmware.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c > index 9735139cfdf8..46d732696c1c 100644 > --- a/arch/x86/kernel/cpu/vmware.c > +++ b/arch/x86/kernel/cpu/vmware.c > @@ -49,7 +49,7 @@ > #define VMWARE_CMD_VCPU_RESERVED 31 > > #define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ > - __asm__("inl (%%dx)" : \ > + __asm__("inl (%%dx), %%eax" : \ > "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ > "a"(VMWARE_HYPERVISOR_MAGIC), \ > "c"(VMWARE_CMD_##cmd), \ > -- > 2.23.0.581.g78d2f28ef7-goog > -- Kees Cook