From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH 03/14] KVM: x86 emulator: move memop, memopp into emulation context Date: Thu, 15 Sep 2011 00:21:44 +0900 Message-ID: <20110915002144.feb1139e.takuya.yoshikawa@gmail.com> References: <1315899951-2357-1-git-send-email-avi@redhat.com> <1315899951-2357-4-git-send-email-avi@redhat.com> <20110914194144.9d9946cf.yoshikawa.takuya@oss.ntt.co.jp> <4E7091F1.4040900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mail-yw0-f46.google.com ([209.85.213.46]:48098 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755509Ab1INP04 (ORCPT ); Wed, 14 Sep 2011 11:26:56 -0400 Received: by ywb5 with SMTP id 5so1486488ywb.19 for ; Wed, 14 Sep 2011 08:26:56 -0700 (PDT) In-Reply-To: <4E7091F1.4040900@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 14 Sep 2011 14:37:21 +0300 Avi Kivity wrote: > > Once the emulator context gets stablized, some comments will be nice > > to know which ones are supposed to be accessed from outside of the > > emulator, and which ones are only for the emulator internal usage. > > > > Practically, knowing each member's lifetime, decode stage only or > > emulation stage only or throughout the emulation, will make it easy > > to avoid extra ctxt/regs initialization and ... maybe more. > > > > Nothing should be accessed from outside the emulator, except via > accessors. We should move initialization to the emulator as well (or > just initialize from x86_decode_insn() - any reason not to?) Not big reason but kvm_inject_realmode_interrupt() and kvm_task_switch() call emulate_int_real() and emulator_task_switch() respectively without doing generic decoding. So at least, we need some special initialization for them if we move init_emulate_ctxt() into x86_decode_insn(). Takuya