From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 15/24] KVM: x86 emulator: Provide more callbacks for x86 emulator. Date: Tue, 9 Mar 2010 18:25:15 +0200 Message-ID: <20100309162515.GC9066@redhat.com> References: <1268143762-4000-1-git-send-email-gleb@redhat.com> <1268143762-4000-16-git-send-email-gleb@redhat.com> <4B965EAF.10505@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5731 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754724Ab0CIQZR (ORCPT ); Tue, 9 Mar 2010 11:25:17 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29GPHVx014024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Mar 2010 11:25:17 -0500 Content-Disposition: inline In-Reply-To: <4B965EAF.10505@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 09, 2010 at 04:43:59PM +0200, Avi Kivity wrote: > On 03/09/2010 04:09 PM, Gleb Natapov wrote: > >Provide get_cached_descriptor(), set_cached_descriptor(), > >get_segment_selector(), set_segment_selector(), get_gdt(), > >write_std() callbacks. > > > >Signed-off-by: Gleb Natapov > >--- > > arch/x86/include/asm/kvm_emulate.h | 16 +++++ > > arch/x86/kvm/x86.c | 130 +++++++++++++++++++++++++++++++---- > > 2 files changed, 131 insertions(+), 15 deletions(-) > > > >diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h > >index 032d02f..e881618 100644 > >--- a/arch/x86/include/asm/kvm_emulate.h > >+++ b/arch/x86/include/asm/kvm_emulate.h > >@@ -63,6 +63,15 @@ struct x86_emulate_ops { > > unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); > > > > /* > >+ * write_std: Write bytes of standard (non-emulated/special) memory. > >+ * Used for descriptor writing. > >+ * @addr: [IN ] Linear address to which to write. > >+ * @val: [OUT] Value write to memory, zero-extended to 'u_long'. > >+ * @bytes: [IN ] Number of bytes to write to memory. > >+ */ > >+ int (*write_std)(unsigned long addr, void *val, > >+ unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); > > Descriptor writes need an atomic kvm_set_guest_bit(), no? > It is? atomic against what? Current code just write whole descriptor using write_std(). -- Gleb.