From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muli Ben-Yehuda Subject: Re: [PATCH 07/12] Add VMRUN handler v6 Date: Sun, 23 Nov 2008 10:06:01 +0200 Message-ID: <20081123080601.GC10560@il.ibm.com> References: <1227280482-25361-2-git-send-email-agraf@suse.de> <1227280482-25361-3-git-send-email-agraf@suse.de> <1227280482-25361-4-git-send-email-agraf@suse.de> <1227280482-25361-5-git-send-email-agraf@suse.de> <1227280482-25361-6-git-send-email-agraf@suse.de> <1227280482-25361-7-git-send-email-agraf@suse.de> <1227280482-25361-8-git-send-email-agraf@suse.de> <20081121152320.GF26684@il.ibm.com> <4926D31C.2060001@suse.de> <4926D544.60403@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, joro@8bytes.org, anthony@codemonkey.ws, avi@redhat.com To: Alexander Graf Return-path: Received: from mtagate2.de.ibm.com ([195.212.17.162]:45854 "EHLO mtagate2.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752383AbYKWIGK (ORCPT ); Sun, 23 Nov 2008 03:06:10 -0500 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id mAN869oG028735 for ; Sun, 23 Nov 2008 08:06:09 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mAN8690a3960998 for ; Sun, 23 Nov 2008 09:06:09 +0100 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mAN868BV009444 for ; Sun, 23 Nov 2008 09:06:09 +0100 Content-Disposition: inline In-Reply-To: <4926D544.60403@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Nov 21, 2008 at 04:35:32PM +0100, Alexander Graf wrote: > Alexander Graf wrote: > > Muli Ben-Yehuda wrote: > > > >> On Fri, Nov 21, 2008 at 04:14:37PM +0100, Alexander Graf wrote: > >> > >> > >> > >>> +static int vmrun_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) > >>> +{ > >>> + nsvm_printk("VMrun\n"); > >>> + if (nested_svm_check_permissions(svm)) > >>> + return 1; > >>> + > >>> + svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; > >>> + skip_emulated_instruction(&svm->vcpu); > >>> + > >>> + if (nested_svm_do(svm, svm->vmcb->save.rax, 0, > >>> + NULL, nested_svm_vmrun)) > >>> + return 1; > >>> + > >>> + if (nested_svm_do(svm, svm->vmcb->control.msrpm_base_pa, 0, > >>> + NULL, nested_svm_vmrun_msrpm)) > >>> + return 1; > >>> > >>> > >> nested_svm_vmrun returns 1 unconditionally, so we never call > >> nested_svm_vmrun_msrpm. > >> > >> > > > > Wow the one thing you pointed out earlier. I must've missed to write > > that on my TODO list. > > I'll fix this right now :). Await v7 any second now. > > > > Wow this is more tricky than I thought. I gotta go now, but I'll > look into it in more detail on Tuesday. I promise :-). For now > please just don't use the MSR check. No problem. While you are looking at it, another question: In the vmrun handler, we call kvm_mmu_reset_context() in the SPT case only. In the vmexit handler, we call kvm_mmu_reset_context() for both SPT and NPT. Why the discrepancy? Cheers, Muli -- The First Workshop on I/O Virtualization (WIOV '08) Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/ <-> SYSTOR 2009---The Israeli Experimental Systems Conference http://www.haifa.il.ibm.com/conferences/systor2009/