lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2fb92e17-2ad5-9732-560c-a7321e6a2528@csgroup.eu>
Date:   Thu, 1 Sep 2022 09:32:46 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Sathvika Vasireddy <sv@...ux.ibm.com>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
CC:     "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "aik@...abs.ru" <aik@...abs.ru>,
        "mpe@...erman.id.au" <mpe@...erman.id.au>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "mbenes@...e.cz" <mbenes@...e.cz>,
        "npiggin@...il.com" <npiggin@...il.com>,
        "chenzhongjin@...wei.com" <chenzhongjin@...wei.com>,
        "naveen.n.rao@...ux.vnet.ibm.com" <naveen.n.rao@...ux.vnet.ibm.com>
Subject: Re: [PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on
 ppc



Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
> This patch adds [stub] implementations for required
> functions, inorder to enable objtool build on powerpc.
> 
> Signed-off-by: Sathvika Vasireddy <sv@...ux.ibm.com>
> [Christophe Leroy: powerpc: Add missing asm/asm.h for objtool]
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
>   arch/powerpc/Kconfig                          |  1 +
>   arch/powerpc/include/asm/asm.h                |  7 ++
>   tools/objtool/arch/powerpc/Build              |  2 +
>   tools/objtool/arch/powerpc/decode.c           | 74 +++++++++++++++++++
>   .../arch/powerpc/include/arch/cfi_regs.h      | 11 +++
>   tools/objtool/arch/powerpc/include/arch/elf.h |  8 ++
>   .../arch/powerpc/include/arch/special.h       | 21 ++++++
>   tools/objtool/arch/powerpc/special.c          | 19 +++++
>   8 files changed, 143 insertions(+)
>   create mode 100644 arch/powerpc/include/asm/asm.h
>   create mode 100644 tools/objtool/arch/powerpc/Build
>   create mode 100644 tools/objtool/arch/powerpc/decode.c
>   create mode 100644 tools/objtool/arch/powerpc/include/arch/cfi_regs.h
>   create mode 100644 tools/objtool/arch/powerpc/include/arch/elf.h
>   create mode 100644 tools/objtool/arch/powerpc/include/arch/special.h
>   create mode 100644 tools/objtool/arch/powerpc/special.c
> 


> +int arch_decode_instruction(struct objtool_file *file, const struct section *sec,
> +			    unsigned long offset, unsigned int maxlen,
> +			    unsigned int *len, enum insn_type *type,
> +			    unsigned long *immediate,
> +			    struct list_head *ops_list)
> +{
> +	u32 insn;
> +
> +	*immediate = 0;
> +	insn = bswap_if_needed(file->elf, *(u32 *)(sec->data->d_buf + offset));
> +	*len = 4;

Should be *len = 8 when insn >> 26 == 1.

I will send you something later on.

> +	*type = INSN_OTHER;
> +
> +	return 0;
> +}
> +
> +unsigned long arch_jump_destination(struct instruction *insn)
> +{
> +	return insn->offset +  insn->immediate;

Two spaces after the +
Should be only one.

> +}
> +
> +void arch_initial_func_cfi_state(struct cfi_init_state *state)
> +{
> +	int i;
> +
> +	for (i = 0; i < CFI_NUM_REGS; i++) {
> +		state->regs[i].base = CFI_UNDEFINED;
> +		state->regs[i].offset = 0;
> +	}
> +
> +	/* initial CFA (call frame address) */
> +	state->cfa.base = CFI_SP;
> +	state->cfa.offset = 0;
> +
> +	/* initial LR (return address) */
> +	state->regs[CFI_RA].base = CFI_CFA;
> +	state->regs[CFI_RA].offset = 0;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ