Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp71324pxk; Wed, 30 Sep 2020 18:15:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxURDRsX1dfkQlGlha5P6LW/ezYO8QnLg/06MH/vYSICaywXacUw5EQkgPSyQeBYGuzjX5A X-Received: by 2002:a05:6402:176e:: with SMTP id da14mr5735684edb.349.1601514919667; Wed, 30 Sep 2020 18:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601514919; cv=none; d=google.com; s=arc-20160816; b=zA1yzUbBObL+qbyq+wXfeknKwyarDk+dk8llYUmouuCFZq8gxEp2xHjfCs6A8HTrwu MY8d3nQrX7UOWzjteTFjPuc01bcRuK/5xLQsowHYXVp23CtHqPl7BTseqZ5amgNxroLQ sdsNFY7bwsaHoq+UeIZBWDoApkgl3jz2xMZqaeX4q4h/6tTCRUi2kOKxxi4SjpgUWAPw OeZAlE5F/15I6SK3CnwlnBICwV3P7cJczbPnglURqbwSbqmmbffObqc8dSX+St91MtJR pXnuHMt+Izx+T0F5KIPKvfmzcXHbgZcpDu4B1xAB36umRcslPX0kbcle7hvW3O1pgz17 vr8A== 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=o8VWI3d7UNCOD+mReg/5HofWGf0umlnLcqj1W+sVTYc=; b=Jzx6gq3U+7r7CM5rfU1cGWbNgYxdHZKoZM++WJwqlFF0EBggQUHhc726wu7iBEGBRF xL4fPsK/lP0W6ISphNOV0rxOp4vUw4BV3sCly9lYYSdEv3DH6IYHsMGhUEqyxHGU6Zic lrfS0P9uAkn7NL207xAmTpbN2Va8FwglYKmnvGA5AL8J4Qarosj4ooPYmv9LZuRzStkZ Sh0E6NzjWKZomUxRdnoKLumeVJU6C1wMbdvrOdtxYilwHUWFp+y8fHVxO59OOnR+3M/K uy0/X9gw8EtwtXljhxYWTLMGSiyr36TTEcMIQA4bpq2pbQxveGfDQtVT3ec0GZPqWIRF 69ww== 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 h19si2308232ejb.619.2020.09.30.18.14.56; Wed, 30 Sep 2020 18:15:19 -0700 (PDT) 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 S1731758AbgJAARl (ORCPT + 99 others); Wed, 30 Sep 2020 20:17:41 -0400 Received: from gate.crashing.org ([63.228.1.57]:48309 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729980AbgJAARl (ORCPT ); Wed, 30 Sep 2020 20:17:41 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 0910BNYp011876; Wed, 30 Sep 2020 19:11:24 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 0910BNmv011875; Wed, 30 Sep 2020 19:11:23 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 30 Sep 2020 19:11:22 -0500 From: Segher Boessenkool To: Arvind Sankar Cc: Nick Desaulniers , Peter Zijlstra , Dave Hansen , Greg Kroah-Hartman , shuo.a.liu@intel.com, LKML , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sean Christopherson , Yu Wang , Reinette Chatre , Yakui Zhao , Dan Williams , Fengwei Yin , Zhi Wang , Zhenyu Wang Subject: Re: [PATCH v4 04/17] x86/acrn: Introduce hypercall interfaces Message-ID: <20201001001122.GF28786@gate.crashing.org> References: <20200922114311.38804-1-shuo.a.liu@intel.com> <20200922114311.38804-5-shuo.a.liu@intel.com> <20200927105152.GG88650@kroah.com> <6f9a2b83-6904-2290-6c4f-526672390beb@intel.com> <20200930111612.GZ2628@hirez.programming.kicks-ass.net> <20200930161036.GY28786@gate.crashing.org> <20200930171346.GC2628@hirez.programming.kicks-ass.net> <20200930232559.GC28786@gate.crashing.org> <20200930233815.GA3372783@rani.riverdale.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200930233815.GA3372783@rani.riverdale.lan> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 07:38:15PM -0400, Arvind Sankar wrote: > On Wed, Sep 30, 2020 at 06:25:59PM -0500, Segher Boessenkool wrote: > > On Wed, Sep 30, 2020 at 12:14:03PM -0700, Nick Desaulniers wrote: > > > Do we need register local storage here? > > > > Depends what you want. It looks like you do: > > > > > static inline long bar(unsigned long hcall_id) > > > { > > > long result; > > > asm volatile("movl %1, %%r8d\n\t" > > > "vmcall\n\t" > > > : "=a" (result) > > > : "ir" (hcall_id) > > > : ); > > > return result; > > > } > > > > "result" as output from the asm is in %rax, and the compiler will > > shuffle that to wherever it needs it as the function return value. That > > part will work fine. > > > > But how you are accessing %r8d is not correct, that needs to be a local > > register asm (or r8 be made a fixed reg, probably not what you want ;-) ) > > Doesn't it just need an "r8" clobber to allow using r8d? Yes, x86 asm is hard to read, what can I say :-) Sorry about that. Segher