Received: by 10.213.65.68 with SMTP id h4csp442795imn; Tue, 27 Mar 2018 02:13:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/hwCccrh7DWv2ZI2x5R11lBeY3va/TKaslK+h5Lx1eGaEfo/IqNaeltoTV5utm7fsG/1m0 X-Received: by 2002:a17:902:9045:: with SMTP id w5-v6mr8917588plz.52.1522142013020; Tue, 27 Mar 2018 02:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522142012; cv=none; d=google.com; s=arc-20160816; b=gIcYG184fzSaZ7P13Y26KfqMgjw79YL48WC2TnNAGhRLjep4cR2HaZSo6t0Hx8C64V AvKYNDQRj3ODKG11JvWhUY/Ic5MPLZ6ebomUkUm9+EkeNqbAKZSIqDCKP4f/5Lv/vpAb 2Xh1MyDxeuk93po6RRECG6uQp5iccQG2C5FB9UOu6dQtpCM1TfQ+TAAG7kwRSar+2xAe 3hKOo32+Vo7gl30Rn8/TC9EyMeW5JbZ71ZKAn5V8eSsM6V4yFidjuRMfVAYZPq6TMjQZ cw94LSfAEZoTdWALuspUlj0+yRpyJz9RYODkKLO1Taq1reAro5TLScGvRl4aMreig+qW zQsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=DNYxNOsHmnKo5VaNDGNQdX6HxZfwHuha7iX37VIZ/JM=; b=vHuEbwYdpmbUasWNVajcSgHsd/ZQ6YQjl2IJUsZFe43VFkgnyU3wbaAuCvNL7RDNXv VEys1mHJfvjrgazvDxeBDzIN6mdJEw1v/gApB8WvMFXu13uH4/BfqIxwsDpa4tp/+Zwi iP3TX1/GB51c+vL0hVbP5Q/0H4jKnKKlECOBwRF11OSwZMbw4oRDQL3kzuooY7kekhXr dfm5oPBYRJCmlK5Eor4Oxew7Ye9vU3Dw6BGaxXWn1GZIYrzOXNV/3C+8xILBfMf8QJT0 P74deJ9yEq+Xc0BPf1C4WI3yMHWuKmdPSLCltpzavOQHSd8juCgZvmU84II2eiUwfet6 iyvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=nBiGFqYJ; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e34-v6si842436plb.281.2018.03.27.02.13.18; Tue, 27 Mar 2018 02:13:32 -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=@oracle.com header.s=corp-2017-10-26 header.b=nBiGFqYJ; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbeC0JKl (ORCPT + 99 others); Tue, 27 Mar 2018 05:10:41 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:38282 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752469AbeC0JKh (ORCPT ); Tue, 27 Mar 2018 05:10:37 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2R93niI023183; Tue, 27 Mar 2018 09:10:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2017-10-26; bh=DNYxNOsHmnKo5VaNDGNQdX6HxZfwHuha7iX37VIZ/JM=; b=nBiGFqYJt+i6u7+22tgCO8Oms+D23SqzGiLTSCSPUvFftM2afAvRZMJmIsNF+xAUq104 IJPX942R2pBA5GdlL0ay2f5dAiJU/YsgvpQPIjJEGByMueXAvkW8NtGdFy7Zx776a0h5 DHNgZfNOafLWrJ2oLBcaf+N0NUfkN0mW+60H0QM01B8WQma+l/Wm0g2hivaViLygOne2 UrbSx509Sf/6plz7Tr7eF8qKLgvxLdnp9EkZb3FhDr2NlZgdOIQ85IFquS/gNdAQ1Rhr 5oKSnCye4ocRhtDJlDVCZDtcJW2anyOn4MvMuzPCqalEPlxLTqxLAu2/2Ivfi3N8kD1a /A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2gyjrg047p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Mar 2018 09:10:31 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2R95VR1016258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Mar 2018 09:05:31 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2R95UwO011043; Tue, 27 Mar 2018 09:05:30 GMT Received: from nikita.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Mar 2018 02:05:30 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH 2/2] KVM: VMX: Add Force Emulation Prefix for "emulate the next instruction" From: Nikita Leshenko In-Reply-To: Date: Tue, 27 Mar 2018 12:05:25 +0300 Cc: pbonzini@redhat.com, kernellwp@gmail.com, rkrcmar@redhat.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <95B06D42-EFDF-4750-AD03-98D6C78378D5@oracle.com> References: To: Liran Alon X-Mailer: Apple Mail (2.3273) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8844 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803270095 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Something like =E2=80=9CKVM_HC_EMULATE_NEXT_INSTRUCTION=E2=80=9D 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 > On 27 Mar 2018, at 11:26, Liran Alon wrote: >=20 >=20 > ----- pbonzini@redhat.com wrote: >=20 >> On 27/03/2018 09:52, Liran Alon wrote: >>> In addition, I think this module parameter should be in kvm module >>> (not kvm_intel) and you should add similar logic to kvm_amd module >> (SVM) >>=20 >> If you can move handle_ud to x86.c, then it makes sense to have the >> module parameter in the kvm module. I haven't checked. >=20 > I don't see a reason why you couldn't do that. >=20 >>=20 >> Otherwise you would have to EXPORT_SYMBOL_GPL the variable; in the >=20 > This is what I did for enable_vmware_backdoor module parameter. > I think this is what should be done in this case as-well. >=20 >> end >> it's just a debugging tool, so it'd be simpler to just add it >> separately >> to kvm_intel and kvm_amd. >=20 > I agree it's just a debugging tool. But no reason for it to be used = differently > when running tests on Intel CPU vs. AMD CPU. > I think the effort to fix this is low. >=20 >>=20 >> Paolo >=20 >=20