From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 265D6C00A89 for ; Mon, 2 Nov 2020 18:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 971342225E for ; Mon, 2 Nov 2020 18:34:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="Y5tPVUz3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbgKBSen (ORCPT ); Mon, 2 Nov 2020 13:34:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbgKBSel (ORCPT ); Mon, 2 Nov 2020 13:34:41 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28FDBC0617A6 for ; Mon, 2 Nov 2020 10:34:41 -0800 (PST) Received: from zn.tnic (p200300ec2f086a00fa513bf50e741c79.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:6a00:fa51:3bf5:e74:1c79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 091CF1EC0249; Mon, 2 Nov 2020 19:34:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1604342079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=6gyIuFjrxWqj7ZZQ8QrJgmiKLdEe27h5YwOXM77j2B0=; b=Y5tPVUz30nIF1a/NLWGSYuzdeEtjRmjfIS2zr2mOfn/90LLk8rG/+Ei3EmriT1pnznuP+E VFRKV8Q/7a0W8zWjD9XKIzjLdPr187+Z7Ok0wRqv7i9bMJ8bl8C+FqbXT6rjs6kNOsOHCa nm3xYADoRBvHTFpZQXKmQZ/gh6WTpPM= Date: Mon, 2 Nov 2020 19:34:30 +0100 From: Borislav Petkov To: Segher Boessenkool 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: <20201102183430.GG15392@zn.tnic> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201102181000.GX2672@gate.crashing.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 02, 2020 at 12:10:00PM -0600, Segher Boessenkool wrote: > movl works for moving anything g->r. Right. > 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!) So I've heard from other architectures. Every arch has its own problems. :-) > 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). Unfortunately. > (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... > 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. Might even make people copying from bad examples to go look at the docs first... :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette