Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5712377ybi; Tue, 28 May 2019 18:26:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+Gq+E7w8RFhqarpKM3zI/UnZzzYZWkdoH3tfsxFiYI9jJSF+JDcAnC7EhFxOG7EyLxMqL X-Received: by 2002:a17:90a:ac0d:: with SMTP id o13mr9071220pjq.139.1559093207148; Tue, 28 May 2019 18:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559093207; cv=none; d=google.com; s=arc-20160816; b=Zbyvt80IZ9TOfpJmmBbXtfIdj4rphCUsTguT/5pBm+DOfiFpuScn5ZX78UlnDYy5S1 UlT3xqiutoeL0PgR4mxaf1NWNO5RLDPcIzW5jSZ4WqNE5+4a54fgIKHnBYKacjYMZmUW d/AsteprHFbo1P3QxN4H/4LxQdxNacxROUakNN9i7Hv/+n5glYu0n6zgG+EofGOdZnGj Ey7nnH+au1WCCB19TFMntpDFDe9DbUs7B2vVdeDPh/fCKyocJnYYj/Rgf0uCBlvcW1bT 8dcQF/W7gW+A0hQcLus07vFHjMCRcQblAgw/ByMzP6g3av5AovDlplJxGJ9c22EF89BJ OnXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=UiPLvWA/ifZmBgOu5RY7iG79Uns1KHbXQ9v+2ITYDvE=; b=N4HS/4QkuA98XJvy2zleHXPCJZhJkXxQnj707lqXIJdCK8psACYE7EgjtsZKvtyJHm CHAJszG9tM3OXoCoa7QtYpCeVgy6t10KilOldcLtjWQ3m0HFRIRLLluznV4G4MmGkPpu dUiJW2zsmHHudLKdNIKBUzcQ4ahprJ5yPeBLHQPPlJcDulw7umKa+j8UyYEKhQw7zZ04 UPkhL0RQGLIh/0XCAcmGgCnk7w7fVOVCCR/Dg145dXZjq5V0tmxLUzUPp1leiFaxz6vZ 4vigOls7Tv55h5k0OeZ0CKLTWaadP69+YDCA4WOQHaQ8hMV4dlhNPLm1YhwVai3lhggU 9qhg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si25256465pla.122.2019.05.28.18.26.32; Tue, 28 May 2019 18:26:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbfE2BYS (ORCPT + 99 others); Tue, 28 May 2019 21:24:18 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35530 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbfE2BYS (ORCPT ); Tue, 28 May 2019 21:24:18 -0400 Received: by mail-wm1-f66.google.com with SMTP id w9so378219wmi.0 for ; Tue, 28 May 2019 18:24:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UiPLvWA/ifZmBgOu5RY7iG79Uns1KHbXQ9v+2ITYDvE=; b=GEQ23c7YfN3I0Y/KoU+KhFDqjOPLVnUuwHfJueiHEeGQ09gF2GpiX7F//yDnQYmFBO Bi4SBIwAxhI9vry9ARNbdj1+aqORebqqxnJJRYvJTaorR4vAvbSKnzxYwnuWJvHvB6pQ IQchkMyYjTcdO+KVkK0FxTkT9sO81V7rcCNwDmal0oGb6UpmVvT8+q+Z7DZIT5AwBzfg YuuwMarD2Tj0TyjU9AY3hLfTzEdogEDVEMMpjDeRXPEhZXCiLUwysDR5f33RIGzIoLcJ cGAFiEhLjcdU2onaj7fx1Fw+yUrzOQkRyuI16HHKccGXuB+rw3dGaANMEkuyXkvOKhIb iSlg== X-Gm-Message-State: APjAAAWFlOpq7F7dVpylvkdnnyCTHX3etCvBoJKiRUM6mnQa0kidFIYC 1Gw7PrcpvSTgkCks2WXqZqnYBQ== X-Received: by 2002:a1c:23c4:: with SMTP id j187mr4908475wmj.176.1559093055974; Tue, 28 May 2019 18:24:15 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id f2sm7111992wrq.48.2019.05.28.18.24.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 18:24:15 -0700 (PDT) Subject: Re: [PATCH v2 1/3] KVM: x86: add support for user wait instructions To: Tao Xu , rkrcmar@redhat.com, corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, sean.j.christopherson@intel.com Cc: x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, jingqi.liu@intel.com References: <20190524075637.29496-1-tao3.xu@intel.com> <20190524075637.29496-2-tao3.xu@intel.com> From: Paolo Bonzini Message-ID: <419f62f3-69a8-7ec0-5eeb-20bed69925f2@redhat.com> Date: Wed, 29 May 2019 03:24:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190524075637.29496-2-tao3.xu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/19 09:56, Tao Xu wrote: > +7.19 KVM_CAP_ENABLE_USR_WAIT_PAUSE > + > +Architectures: x86 > +Parameters: args[0] whether feature should be enabled or not > + > +With this capability enabled, a VM can use UMONITOR, UMWAIT and TPAUSE > +instructions. If the instruction causes a delay, the amount of > +time delayed is called here the physical delay. The physical delay is > +first computed by determining the virtual delay (the time to delay > +relative to the VM’s timestamp counter). Otherwise, UMONITOR, UMWAIT > +and TPAUSE cause an invalid-opcode exception(#UD). > + There is no need to make it a capability. You can just check the guest CPUID and see if it includes X86_FEATURE_WAITPKG. Paolo