Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3493793pxx; Mon, 2 Nov 2020 10:18:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy26hvBWwP+7xoD+Cenfryk1QJ3DhbGBL6ZuhppteCYmvTTYlfxMnQWQ6kIRPF2k0BZhnAm X-Received: by 2002:a17:906:7805:: with SMTP id u5mr7207358ejm.379.1604341092475; Mon, 02 Nov 2020 10:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604341092; cv=none; d=google.com; s=arc-20160816; b=U6CQSUsfzvRw4Iqm5vQFzx/08ilO7CxhbIXvF8EqAPtkakNRXr+Jjcab0ixseldO4n 2KZY31enS2/Pc5/puiK40/dIPgTjVqCy9cXEKFfjR9GMmjW1gfR32IqEytsG3kW2anbm i0jiHtqiSIF1B0JgLzOrxfteBvS1ihXTktYQM5K+IGC8N3Gxbm9HMJ8IlAefZIMVoUOG K9N1yYlHnaWN+gS7t5DTR3SfRCvaySxgF719Juo7AWdnoPIghVGO18s9Paw8T6lLhqvk K99WMPNs5CCYxjg2ULO16zS8E9ua2W/8yNGKWsAyJd56TaAOC2t9G1vGf2B1j9im1tDs dpWA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Me4IrVxb6zsjUX81qKBqgv/otQck78mWT1qJl12UmAE=; b=pbmYyXHJub8lLKxkJJj44XaKdpgjp/GMDYaRM/MWJh6Dmsp0xTmJOCDFjwvjey11bT A9W2369zASLadan4fxTWM6m4R/RAztyEH0vzDLyneycVpB1Rfa7f8oeGDB899VWnbbB3 9HZqMqz6IInjD/RRWEbDNjHzgiPyiNc6Eop5Oks5NQSagqmNQI+27T+DkUnfd2Y7rj9o 0/XVnE6C5ghshyjVreIzhG7tubNvve6fOhwJpmhXVgE+jgUvtnpAOIOrjmIsCAjM7zie +9Z1SI+9WYkQaR4Pms47rcN3FZTATkcW1B3mbA1Y/jWx5PMVkoLTNOAsg/aQVmf4inqa EK7g== 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 dg22si7846479edb.414.2020.11.02.10.17.49; Mon, 02 Nov 2020 10:18:12 -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 S1725882AbgKBSQ0 (ORCPT + 99 others); Mon, 2 Nov 2020 13:16:26 -0500 Received: from gate.crashing.org ([63.228.1.57]:41861 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgKBSQZ (ORCPT ); Mon, 2 Nov 2020 13:16:25 -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 0A2IA2wc000440; Mon, 2 Nov 2020 12:10:03 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 0A2IA0Bq000437; Mon, 2 Nov 2020 12:10:00 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 2 Nov 2020 12:10:00 -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: <20201102181000.GX2672@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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201102171950.GF15392@zn.tnic> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Mon, Nov 02, 2020 at 06:19:50PM +0100, Borislav Petkov wrote: > On Mon, Nov 02, 2020 at 10:09:01AM -0600, Segher Boessenkool wrote: > > I think that will work for x86_64. But it won't matter much, most of > > the time you give an immediate number. > > Yeah, my question is more along the lines of "is this constraint somehow > special, i.e., 'ir' (and not 'm') or can it be whatever, i.e., 'g'"? movl works for moving anything g->r. This is not true for most insns, and not for most architectures at all (usually loading from memory has a separate mnemonic; moving an immediate number often as well (and it does not usually allow *every* immediate anyway, not even all numbers!) > > It is a tiny bit neater of course (if anyone still remembers what "g" > > is, you cannot use it much these days). > > Oh I always remember what it is because it is right there in the docs: > > "6.47.3.1 Simple Constraints > > ... > > ā€˜gā€™ Any register, memory or immediate integer operand is allowed, > except for registers that are not general registers." Most people do not read the documentation, they just copy from (bad) examples (and arguably, any example you do not really understand is a bad example). (It does not allow *all* memory and *all* constants, btw... And the condition for registers is not really "general register", whatever that means... I hope no one ever told you our documentation does not have white lies!) Segher