Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9dac77fa authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: x86 emulator: fold decode_cache into x86_emulate_ctxt



This saves a lot of pointless casts x86_emulate_ctxt and decode_cache.

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 36dd9bb5
Loading
Loading
Loading
Loading
+20 −24
Original line number Diff line number Diff line
@@ -229,7 +229,26 @@ struct read_cache {
	unsigned long end;
};

struct decode_cache {
struct x86_emulate_ctxt {
	struct x86_emulate_ops *ops;

	/* Register state before/after emulation. */
	unsigned long eflags;
	unsigned long eip; /* eip before instruction emulation */
	/* Emulated execution mode, represented by an X86EMUL_MODE value. */
	int mode;

	/* interruptibility state, as a result of execution of STI or MOV SS */
	int interruptibility;

	bool guest_mode; /* guest running a nested guest */
	bool perm_ok; /* do not check permissions if true */
	bool only_vendor_specific_insn;

	bool have_exception;
	struct x86_exception exception;

	/* decode cache */
	u8 twobyte;
	u8 b;
	u8 intercept;
@@ -261,29 +280,6 @@ struct decode_cache {
	struct read_cache mem_read;
};

struct x86_emulate_ctxt {
	struct x86_emulate_ops *ops;

	/* Register state before/after emulation. */
	unsigned long eflags;
	unsigned long eip; /* eip before instruction emulation */
	/* Emulated execution mode, represented by an X86EMUL_MODE value. */
	int mode;

	/* interruptibility state, as a result of execution of STI or MOV SS */
	int interruptibility;

	bool guest_mode; /* guest running a nested guest */
	bool perm_ok; /* do not check permissions if true */
	bool only_vendor_specific_insn;

	bool have_exception;
	struct x86_exception exception;

	/* decode cache */
	struct decode_cache decode;
};

/* Repeat String Operation Prefix */
#define REPE_PREFIX	0xf3
#define REPNE_PREFIX	0xf2