Received: by 10.213.65.68 with SMTP id h4csp445534imn; Tue, 27 Mar 2018 02:17:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELvS1txKKKUmGmndccxmMRB06ar+zTT98nmFwrCwS1dYXQfwJNd3w0sc9MARN2DWVNliDiwz X-Received: by 2002:a17:902:6e01:: with SMTP id u1-v6mr33896682plk.96.1522142259462; Tue, 27 Mar 2018 02:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522142259; cv=none; d=google.com; s=arc-20160816; b=n+dQzgU5/VougIMwBwCCr4bfOVqjD6QZqrdeWMjOmw7W/F61VIO37d/JJt0vOFZ3vV qydrl7eavakes58lQnLyLb9gcPii29+Av6DYTxBRuy2WG+G4fdbpg2a7Nyk15euDl/Ft mqS/VvPhn1cvQWGn3jPiSimrOKBGpbQaxNJEhVNuPTMgh71k+rPsDTrFOASy4pbW/3BQ 6iNt275mFwlygJEACFCTlakU9qBwDGl3HPfWiL7WKQPf8xUC0LD8YF/S+2FkcuadvfF3 jz5piKy3Xpvj52GSjSlyLEnfG9VjASnCgy1HJA5w6fDLaLR2YKqTQ7LhJ4p1kNIifMYd f+EQ== 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:arc-authentication-results; bh=YZFpynsCTIP+yRBhdr0/zVauPKI1aHKAKJcCP9Hqcm0=; b=eInu3VCaA1kU77lfhntQpib+Un4D1bZpT0b+yRnUk32Df9pr1wDxHCIsZiWoA74Fqy qMqjh1zeYyIVbjBSiSjzs4rZXpQYZ+L4FaCK3er9JX5IB6ChjIrjM+co5ORhiztXexe2 tYdH1ZqTt9GRr8w0/h1z1XIGYmBq6+VtTBXumPKMf75KJBBgd2xnF1olU+iQs5dkl1sx gHJvjorwSBSdWf4+XTXIbLxutmotZuRejSJ0qVcRMqB2QgeGAp0OXZpV9oPlER98MFpS djpIXHh2q7Zs5Uy/vDhQhkt1eVC71lrfGHXf6mKQ1foNxmrCwml7ktX/evyHymynztEC 3Qfg== 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 be3-v6si835852plb.208.2018.03.27.02.17.24; Tue, 27 Mar 2018 02:17:39 -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 S1752087AbeC0JP5 (ORCPT + 99 others); Tue, 27 Mar 2018 05:15:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751121AbeC0JP4 (ORCPT ); Tue, 27 Mar 2018 05:15:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AC10722C0; Tue, 27 Mar 2018 09:15:55 +0000 (UTC) Received: from [10.36.117.97] (ovpn-117-97.ams2.redhat.com [10.36.117.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 369EA10B008F; Tue, 27 Mar 2018 09:15:48 +0000 (UTC) Subject: Re: [PATCH 2/2] KVM: VMX: Add Force Emulation Prefix for "emulate the next instruction" To: Nikita Leshenko , Liran Alon Cc: kernellwp@gmail.com, rkrcmar@redhat.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <95B06D42-EFDF-4750-AD03-98D6C78378D5@oracle.com> From: Paolo Bonzini Message-ID: <6d039f9d-99d9-fa4c-170b-6225bdba302a@redhat.com> Date: Tue, 27 Mar 2018 11:15:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <95B06D42-EFDF-4750-AD03-98D6C78378D5@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Mar 2018 09:15:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Mar 2018 09:15:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/03/2018 11:05, Nikita Leshenko wrote: > What you are essentially trying to do is create a PV interface to access > the x86 emulator. > Why not use a simple hypercall (VMCALL) to accomplish this instead of > inventing yet another PV method? Because hypercalls force you to use %rax for the hypercall number. Paolo > Something like “KVM_HC_EMULATE_NEXT_INSTRUCTION” in kvm_emulate_hypercall > should do the trick (however it needs to be placed before the check for > CPL>0 so that user mode code can test the emulator too). > > Nikita