Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'
On Thu, 20 May 2021 13:50:37 + (UTC), Christophe Leroy wrote: > This series is a cleanup of the use of 'struct ppc_inst'. > > A confusion is made between internal representation of powerpc > instructions with 'struct ppc_inst' and in-memory code which is > and will always be an array of 'unsigned int'. > > This series cleans it up. > > [...] Applied to powerpc/next. [01/12] powerpc/inst: Fix sparse detection on get_user_instr() https://git.kernel.org/powerpc/c/b3a9e523237013477bea914b7fbfbe420428b988 [02/12] powerpc/inst: Reduce casts in get_user_instr() https://git.kernel.org/powerpc/c/9134806e149ebb214f122f0f84254096d3768bb2 [03/12] powerpc/inst: Improve readability of get_user_instr() and friends https://git.kernel.org/powerpc/c/042e0860e1c1d60a0ab1ff3f16b7f420573133e0 [04/12] powerpc/inst: Avoid pointer dereferencing in ppc_inst_equal() https://git.kernel.org/powerpc/c/036b5560bebc72c61d955ae0b115e8e69da8a563 [05/12] powerpc: Do not dereference code as 'struct ppc_inst' (uprobe, code-patching, feature-fixups) https://git.kernel.org/powerpc/c/18c85964b10b7b78a5cb59a4959a5f82fdc77e4c [06/12] powerpc/lib/code-patching: Make instr_is_branch_to_addr() static https://git.kernel.org/powerpc/c/6c0d181daabcba286db9711eef8800b566fb1cce [07/12] powerpc/lib/code-patching: Don't use struct 'ppc_inst' for runnable code in tests. https://git.kernel.org/powerpc/c/e90a21ea801d1776d9a786ad02354fd3fe23ce09 [08/12] powerpc: Don't use 'struct ppc_inst' to reference instruction location https://git.kernel.org/powerpc/c/69d4d6e5fd9f4e805280ad831932c3df7b9d7cc7 [09/12] powerpc/inst: Refactor PPC32 and PPC64 versions https://git.kernel.org/powerpc/c/077c4dedef09796ade917459a5330e3940fb5860 [10/12] powerpc/optprobes: Minimise casts https://git.kernel.org/powerpc/c/afd3287c8872142ec4298a2b77bd9077e2209c9c [11/12] powerpc/optprobes: Compact code source a bit. https://git.kernel.org/powerpc/c/f38adf86ce4fdae84904f420e175ce5806509c4c [12/12] powerpc/optprobes: use PPC_RAW_ macros https://git.kernel.org/powerpc/c/0e628ad2d60896de31148fba00cc73623b8c0aa1 cheers
Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'
Christophe Leroy writes: > Le 15/06/2021 à 09:18, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> This series is a cleanup of the use of 'struct ppc_inst'. >>> >>> A confusion is made between internal representation of powerpc >>> instructions with 'struct ppc_inst' and in-memory code which is >>> and will always be an array of 'unsigned int'. >> >> Why don't we use u32 *, to make it even more explicit what the expected >> size is? >> > > I guess that's historical, we could use u32 * Yeah I think it is historical, we just never thought about it much. > We can convert it incrementaly maybe ? I've still got this series in next-test, so I'll go through it and change any uses of unsigned int * to u32 *, and then we can do another pass later to change the remaining cases. cheers
Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'
Le 15/06/2021 à 09:18, Michael Ellerman a écrit : Christophe Leroy writes: This series is a cleanup of the use of 'struct ppc_inst'. A confusion is made between internal representation of powerpc instructions with 'struct ppc_inst' and in-memory code which is and will always be an array of 'unsigned int'. Why don't we use u32 *, to make it even more explicit what the expected size is? I guess that's historical, we could use u32 * We can convert it incrementaly maybe ?
Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'
Christophe Leroy writes: > This series is a cleanup of the use of 'struct ppc_inst'. > > A confusion is made between internal representation of powerpc > instructions with 'struct ppc_inst' and in-memory code which is > and will always be an array of 'unsigned int'. Why don't we use u32 *, to make it even more explicit what the expected size is? cheers
Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'
Hi Michael, Le 20/05/2021 à 15:50, Christophe Leroy a écrit : This series is a cleanup of the use of 'struct ppc_inst'. A confusion is made between internal representation of powerpc instructions with 'struct ppc_inst' and in-memory code which is and will always be an array of 'unsigned int'. This series cleans it up. First patch is fixing detection of missing '__user' flag by sparse when using get_user_instr(). Last part of the series does some source code cleanup in optprobes, it is put at the ends of this series because of clashes with the 'struct ppc_inst' cleanups. What are your plans about this series ? I fear that the more we wait the more we get additional bad uses of 'struct ppc_inst'. There are several people working around places that play with instructions, so I think the sooner it gets cleaned the better it is. Do you agree ? Thanks Christophe