Commit f935178b authored by Borislav Petkov's avatar Borislav Petkov
Browse files

x86/insn: Make insn_complete() static



... and move it above the only place it is used.

Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-22-bp@alien8.de
parent 404b639e
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -178,13 +178,6 @@ static inline int insn_has_emulate_prefix(struct insn *insn)
	return !!insn->emulate_prefix_size;
}

/* Ensure this instruction is decoded completely */
static inline int insn_complete(struct insn *insn)
{
	return insn->opcode.got && insn->modrm.got && insn->sib.got &&
		insn->displacement.got && insn->immediate.got;
}

static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
{
	if (insn->vex_prefix.nbytes == 2)	/* 2 bytes VEX */
+7 −0
Original line number Diff line number Diff line
@@ -714,6 +714,13 @@ int insn_get_length(struct insn *insn)
	return 0;
}

/* Ensure this instruction is decoded completely */
static inline int insn_complete(struct insn *insn)
{
	return insn->opcode.got && insn->modrm.got && insn->sib.got &&
		insn->displacement.got && insn->immediate.got;
}

/**
 * insn_decode() - Decode an x86 instruction
 * @insn:	&struct insn to be initialized
+0 −7
Original line number Diff line number Diff line
@@ -178,13 +178,6 @@ static inline int insn_has_emulate_prefix(struct insn *insn)
	return !!insn->emulate_prefix_size;
}

/* Ensure this instruction is decoded completely */
static inline int insn_complete(struct insn *insn)
{
	return insn->opcode.got && insn->modrm.got && insn->sib.got &&
		insn->displacement.got && insn->immediate.got;
}

static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
{
	if (insn->vex_prefix.nbytes == 2)	/* 2 bytes VEX */
+7 −0
Original line number Diff line number Diff line
@@ -714,6 +714,13 @@ int insn_get_length(struct insn *insn)
	return 0;
}

/* Ensure this instruction is decoded completely */
static inline int insn_complete(struct insn *insn)
{
	return insn->opcode.got && insn->modrm.got && insn->sib.got &&
		insn->displacement.got && insn->immediate.got;
}

/**
 * insn_decode() - Decode an x86 instruction
 * @insn:	&struct insn to be initialized