Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp345pxb; Mon, 2 Nov 2020 12:11:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwg4xWx9j1Pu5qVoApPUTE1JVw+YW1uewVZWksFQGvB96von+6wSmVXDa080LJz2pfNwsiI X-Received: by 2002:a17:906:578b:: with SMTP id k11mr7938968ejq.330.1604347919197; Mon, 02 Nov 2020 12:11:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604347919; cv=none; d=google.com; s=arc-20160816; b=ddWcLq9SbyMSp0rhpDoAmJ24oqz8iQgWe7paKgA3KUn+4KVnz00pnpHkceL5Kxl0m2 Mm1H91I1Yoi+zxa8MCAIrzeZB0K4NaiT5L/PiyDvMSTBgos9WWWRUIaI2hKehee61MY3 Lyne3l3zj1eD2r/V3sk3s3f2QfE5Fb11jSXsLJLU6JZJIPJ4K40YUNmCakHTkhO853gS mbfigYR2xiLKeL52TxxR3SE1U6o90WKAnm16dJ9S3WZjqmSC6m+B9EPs0icaj5TYsMPt gUCwNKAy8/TCVbj6Q3zbyBfT+NriRNIodWPThHBBlfrJMujTL2Pn6cJhdeRZpDetPFhH fB3A== 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=pEtTcgUKTKbHgYo0xzYKJk/yC26ESWFUYhTNHgw5pCQ=; b=Lm2RNsYZaAEfW2zIpE9lSXwjkAm40aAkX2YoIhkrh8md073ecBeVRAlrMu9VuBQxx4 4ApYoj8oHR9icz8IRZJllCQRhOxFEV4FLFYryFU/4OWG64FnF/4pNOOHSD4ru1+Z13+u //RHBBRs8Z1uCQYOVkuUWm/Im7M397hPaMKVSeRGVFrX84PoNcheXtXFAzVOhUZIzrOW FP42UZW6D4pv5UnjlpWe+kENxmXHmHPkBXfS6V0WTwjNPT1Ye3LujyCadySax1vulSGj yJaZRw211vxN7IL/thfCcF7NRB224wO/ImSGq7gbOtHOtg0ZHhnAKxc2lEmN5r0l3J55 stZg== 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 ca27si11292642edb.244.2020.11.02.12.11.36; Mon, 02 Nov 2020 12:11:59 -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 S1726109AbgKBUI2 (ORCPT + 99 others); Mon, 2 Nov 2020 15:08:28 -0500 Received: from gate.crashing.org ([63.228.1.57]:51576 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbgKBUHj (ORCPT ); Mon, 2 Nov 2020 15:07:39 -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 0A2K1FvU009280; Mon, 2 Nov 2020 14:01:15 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 0A2K1DjO009277; Mon, 2 Nov 2020 14:01:13 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 2 Nov 2020 14:01:13 -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: <20201102200113.GY2672@gate.crashing.org> References: <20201019061803.13298-1-shuo.a.liu@intel.com> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201102183430.GG15392@zn.tnic> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 02, 2020 at 07:34:30PM +0100, Borislav Petkov wrote: > On Mon, Nov 02, 2020 at 12:10:00PM -0600, Segher Boessenkool wrote: > > (It does not allow *all* memory and *all* constants, btw... And the > > condition for registers is not really "general register", whatever that > > means... > > I think that means general purpose registers. I.e., it won't use, say > FPU, XMM or whatever special regs. > > What does the asm() parsing code in gcc do for "g"? There should be > some logic which constraints what register is valid... It just asks the general_operand function, which (for registers) accepts the hard registers that are accessible. This does include the float and vector etc. registers, normally. But you usually have a pseudo-register there (which is always allowed here), unless you used some register asm variable. And pseudos usually are allocated a simple integer register during register allocation, in an asm that is. > > I hope no one ever told you our documentation does not have white > > lies!) > > I have convinced myself of this a couple of times already so I either go > ask our gcc friends or go look straight at gcc source. It is useful to > know folks which hack on it so that I can ask them stupid questions and > not go off into the weeds, trying to figure out what the documentation > says. > > But hey, if that gets the documentation improved, that's a win-win > situation right there. Yes :-) > Might even make people copying from bad examples > to go look at the docs first... Optimism is cool :-) Segher