linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Balamuruhan S <bala24@linux.ibm.com>
To: mpe@ellerman.id.au
Cc: ravi.bangoria@linux.ibm.com, jniethe5@gmail.com,
	Balamuruhan S <bala24@linux.ibm.com>,
	paulus@samba.org, sandipan@linux.ibm.com,
	naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: [RFC PATCH 0/4] consolidate PowerPC instruction encoding macros
Date: Fri, 20 Mar 2020 13:48:33 +0530	[thread overview]
Message-ID: <20200320081837.1016820-1-bala24@linux.ibm.com> (raw)

ppc-opcode.h have base instruction encoding wrapped with stringify_in_c()
for raw encoding to have compatibility. But there are redundant macros for
base instruction encodings in bpf, instruction emulation test infrastructure
and powerpc selftests.

Currently PPC_INST_* macros are used for encoding instruction opcode and PPC_*
for raw instuction encoding, this rfc patchset introduces PPC_ENCODE_* macros
for base instruction encoding and reuse it from elsewhere. With this change we
can avoid redundant macro definitions in multiple files and start adding new
instructions in ppc-opcode.h in future.

TODO:
----
We can still improve further by moving all the instruction encoding
from bpf_jit.h to ppc-opcode.h and reuse them from bpf source. It can be
implemented based on the thoughts and feedback on this RFC.

This patchset is based on mpe's merge branch of linuxppc tree with a
fix patch on top of it,
https://patchwork.ozlabs.org/patch/1252760/

Thanks to Naveen and Sandipan on overall suggestions/improvements.

Tested it by compiling vmlinux with and without the changes and the
objdump of them remains to be same,

# diff vmlinux_objdump vmlinux_rfc_objdump 
2c2
< vmlinux:     file format elf64-powerpcle
---
> vmlinux_rfc:     file format elf64-powerpcle


I would request for your review and suggestions to make it better.

Balamuruhan S (4):
  powerpc ppc-opcode: consolidate PowerPC instruction macros
  powerpc selftest: reuse ppc-opcode macros to avoid redundancy
  powerpc ppc-opcode: move ppc instuction encoding from
    test_emulate_step
  powerpc kvm_asm: rename PPC_LD and PPC_STD macros to avoid
    redefinition

 arch/powerpc/include/asm/kvm_asm.h            |   8 +-
 arch/powerpc/include/asm/ppc-opcode.h         | 364 ++++++++++++------
 arch/powerpc/kvm/booke_interrupts.S           |   8 +-
 arch/powerpc/kvm/bookehv_interrupts.S         |  28 +-
 arch/powerpc/lib/test_emulate_step.c          | 155 +++-----
 arch/powerpc/net/bpf_jit.h                    |   8 -
 arch/powerpc/net/bpf_jit32.h                  |  10 +-
 arch/powerpc/net/bpf_jit64.h                  |   4 +-
 arch/powerpc/net/bpf_jit_comp.c               |   2 +-
 arch/powerpc/net/bpf_jit_comp64.c             |  14 +-
 .../selftests/powerpc/stringloops/Makefile    |  15 +-
 .../powerpc/stringloops/asm/asm-const.h       |   1 +
 .../powerpc/stringloops/asm/ppc-opcode.h      |  36 +-
 13 files changed, 361 insertions(+), 292 deletions(-)
 create mode 120000 tools/testing/selftests/powerpc/stringloops/asm/asm-const.h
 mode change 100644 => 120000 tools/testing/selftests/powerpc/stringloops/asm/ppc-opcode.h


base-commit: 8a445cbcb9f5090cb07ec6cbb89a8a1fc99a0ff7
prerequisite-patch-id: c271d8516dd39526e848dfa95ae38c9205002d2c
-- 
2.24.1


             reply	other threads:[~2020-03-20  8:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20  8:18 Balamuruhan S [this message]
2020-03-20  8:18 ` [RFC PATCH 1/4] powerpc ppc-opcode: introduce PPC_ENCODE_* macros for base instruction encoding Balamuruhan S
2020-03-20  8:18 ` [RFC PATCH 2/4] powerpc selftest: reuse ppc-opcode macros to avoid redundancy Balamuruhan S
2020-03-20  8:18 ` [RFC PATCH 3/4] powerpc ppc-opcode: move ppc instuction encoding from test_emulate_step Balamuruhan S
2020-04-01 16:51   ` Naveen N. Rao
2020-04-02  4:25     ` Michael Ellerman
2020-04-02  7:04       ` Naveen N. Rao
2020-04-03  7:14         ` Balamuruhan S
2020-03-20  8:18 ` [RFC PATCH 4/4] powerpc kvm_asm: rename PPC_LD and PPC_STD macros to avoid redefinition Balamuruhan S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200320081837.1016820-1-bala24@linux.ibm.com \
    --to=bala24@linux.ibm.com \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=sandipan@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).