Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp730292pxb; Tue, 3 Nov 2020 10:56:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJ5tgqTuAe+w20naBkmdy51OoCgcgTxuuC51sXWXqMSto+DarBCpDBSnIMrexr2iXzxtPP X-Received: by 2002:a17:906:9457:: with SMTP id z23mr20656446ejx.296.1604429778018; Tue, 03 Nov 2020 10:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604429778; cv=none; d=google.com; s=arc-20160816; b=pwlFaqJo2ZpJjTKYnd0ACVVhQ3bVHeX85K3kaeRAYE7bo8kg/gKSdgHnCkMFgSVNhs NkoP9vwV3vbG0+mCJAjH+Yc5brTfjzk2uYginyJ+H4n+cezX7oL9blz5wHuyCv5MCfR9 T409iwfPwg2BltJSmEBVqY+PyI/i/or+Eg8sFkmu5zpAV+mCTjiPwtnxmvjzQKnTWr66 HresXNOJTU9IDA8Y24bV0D39SKVuFtADIrJuXHdNn9rWn6Sk5l/fagFtZFpWiKEjWe1M gerxWrMVN/Ut6QQM5qctWD+84pZqsLHFFxbn4aqu5Az0jhkCXEGFwvtO1F45wE28zXFC kLJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=94LXC3yVLBTWmfHT7MahG/Fd4ym4OTXsrTMNMs2J1GU=; b=vE6eEK3Z6HV8mZF3wrBQRLKE04f2S44ycygrICcvE6w2/0JKWqM09XiwR4zGSciDsP gfbnnyCBod7N1FCJGwyT4o3Cf5gNrB8jHULGMchFIdaU1gf/2zfpOs5Z1nTVZrqSFoR8 vte3bBvnibylw1urD2AUG7aRcJnOHkXHXOUN539dzodL2s78ASH8+uTX1aNABzWQrOgI 5715WFy3TwHpeI2HGOHREIo7a6Pjp3x4lbbSXWJcMvlr9ByV8e1j2CfSm1YY1PnZptyN WbjFFuAX00HxoTNt7JJ7rh7nBzEF/UxAShobNDItCybozwSR9PBSl7+PJmcvVT39L+qb NHHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n10si12661522ejg.353.2020.11.03.10.55.54; Tue, 03 Nov 2020 10:56:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729344AbgKCSy2 (ORCPT + 99 others); Tue, 3 Nov 2020 13:54:28 -0500 Received: from gate.crashing.org ([63.228.1.57]:48218 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbgKCSy2 (ORCPT ); Tue, 3 Nov 2020 13:54:28 -0500 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 0A3IlenB030027; Tue, 3 Nov 2020 12:47:40 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 0A3Ildp9030025; Tue, 3 Nov 2020 12:47:39 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 3 Nov 2020 12:47:39 -0600 From: Segher Boessenkool To: Borislav Petkov Cc: shuo.a.liu@intel.com, linux-kernel@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Sean Christopherson , Yu Wang , Reinette Chatre , Yakui Zhao , Dave Hansen , Dan Williams , Fengwei Yin , Zhi Wang , Zhenyu Wang , Arvind Sankar , Peter Zijlstra , Nick Desaulniers Subject: Re: [PATCH v5 04/17] x86/acrn: Introduce hypercall interfaces Message-ID: <20201103184739.GL2672@gate.crashing.org> References: <20201019061803.13298-5-shuo.a.liu@intel.com> <20201102145657.GD15392@zn.tnic> <20201102160901.GU2672@gate.crashing.org> <20201102171950.GF15392@zn.tnic> <20201102181000.GX2672@gate.crashing.org> <20201102183430.GG15392@zn.tnic> <20201102200113.GY2672@gate.crashing.org> <20201102225439.GI15392@zn.tnic> <20201102231809.GC2672@gate.crashing.org> <20201103164435.GB4111@zn.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103164435.GB4111@zn.tnic> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 03, 2020 at 05:44:35PM +0100, Borislav Petkov wrote: > On Mon, Nov 02, 2020 at 05:18:09PM -0600, Segher Boessenkool wrote: > > That is invalid actually: local register asm as input to an inline asm > > should use *that* register! > > > > This is all correct until LRA ("reload"). Not that "movl %xmm0,$eax" > > works, but at least it screams its head off, as it should. > > Screams how? $ cat xmm1.s movl %xmm0,%eax $ x86_64-linux-as xmm1.s -o xmm1.o xmm1.s: Assembler messages: xmm1.s:1: Error: unsupported instruction `mov' (This isn't an existing insn IIUC.) > It builds fine without a single peep with -Wall here. > > Btw, that's a MOVD - not a MOVL. MOVD can do xmm -> gpr moves. And > singlestepping it with gdb does, well, something, which is clearly > wrong but nothing complains: > > => 0x555555555131 : movd %xmm0,%eax > > and %xmm0 has: > > (gdb) p $xmm0 > $2 = {v4_float = {0.99000001, 0, 0, 0}, v2_double = {5.2627153433055495e-315, 0}, v16_int8 = {-92, 112, 125, 63, > ^^^^^^^^^^ > > so that is correct. The original code had movl. And movl is needed for GPRs. > and that same value goes into %r8d: > > mov %eax,%r8d Which violates what is required by register asm :-( > > Yes. But GCC doing what you should have said instead of doing what you > > said, is not good. > > Oh well, should I open a low prio bug, would that help? Sure, thanks! > I probably should test with the latest gcc first, though... Yeah... FWIW, I tested with x86_64-linux-gcc (GCC) 11.0.0 20201015 (experimental) so I doubt current ToT will have it fixed, but who knows. Thanks, Segher