Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1967749yba; Thu, 25 Apr 2019 08:33:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWPpvT5H88caegYz5l1kU8vW2TVzFkQ1kgKrIUjcFUv0fhwoVV3t49/gQeekN+hkvEOeje X-Received: by 2002:a63:ed4e:: with SMTP id m14mr38610527pgk.182.1556206386362; Thu, 25 Apr 2019 08:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556206386; cv=none; d=google.com; s=arc-20160816; b=nqvz+0kngW4A5IyjXiFLhwP4wR3InoA9Jsxy0SomQL1En/GhLc8DCVzv47Hk36KNJm rnj5ys69/klgM47mNGxoibGfiITm0DC++WCT4B9sRRu2nQom2JtncT/Ga4zV0Os4jekw sllWUg8KLD852OxLMIe1ZuGvhRCQYm3/9V9VB/8LsIq51PVtt3d32+3HWEadeCVAeXXm W3gO2/6vpQcIbnLeFqKWM3rixye1qTP+x6a3Z6bj3g/rDokoNqlAoyv2sEOt7Y4zerSO FZRwB0N2kPvsBwItVZ2tgALc/XovDq0710XPIKTYx+bvrMFwccTpmXq7RfxuPqPojSK6 y5UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=h4vJV92cjPhuBbrkXWH6sxAbEZLDW9YxPad+hPvCa+o=; b=tmtksqBCi6qyRHRe7J0ZTPPq95scjulMy7a0iPrOCuAB4D15yKUpnlO8ovjYTrQmNg Zk/q7kipV+Z8rVjx8p6jHMhVxt+trJPQSz5ikI6qpcaVJ3qLs8AuRngAven6/zd4VU48 bgjkN8fu6imBhBeXJ8Hux6lJygPoW/1YNKU1YNGESJ5sEnLjwg8jnY68oKp736jMErst A4CMPhDgdmo1gwS/KqesQrSblRfXK+Iv8ftlqxl0fPXv7Xms3MkF5lS4XCNADW/Oq0h2 G9Cf5jYutoLz0YXxJAAu9J06tE+2x4f/BKZOuH0CgVXf0AZRDbMzjTG1kgKZfX9OH178 gF8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RiSE9xoG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i40si23180477plb.177.2019.04.25.08.32.50; Thu, 25 Apr 2019 08:33:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RiSE9xoG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727697AbfDYLAe (ORCPT + 99 others); Thu, 25 Apr 2019 07:00:34 -0400 Received: from mail.skyhub.de ([5.9.137.197]:58734 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfDYLAe (ORCPT ); Thu, 25 Apr 2019 07:00:34 -0400 Received: from zn.tnic (p200300EC2F0E430060E979F7C497EAD3.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:4300:60e9:79f7:c497:ead3]) (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 28ECE1EC0104; Thu, 25 Apr 2019 13:00:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1556190032; 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=h4vJV92cjPhuBbrkXWH6sxAbEZLDW9YxPad+hPvCa+o=; b=RiSE9xoGBNEl7nXdHpiIa74sgTrhS8MxK1dMV6zuutHt4cl3yEo0kKv8CaNQiG7Y+8W6S9 Pvco5SCiWEkG2sscs+LbPezeuwyfxmtG8vMTcQCWdRktdbhmMp/Dz45S92wgAKiZ+jMCAg a+RZ6xLbrKK2H7pXt/kdjIlH9Wz+8gc= Date: Thu, 25 Apr 2019 13:00:25 +0200 From: Borislav Petkov To: "Zhao, Yakui" Cc: Ingo Molnar , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "tglx@linutronix.de" , "Chen, Jason CJ" Subject: Re: [RFC PATCH v5 4/4] x86/acrn: Add hypercall for ACRN guest Message-ID: <20190425110025.GA16164@zn.tnic> References: <1556067260-9128-1-git-send-email-yakui.zhao@intel.com> <1556067260-9128-5-git-send-email-yakui.zhao@intel.com> <20190425070712.GA57256@gmail.com> <6dd021a9-e2c0-ee84-55fd-3e6dfb4bd944@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6dd021a9-e2c0-ee84-55fd-3e6dfb4bd944@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 06:16:02PM +0800, Zhao, Yakui wrote: > The parameter register for the VMCALL is predefined in ACRN hypervisor. Now > the R8 is used to pass the hcall_id. > It seems that there is no special constraint for R8~R15. > So the explicit register variable is used so that the R8 can be passed. If you're going to use the constraint "D" for param1, you can just as well do "=a" (result) everywhere since you have the letter constraint for %rax instead of declaring it with "register". Also, you can completely get rid of those "register" declarations and let gcc have all the freedom to pass in hcall_id and the other parameters: unsigned long result; asm volatile("mov %[hcall_id], %%r8\n\t" "vmcall\n\t" : "=a" (result) : [hcall_id] "g" (hcall_id) : "r8"); return result; and %r8 will be in the clobber list so gcc will reload it if needed. gcc turns it into 0000000000001040
: 1040: 4c 8b 05 e1 2f 00 00 mov 0x2fe1(%rip),%r8 # 4028 1047: 0f 01 c1 vmcall 104a: c3 retq 104b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) here. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.