Re: [PATCH v3 08/75] x86/umip: Factor out instruction decoding

From: Borislav Petkov
Date: Thu Apr 30 2020 - 12:32:06 EST


On Tue, Apr 28, 2020 at 05:16:18PM +0200, Joerg Roedel wrote:
> +/**
> + * insn_decode() - Decode an instruction
> + * @regs: Structure with register values as seen when entering kernel mode
> + * @insn: Structure to store decoded instruction
> + * @buf: Buffer containing the instruction bytes
> + * @buf_size: Number of instruction bytes available in buf
> + *
> + * Decodes the instruction provided in buf and stores the decoding results in
> + * insn. Also determines the correct address and operand sizes.
> + *
> + * Returns:
> + *
> + * True if instruction was decoded, False otherwise.
> + */
> +bool insn_decode(struct pt_regs *regs, struct insn *insn,
> + unsigned char buf[MAX_INSN_SIZE], int buf_size)

Right, let's have @insn be the first function argument in all those
insn-handling functions.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette