Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1044722pxb; Thu, 9 Sep 2021 18:55:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxS4jkfFn1opDzm3dgVraYPOzOtcVMxx7H9L8EWbGoONEKVcRT06Om7/cUKNEjUuNfnQs3 X-Received: by 2002:a17:906:308d:: with SMTP id 13mr6593233ejv.570.1631238955332; Thu, 09 Sep 2021 18:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631238955; cv=none; d=google.com; s=arc-20160816; b=BiC1u+desYrOxGYgkqQ5ntJFHhanYnA1/VaW9aOQlLLoRxzKUDrbahDGV2x2yXcVHd w5QyJbjmu1ew+Ttj0QJKo5heqMX3lSe4Xl1StDRsOIdNYamXTE8/Nj66fT4lUOvVn2O/ MBWim0ZCgtn0QjjkyQ2gsoTxNtal5a8lkxTPhqimnV1766uMIkwBi4/Wp2scaGC305oN MJPSo/ILzx9LhJGjolRLheYSq7wG+Rqg1faGX0VbzgzTDb0wbCobl8QcfqLne5UER1rW +2dAh+XHek6Sbz3baVjaNpmzVHPXFOWC26Ua/hmZ0dqEd5E00FC8I0t2puM0M4Rs9Ki4 D7Qw== 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=r8KY/BoePc7WMCowO5lI69oJvAgOB32zv72nJzf/qCQ=; b=S/Qp3PrryRpr/kqLxJylj6y/CZfnpOIg6TFO/D+HPkRnHOYgUk82ScGKpt/c49QQrW TcatbfN9pK7dwrXcYGWbZzXH0rFnrtvvDX/RD4DTGMGj3I7KPw8KxAUxkGYj1txbsjrs BZVhliqXiU5wHHjD1b6+u8fk46b3QRNn0pnwW0D4M30cmVDtTCYKW3IEzs5ksZEpvFwF aiOy5c/bW9xkpO3R59IRXfVYwuBZAmavJpxZXWFKmh2EHjC68WE3Iav+NlKvfKaEoi/2 bkOygp9iPfDoUds+/Y4Eesb1pNZmr9Ql2XtBw8PWOKV4IHMbL9etlMIw+Cf609XXwu3C xrRg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp5si4366006ejc.132.2021.09.09.18.55.31; Thu, 09 Sep 2021 18:55:55 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbhIJBzL (ORCPT + 99 others); Thu, 9 Sep 2021 21:55:11 -0400 Received: from mga07.intel.com ([134.134.136.100]:39045 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbhIJBzK (ORCPT ); Thu, 9 Sep 2021 21:55:10 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="284668191" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="284668191" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 18:54:00 -0700 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="548935759" Received: from jianjunz-mobl2.ccr.corp.intel.com (HELO localhost) ([10.249.170.205]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 18:53:54 -0700 Date: Fri, 10 Sep 2021 09:53:51 +0800 From: Yu Zhang To: Sean Christopherson Cc: Hou Wenlong , kvm@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Jan Kiszka , Avi Kivity , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v2 1/3] kvm: x86: Introduce hypercall x86 ops for handling hypercall not in cpl0 Message-ID: <20210910015351.yxvgv2nedgojmmeo@linux.intel.com> References: <04a337801ad5aaa54144dc57df8ee2fc32bc9c4e.1631188011.git.houwenlong93@linux.alibaba.com> <20210909163901.2vvozmkuxjcgabs5@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 09, 2021 at 05:09:11PM +0000, Sean Christopherson wrote: > On Fri, Sep 10, 2021, Yu Zhang wrote: > > On Thu, Sep 09, 2021 at 07:55:23PM +0800, Hou Wenlong wrote: > > > Per Intel's SDM, use vmcall instruction in non VMX operation for cpl3 > > > it should trigger a #UD. And in VMX root operation, it should > > > > Are you sure? IIRC, vmcall will always cause VM exit as long as CPU > > is in non-root mode(regardless the CPL). > > Correct, VMCALL unconditionally causes VM-Exit in non-root mode, but Hou is > referring to the first fault condition of "non VMX operation". The intent of the > patch is to emulate hardware behavior for CPL>0: if L1 is not in VMX operation, > a.k.a. not post-VMXON, then #UD, else #GP (because VMCALL #GPs at CPL>0 in VMX > root). Oh, I see. It's to make the virtualized world more real. But like you said, it's not KVM's target. And doing that could cause more problems - a PV guest expects the VMCALL to succeed, regardless it has VMX capability or its VMX is on or not. Thanks for the explaination. B.R. Yu