From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [PATCH 3/5] kvm/svm: enhance mov DR intercept handler Date: Thu, 16 Dec 2010 13:07:34 +0100 Message-ID: <4D0A0106.5080005@amd.com> References: <1291989088-1380-1-git-send-email-andre.przywara@amd.com> <1291989088-1380-4-git-send-email-andre.przywara@amd.com> <4D060E40.60308@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: "mtosatti@redhat.com" , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:13372 "EHLO VA3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280Ab0LPMIg (ORCPT ); Thu, 16 Dec 2010 07:08:36 -0500 In-Reply-To: <4D060E40.60308@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 12/10/2010 03:51 PM, Andre Przywara wrote: >> Newer SVM implementations provide the GPR number in the VMCB, so >> that the emulation path is no longer necesarry to handle debug >> register access intercepts. Implement the handling in svm.c and >> use it when the info is provided. >> >> + >> + if (!err) >> + skip_emulated_instruction(&svm->vcpu); >> + else >> + kvm_inject_gp(&svm->vcpu, 0); >> + > > This repeats, how about using complete_insn_gp()? Do you want this to be in x86.c? We could use kvm_x86_ops->skip_emulated_instruction. Also shall I look for more similarities in the [CD]R intercept handling code between VMX and SVM? The switch responsible for actually reading and writing the regs is very similar. I could also try to merge this with the functionality in the emulator (if that works, haven't checked) Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448-3567-12