From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roedel, Joerg" Subject: Re: [PATCH 0/3] KVM: Introduce VCPU-wide notion of guest-mode V2 Date: Wed, 1 Dec 2010 14:20:20 +0100 Message-ID: <20101201132020.GA11986@amd.com> References: <4CF3D093.40604@redhat.com> <1291049509-3430-1-git-send-email-joerg.roedel@amd.com> <20101201080149.GA29486@fermat.math.technion.ac.il> <20101201100359.GG2258@amd.com> <20101201113830.GA5469@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Avi Kivity , Marcelo Tosatti , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" To: Nadav Har'El Return-path: Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:47824 "EHLO VA3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755084Ab0LANU3 (ORCPT ); Wed, 1 Dec 2010 08:20:29 -0500 Content-Disposition: inline In-Reply-To: <20101201113830.GA5469@fermat.math.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Dec 01, 2010 at 06:38:30AM -0500, Nadav Har'El wrote: > Can you please say a few words why you'd want to move this nested-exit > request bit to x86.c? I don't want to move the actual exit-code itself into generic code. This code is different between svm and vmx. I think we could implement a call-back in kvm_x86_ops which is called when a vmexit is requested. The benefit is that we have a single and well-defined place where we emulate a vmexit. SVM already as a similar mechanism internally because nested_svm_vmexit may sleep and can't be called from certain places. Another reason is that emulating a vmexit at a wrong plase may have side-effects (for example when called from within the instruction emulator). With a generic request-bit I can remove the SVM internal implementation and nested vmx could use it too. I am certain you will need something similar in nested-vmx too. > Do you want to move some of the exit logic to x86.c - e.g., for the > injection logic? Thats another and probably more complex topic. I need a better understanding of (nested-)vmx before we discuss how this can be done. But a vmexit-callback may be helpful there as well. Joerg -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632