On 09/14/2011 01:41 PM, Takuya Yoshikawa wrote:
On Tue, 13 Sep 2011 10:45:40 +0300 Avi Kivity<avi@xxxxxxxxxx> wrote: > Simplifies further generalization of decode. > > Signed-off-by: Avi Kivity<avi@xxxxxxxxxx> > --- > arch/x86/include/asm/kvm_emulate.h | 2 ++ > arch/x86/kvm/emulate.c | 34 +++++++++++++++++----------------- > 2 files changed, 19 insertions(+), 17 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h > index 6040d11..56bac3e 100644 > --- a/arch/x86/include/asm/kvm_emulate.h > +++ b/arch/x86/include/asm/kvm_emulate.h > @@ -275,6 +275,8 @@ struct x86_emulate_ctxt { > unsigned long _eip; > /* Fields above regs are cleared together. */ > unsigned long regs[NR_VCPU_REGS]; > + struct operand memop; > + struct operand *memopp; > struct fetch_cache fetch; > struct read_cache io_read; > struct read_cache mem_read; 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?)
-- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html