[PATCH v5 0/4] target/ppc: Untangle CPU init from translation

2021-05-05 Thread Bruno Larsen (billionai)
nnecessary * kept more functions as static * ensured that the project builds after every commit Bruno Larsen (billionai) (4): target/ppc: renamed SPR registration functions target/ppc: move SPR R/W callbacks to translate.c target/ppc: turned SPR R/W callbacks not static target/ppc: isolated cpu

[PATCH v5 2/4] target/ppc: move SPR R/W callbacks to translate.c

2021-05-05 Thread Bruno Larsen (billionai)
Moved all read and write callbacks for SPRs away from translate_init.c.inc and into translate.c; these functions are TCG only, so this motion is required to enable building with the flag disable-tcg Signed-off-by: Bruno Larsen (billionai) --- target/ppc/translate.c | 1037

[PATCH v5 1/4] target/ppc: renamed SPR registration functions

2021-05-05 Thread Bruno Larsen (billionai)
Renamed all gen_spr_* and gen_* functions specifically related to registering SPRs to register_*_sprs and register_*, to avoid future confusion with other TCG related code. Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/translate_init.c.inc | 860

[PATCH v5 3/4] target/ppc: turned SPR R/W callbacks not static

2021-05-05 Thread Bruno Larsen (billionai)
To be able to compile translate_init.c.inc as a standalone file, we have to make the callbacks accessible outside of translate.c; This patch does exactly that Signed-off-by: Bruno Larsen (billionai) --- target/ppc/spr_tcg.h | 134 ++ target/ppc/translate.c | 210

[PATCH v5 4/4] target/ppc: isolated cpu init from translation logic

2021-05-05 Thread Bruno Larsen (billionai)
finished isolation of CPU initialization logic from translation logic. CPU initialization now only has common code and may or may not call accelerator-specific code, as the build options require. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/{translate_init.c.inc => cpu_init.c}

[RESEND PATCH v5 2/4] target/ppc: move SPR R/W callbacks to translate.c

2021-05-06 Thread Bruno Larsen (billionai)
Moved all read and write callbacks for SPRs away from translate_init.c.inc and into translate.c; these functions are TCG only, so this motion is required to enable building with the flag disable-tcg Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc

[RESEND v5 3/4] target/ppc: turned SPR R/W callbacks not static

2021-05-07 Thread Bruno Larsen (billionai)
To be able to compile translate_init.c.inc as a standalone file, we have to make the callbacks accessible outside of translate.c; This patch does exactly that Signed-off-by: Bruno Larsen (billionai) --- target/ppc/spr_tcg.h | 134 ++ target/ppc/translate.c | 210

[RESEND v5 4/4] target/ppc: isolated cpu init from translation logic

2021-05-07 Thread Bruno Larsen (billionai)
finished isolation of CPU initialization logic from translation logic. CPU initialization now only has common code and may or may not call accelerator-specific code, as the build options require. Signed-off-by: Bruno Larsen (billionai) Reviewed-by: David Gibson --- target/ppc

[RFC PATCH 00/11] target/ppc: add support to disable-tcg

2021-05-12 Thread Bruno Larsen (billionai)
r the end are a bit of a shot in the dark, so we figured RFC would be a better way to tag this patch series. Bruno Larsen (billionai) (10): target/ppc: created ppc_{store,get}_vscr for generic vscr usage target/ppc: moved ppc_store_sdr1 to cpu.c target/ppc: moved ppc_cpu_dump_state to cpu_i

[PATCH 05/11] target/ppc: moved ppc_store_lpcr to cpu.c

2021-05-12 Thread Bruno Larsen (billionai)
This function is used in !TCG cases, so it has been moved into a file that is compiled when --disable-tcg is selected. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c | 11 +++ target/ppc/misc_helper.c | 10 -- 2 files changed, 11 insertions(+), 10 deletions

[PATCH 01/11] target/ppc: created ppc_{store, get}_vscr for generic vscr usage

2021-05-12 Thread Bruno Larsen (billionai)
Some functions unrelated to TCG use helper_m{t,f}vscr, so generic versions of those functions were added to cpu.c, in preparation for compilation without TCG Signed-off-by: Bruno Larsen (billionai) --- target/ppc/arch_dump.c | 3 +-- target/ppc/cpu.c| 16 target/ppc

[PATCH 04/11] target/ppc: moved ppc_store_msr into gdbstub.c

2021-05-12 Thread Bruno Larsen (billionai)
This function is used by !TCG cases, so it was moved to a common code file. We chose gdbstub.c since it was the one giving us grief over it. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/gdbstub.c | 7 +++ target/ppc/misc_helper.c | 6 -- 2 files changed, 7 insertions(+), 6

[PATCH 03/11] target/ppc: moved ppc_cpu_dump_state to cpu_init.c

2021-05-12 Thread Bruno Larsen (billionai)
This function was forgotten in the cpu_init code motion series, but it seems to be used regardless of TCG, and so needs to be moved to support disabling TCG. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu_init.c | 182 +++ target/ppc/translate.c

[PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c

2021-05-12 Thread Bruno Larsen (billionai)
Moved this function that is required in !TCG cases into a common code file Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c| 29 + target/ppc/mmu_helper.c | 26 -- 2 files changed, 29 insertions(+), 26 deletions(-) diff

[PATCH 11/11] target/ppc: updated meson.build to support disable-tcg

2021-05-12 Thread Bruno Larsen (billionai)
updated build file to not compile some sources that are unnecessary if TCG is disabled on the system. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/target/ppc/meson.build b/target/ppc

[RFC PATCH 10/11] target/ppc: created tcg-stub.c file

2021-05-12 Thread Bruno Larsen (billionai)
ile in the !TCG case would create an ifdef hell, but extracting the functions meant moving many others as well, and there weren't any good places to put them. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/tcg-stub.c | 33 + 1 file changed, 33 insert

[PATCH 07/11] target/ppc: added KVM fallback to fpscr manipulation

2021-05-12 Thread Bruno Larsen (billionai)
some common code needs to store information in fpscr, but this function relies on TCG cde to work. This patch adds a kvm way to do it, and a transparent way to call it when TCG is not compiled Signed-off-by: Bruno Larsen (billionai) --- target/ppc/gdbstub.c | 1 + target/ppc/kvm.c | 14

[PATCH 06/11] target/ppc: updated vscr manipulation in machine.c

2021-05-12 Thread Bruno Larsen (billionai)
Updated the code in machine.c to use the generic ppc_{store,get}_vscr instead of helper style functions, so it can build without TCG Signed-off-by: Bruno Larsen (billionai) --- target/ppc/machine.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/ppc/machine.c b

[RFC PATCH 08/11] target/ppc: wrapped some TCG only logic with ifdefs

2021-05-12 Thread Bruno Larsen (billionai)
should reorder some code to minimize ifdef count Signed-off-by: Bruno Larsen (billionai) --- include/exec/helper-proto.h | 2 ++ target/ppc/cpu_init.c | 8 target/ppc/excp_helper.c| 6 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/exec/helper

[PATCH 09/11] include/exec: added functions to the stubs in exec-all.h

2021-05-12 Thread Bruno Larsen (billionai)
From: "Lucas Mateus Castro (alqotel)" Added tlb_set_page and tlb_set_page_with_attrs to the stubbed functions in exec-all.h as it is needed in some functions when compiling without TCG Signed-off-by: Lucas Mateus Castro (alqotel) --- include/exec/exec-all.h | 10 ++ 1 file changed, 10

[PATCH 1/4] target/ppc: Code motion required to build disabling tcg

2021-04-09 Thread Bruno Larsen (billionai)
call functions from gdbstub or translate_init Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c| 859 +++ target/ppc/cpu.h| 15 + target/ppc/gdbstub.c| 253 +++ target/ppc/translate_init.c.inc | 1148

[PATCH 4/4] target/ppc: updated build rules for disable-tcg option

2021-04-09 Thread Bruno Larsen (billionai)
updated the meson file to respect the disable-tcg option and only add relevant files to the build process Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/target/ppc/meson.build b

[PATCH 2/4] target/ppc: added solutions for building with disable-tcg

2021-04-09 Thread Bruno Larsen (billionai)
in kvm_ppc.h, transparently changes the helper into the KVM call, if TCG is not enabled. I believe the first solution is better, but it is less readable, so I wanted to have some feedback Signed-off-by: Bruno Larsen (billionai) --- target/ppc/arch_dump.c | 17 + target/ppc/kvm.c

[PATCH 3/4] target/ppc: Add stubs for tcg functions, so it builds

2021-04-09 Thread Bruno Larsen (billionai)
by a KVM implementation in the final product, but I'm not sure which ones have to be replace, which can remain stubs, and which should not be called at all. Input in general is very much welcome. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/tcg-st

[RFC PATCH 0/4] target/ppc: add disable-tcg option

2021-04-09 Thread Bruno Larsen (billionai)
21-04/msg0717. The second patch shows the 2 strategies we've considered, and hope to get feedback on. The third patch contains the stubs we haven't decided on how to deal with yet, but needed to exist to compile the project. The final patch just changes the meson.build rules Bruno Larsen

[PATCH] target/ppc: code motion from translate_init.c.inc to gdbstub.c

2021-04-12 Thread Bruno Larsen (billionai)
As suggested by Fabiano Rosas, all the code related to gdb has been moved from translate_init.c.inc file to the gdbstub.c file, where it makes more sense Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.h| 11 ++ target/ppc/gdbstub.c| 261

[PATCH v2] target/ppc: code motion from translate_init.c.inc to gdbstub.c

2021-04-13 Thread Bruno Larsen (billionai)
All the code related to gdb has been moved from translate_init.c.inc file to the gdbstub.c file, where it makes more sense. Updated version, solving some missing parts of the patch and style choices. Signed-off-by: Bruno Larsen (billionai) Suggested-by: Fabiano Rosas --- target/ppc/cpu.h

[PATCH v3] target/ppc: code motion from translate_init.c.inc to gdbstub.c

2021-04-14 Thread Bruno Larsen (billionai)
All the code related to gdb has been moved from translate_init.c.inc file to the gdbstub.c file, where it makes more sense. This new version puts the prototypes in internal.h, to not expose them unnecessarily. Signed-off-by: Bruno Larsen (billionai) Suggested-by: Fabiano Rosas --- target/ppc

[PATCH v3 0/9] target/ppc: add support to disable-tcg

2021-05-21 Thread Bruno Larsen (billionai)
were already accepted * applied rth's cleanup to ppc_store_sdr1 * changed destination of ppc_store_msr * undone change to helper-proto, now fewer files include it Bruno Larsen (billionai) (9): target/ppc: cleaned error_report from ppc_store_sdr1 target/ppc: moved ppc_store_lpcr and ppc_s

[PATCH v3 2/9] target/ppc: moved ppc_store_lpcr and ppc_store_msr to cpu.c

2021-05-21 Thread Bruno Larsen (billionai)
These functions are used in hw/ppc logic, during machine startup, which means it must be compiled when --disable-tcg is selected, and so it has been moved into a common code file Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson Reviewed-by: David Gibson --- target/ppc

[PATCH v3 6/9] target/ppc: moved ppc_cpu_do_interrupt to cpu.c

2021-05-21 Thread Bruno Larsen (billionai)
Moved the ppc_cpu_do_interrupt function to cpu.c file, where it makes more sense, and turned powerpc_excp not static, as it now needs to be accessed from outside of excp_helper.c Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c | 20 target/ppc/cpu.h

[PATCH v3 4/9] target/ppc: overhauled and moved logic of storing fpscr

2021-05-21 Thread Bruno Larsen (billionai)
fpscr_set_rounding_mode into cpu.c as it could now be moved there, and it is needed when a value for the fpscr is being stored directly. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/cpu.c| 43 target/ppc

[PATCH v3 1/9] target/ppc: cleaned error_report from ppc_store_sdr1

2021-05-21 Thread Bruno Larsen (billionai)
Changed how the function ppc_store_sdr1, from error_report(...) to qemu_log_mask(LOG_GUEST_ERROR, ...). Signed-off-by: Bruno Larsen (billionai) Suggested-by: Richard Henderson --- target/ppc/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/ppc/cpu.c b

[PATCH v3 3/9] target/ppc: reduce usage of fpscr_set_rounding_mode

2021-05-21 Thread Bruno Larsen (billionai)
It is preferable to store the current rounding mode and retore from that than recalculating from fpscr, so we changed the behavior of do_fri and VSX_ROUND to do it like that. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc

[PATCH v3 9/9] target/ppc: updated meson.build to support disable-tcg

2021-05-21 Thread Bruno Larsen (billionai)
updated build file to not compile some sources that are unnecessary if TCG is disabled on the system. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/ppc/meson.build b/target/ppc/meson.build

[PATCH v3 7/9] target/ppc: Added options to disable many TCG-only functions

2021-05-21 Thread Bruno Larsen (billionai)
also create stubs for ppc_*_opcodes, to make the ifdef hell a little smaller, and have hid part of the spr_registration logic into the macro that can make the TCG part disappear. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu_init.c| 11 +++--- target/ppc/excp_helper.c | 85

[PATCH v3 5/9] target/ppc: removed unnecessary inclusion of helper-proto.h

2021-05-21 Thread Bruno Larsen (billionai)
These files included helper-proto.h, but didn't use or declare any helpers, so the #include has been removed Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/cpu_init.c| 1 - target/ppc/gdbstub.c | 1 - target/ppc/mmu-hash32.c | 1 - target/pp

[PATCH v3 8/9] target/ppc: created tcg-stub.c file

2021-05-21 Thread Bruno Larsen (billionai)
be reached. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 4 target/ppc/tcg-stub.c | 25 + 2 files changed, 29 insertions(+) create mode 100644 target/ppc/tcg-stub.c diff --git a/target/ppc/meson.build b/target/ppc/meson.build index d1aa7d5d39..

[PATCH v4 0/5] target/ppc: add support to disable-tcg

2021-05-24 Thread Bruno Larsen (billionai)
o ppc_store_sdr1 * changed destination of ppc_store_msr * undone change to helper-proto, now fewer files include it Bruno Larsen (billionai) (5): target/ppc: moved ppc_cpu_do_interrupt to cpu.c target/ppc: used ternary operator when registering MAS target/ppc: added ifdefs around TCG-only c

[PATCH v4 1/5] target/ppc: moved ppc_cpu_do_interrupt to cpu.c

2021-05-24 Thread Bruno Larsen (billionai)
Moved the ppc_cpu_do_interrupt function to cpu.c file, where it makes more sense, and turned powerpc_excp not static, as it now needs to be accessed from outside of excp_helper.c Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c | 20 target/ppc/cpu.h

[PATCH v4 3/5] target/ppc: added ifdefs around TCG-only code

2021-05-24 Thread Bruno Larsen (billionai)
ed as part of a future cleanup (all the dump_statistics part is almost never used and will become obsolete as we transition to using decodetree). Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu_init.c| 2 ++ target/ppc/excp_helper.c | 21 ++--- target/ppc/mmu-hash64.c

[PATCH v4 2/5] target/ppc: used ternary operator when registering MAS

2021-05-24 Thread Bruno Larsen (billionai)
The write calback decision when registering the MAS SPR has been turned into a ternary operation, rather than an if-then-else block. Signed-off-by: Bruno Larsen (billionai) Suggested-by: Richard Henderson --- target/ppc/cpu_init.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions

[PATCH v4 4/5] target/ppc: created tcg-stub.c file

2021-05-24 Thread Bruno Larsen (billionai)
be reached. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 4 target/ppc/tcg-stub.c | 45 ++ 2 files changed, 49 insertions(+) create mode 100644 target/ppc/tcg-stub.c diff --git a/target/ppc/meson.build b/target/ppc/meson.b

[PATCH v4 5/5] target/ppc: updated meson.build to support disable-tcg

2021-05-24 Thread Bruno Larsen (billionai)
updated build file to not compile some sources that are unnecessary if TCG is disabled on the system. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/ppc/meson.build b/target/ppc/meson.build

[PATCH v5 0/4] target/ppc: add support to disable-tcg

2021-05-25 Thread Bruno Larsen (billionai)
er compiles with linux-user * removed patches ther were already accepted * applied rth's cleanup to ppc_store_sdr1 * changed destination of ppc_store_msr * undone change to helper-proto, now fewer files include it Bruno Larsen (billionai) (4): target/ppc: used ternary operator when

[PATCH v5 2/4] target/ppc: added ifdefs around TCG-only code

2021-05-25 Thread Bruno Larsen (billionai)
ed as part of a future cleanup (all the dump_statistics part is almost never used and will become obsolete as we transition to using decodetree). Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu_init.c| 2 ++ target/ppc/excp_helper.c | 21 ++--- target/ppc/mmu-hash64.c

[PATCH v5 1/4] target/ppc: used ternary operator when registering MAS

2021-05-25 Thread Bruno Larsen (billionai)
y the decision and assignment to the local pointer, creating compiler errors. This cleanup looked better than using ifdefs, so we decided to with it. Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/cpu_init.c | 9 +++-- 1 file changed, 3 insertions(+), 6 dele

[PATCH v5 4/4] target/ppc: updated meson.build to support disable-tcg

2021-05-25 Thread Bruno Larsen (billionai)
updated build file to not compile some sources that are unnecessary if TCG is disabled on the system. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/ppc/meson.build b/target/ppc/meson.build

[PATCH v5 3/4] target/ppc: created tcg-stub.c file

2021-05-25 Thread Bruno Larsen (billionai)
be reached. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/meson.build | 4 target/ppc/tcg-stub.c | 45 ++ 2 files changed, 49 insertions(+) create mode 100644 target/ppc/tcg-stub.c diff --git a/target/ppc/meson.build b/target/ppc/meson.b

[PATCH] target/ppc: fold ppc_store_ptcr into it's only caller

2021-05-26 Thread Bruno Larsen (billionai)
ppc_store_ptcr, defined in mmu_helper.c, was only used by helper_store_ptcr, in misc_helper.c. To avoid possible confusion, the function was folded into the helper. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.h | 1 - target/ppc/misc_helper.c | 24

[PATCH 2/5] target/ppc: remove ppc_cpu_dump_statistics

2021-05-26 Thread Bruno Larsen (billionai)
with ppc_cpu_dump_statistics. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.h | 1 - target/ppc/cpu_init.c | 3 --- target/ppc/translate.c | 51 -- 3 files changed, 55 deletions(-) diff --git a/targe

[PATCH 0/5] stop collection of instruction usage statistics

2021-05-26 Thread Bruno Larsen (billionai)
tially), those statistics won't be used anymore. Therefore, this patch removes that functinality completely. This series was suggested by Richard Henderson Bruno Larsen (billionai) (5): target/ppc: fixed GEN_OPCODE behavior when PPC_DUMP_CPU is set target/ppc: remove ppc_cpu_dump_statistics

[PATCH 1/5] target/ppc: fixed GEN_OPCODE behavior when PPC_DUMP_CPU is set

2021-05-26 Thread Bruno Larsen (billionai)
igned-off-by: Bruno Larsen (billionai) --- target/ppc/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index ea200f9637..6c0f424d81 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -1345,7 +1345,7 @@ ty

[PATCH 3/5] target/ppc: removed mentions to DO_PPC_STATISTICS

2021-05-26 Thread Bruno Larsen (billionai)
Removed the commented out definition and all ifdefs relating to PPC_DUMP_STATISTICS, as it's hardly ever used. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/translate.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff

[PATCH 5/5] hw/core/cpu: removed cpu_dump_statistics function

2021-05-26 Thread Bruno Larsen (billionai)
No more architectures set the pointer to dump_statistics, so there's no point in keeping it, or the related cpu_dump_statistics function. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- hw/core/cpu.c | 9 - include/hw/core/cpu.h | 12 --

[PATCH 4/5] monitor: removed cpustats command

2021-05-26 Thread Bruno Larsen (billionai)
Since ppc was the last architecture to collect these statistics and it is currently phasing this collection out, the command that would query this information is being removed. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- hmp-commands-info.hx | 13

[PATCH v4] target/ppc: overhauled and moved logic of storing fpscr

2021-05-27 Thread Bruno Larsen (billionai)
fpscr_set_rounding_mode into cpu.c as it could now be moved there, and it is needed when a value for the fpscr is being stored directly. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/cpu.c| 43 target/ppc

[PATCH] HMP: added cpustats to removed_features.rst

2021-05-27 Thread Bruno Larsen (billionai)
Documented the removal of the HMP command cpustats Signed-off-by: Bruno Larsen (billionai) --- docs/system/removed-features.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst index 5a462ac568..a88ff7aff4 100644 --- a

[PATCH v2] HMP: added info cpustats to removed_features.rst

2021-05-27 Thread Bruno Larsen (billionai)
Documented the removal of the HMP command info cpustats Signed-off-by: Bruno Larsen (billionai) --- docs/system/removed-features.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst index 5a462ac568..2feae41089 100644

[PATCH v2 0/2] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU

2021-05-27 Thread Bruno Larsen (billionai)
n's ppc-for-6.1 tree Changelog for v2: * removed patches that were already applied * also removed PPC_DUMP_CPU functinality Bruno Larsen (billionai) (2): target/ppc: removed GEN_OPCODE decision tree target/ppc: removed all mentions to PPC_DUMP_CPU target/p

[PATCH v2 1/2] target/ppc: removed GEN_OPCODE decision tree

2021-05-27 Thread Bruno Larsen (billionai)
since both, PPC_DO_STATISTICS and PPC_DUMP_CPU, are obsoleted as target/ppc moves to decodetree, we can remove this ifdef based decision tree, and only have what is now the standard option for the macro. Suggested-by: Luis Pires Signed-off-by: Bruno Larsen (billionai) --- target/ppc

[PATCH v2 2/2] target/ppc: removed all mentions to PPC_DUMP_CPU

2021-05-27 Thread Bruno Larsen (billionai)
This feature will no longer be useful as ppc moves to using decotree for TCG. And building with it enabled is no longer possible, due to changes in opc_handler_t. Since the last commit that mentions it happened in 2014, I think it is safe to remove it. Signed-off-by: Bruno Larsen (billionai

[PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU

2021-05-31 Thread Bruno Larsen (billionai)
n's ppc-for-6.1 tree Changelog for v3: * Re-added patch that removed cpu_dump_statistics from hw/core/cpu * added HMP documentation patch to this series Changelog for v2: * removed patches that were already applied * also removed PPC_DUMP_CPU functinality Bruno Larsen (billionai) (4):

[PATCH v3 1/4] hw/core/cpu: removed cpu_dump_statistics function

2021-05-31 Thread Bruno Larsen (billionai)
No more architectures set the pointer to dump_statistics, so there's no point in keeping it, or the related cpu_dump_statistics function. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) Message-Id: <20210526202104.127910-6-bruno.lar...@eldorado.org.br>

[PATCH v3 2/4] HMP: added info cpustats to removed_features.rst

2021-05-31 Thread Bruno Larsen (billionai)
Documented the removal of the HMP command info cpustats Signed-off-by: Bruno Larsen (billionai) --- docs/system/removed-features.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst index 5a462ac568..2feae41089 100644

[PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree

2021-05-31 Thread Bruno Larsen (billionai)
since both, PPC_DO_STATISTICS and PPC_DUMP_CPU, are obsoleted as target/ppc moves to decodetree, we can remove this ifdef based decision tree, and only have what is now the standard option for the macro. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/translate.c | 79

[PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU

2021-05-31 Thread Bruno Larsen (billionai)
This feature will no longer be useful as ppc moves to using decotree for TCG. And building with it enabled is no longer possible, due to changes in opc_handler_t. Since the last commit that mentions it happened in 2014, I think it is safe to remove it. Signed-off-by: Bruno Larsen (billionai

[RFC PATCH] target/ppc: removed usage of ppc_store_sdr1 in kvm.c

2021-06-01 Thread Bruno Larsen (billionai)
information, but since ppc_store_sdr1 would also store that information, there should be no need to do any extra processing here. Signed-off-by: Bruno Larsen (billionai) --- This change means we won't have to compile ppc_store_sdr1 when we get disable-tcg working, but I'm not worki

[RFC PATCH] target/ppc: fix address translation bug for hash table mmus

2021-06-02 Thread Bruno Larsen (billionai)
ere is more complex than necessary on purpose, to make it more readable (and make sure I understand what is going on). If that would really fix the problem, I'll move to implementing an actual solution, and to all affected functions. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu-ha

[PATCH v2 4/7] target/ppc: overhauled and moved logic of storing fpscr

2021-05-18 Thread Bruno Larsen (billionai)
fpscr_set_rounding_mode into cpu.c as it could now be moved there, and it is needed when a value for the fpscr is being stored directly. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c| 43 target/ppc/cpu.h| 12 +- target/ppc

[PATCH v2 7/7] target/ppc: wrapped some TCG only logic with ifdefs

2021-05-18 Thread Bruno Larsen (billionai)
Wrapped some function calls in cpu_init.c, gdbstub.c, mmu-hash64.c and excp_helper.c that were TCG only with ifdef CONFIG_TCG, to support building without TCG. for excp_helper we also moved the function do_rfi higher in the file to reduce the ifdef count. Signed-off-by: Bruno Larsen (billionai

[PATCH v2 0/7] target/ppc: Misc motion to support disabling TCG

2021-05-18 Thread Bruno Larsen (billionai)
compiles with linux-user * removed patches ther were already accepted * applied rth's cleanup to ppc_store_sdr1 * changed destination of ppc_store_msr * undone change to helper-proto, now fewer files include it Bruno Larsen (billionai) (7): target/ppc: fix ppc_store_sdr1 for user-only

[PATCH v2 3/7] target/ppc: reduce usage of fpscr_set_rounding_mode

2021-05-18 Thread Bruno Larsen (billionai)
It is preferable to store the current rounding mode and restore from that than recalculating from fpscr, so we changed the behavior of do_fri and VSX_ROUND to do it like that. Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/fpu_helper.c | 8 +--- 1

[PATCH v2 2/7] target/ppc: moved ppc_store_lpcr and ppc_store_msr to cpu.c

2021-05-18 Thread Bruno Larsen (billionai)
These functions are used in hw/ppc logic, during machine startup, which means it must be compiled when --disable-tcg is selected, and so it has been moved into a common code file Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson Reviewed-by: David Gibson --- target/ppc

[PATCH v2 6/7] target/ppc: moved ppc_cpu_do_interrupt to cpu.c

2021-05-18 Thread Bruno Larsen (billionai)
Moved the ppc_cpu_do_interrupt function to cpu.c file, where it makes more sense, and turned powerpc_excp not static, as it now needs to be accessed from outside of excp_helper.c Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c | 20 target/ppc/cpu.h

[PATCH v2 1/7] target/ppc: fix ppc_store_sdr1 for user-only compilation

2021-05-18 Thread Bruno Larsen (billionai)
ction. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c index 0ab7ac1af1..82e276349a 100644 --- a/target/ppc/cpu.c +++ b/target/ppc/cpu.c @@ -65,6 +65,7 @@ uint32_t ppc_get

[PATCH v2 5/7] target/ppc: removed unnecessary inclusion of helper-proto.h

2021-05-18 Thread Bruno Larsen (billionai)
These files included helper-proto.h, but didn't use or declare any helpers, so the #include has been removed Signed-off-by: Bruno Larsen (billionai) --- target/ppc/cpu_init.c| 1 - target/ppc/gdbstub.c | 1 - target/ppc/mmu-hash32.c | 1 - target/ppc/mmu-radix64.c | 1 - 4

[RFC PATCH 0/4] target/ppc: code motion to compile translate_init

2021-04-23 Thread Bruno Larsen (billionai)
The current patch series aims to isolate common code from translation-related code. This isolation is required to disable TCG at build time, and the final system still work. This patch series is still WIP, so comments are welcome Bruno Larsen (billionai) (4): target/ppc: move opcode table

[RFC PATCH 2/4] target/ppc: isolated SPR read/write callbacks

2021-04-23 Thread Bruno Larsen (billionai)
in progress, any better solutions are very much appreciated. Also, making the R/W functions not static is required for the next commit. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/spr_tcg.c.inc| 1002 +++ target/ppc/spr_tcg.h| 132

[RFC PATCH 1/4] target/ppc: move opcode table logic to translate.c

2021-04-23 Thread Bruno Larsen (billionai)
code motion to remove opcode callback table from translate_init.c.inc to translate.c in preparation to remove #include from translate.c Signed-off-by: Bruno Larsen (billionai) --- target/ppc/internal.h | 6 + target/ppc/translate.c | 394

[RFC PATCH 4/4] target/ppc: isolated cpu init from translation logic

2021-04-23 Thread Bruno Larsen (billionai)
finished isolation of CPU initialization logic from translation logic. CPU initialization now only has common code and may or may not call accelerator-specific code, as the build options require. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/{translate_init.c.inc => cpu_init.c} |

[PATCH v4] target/ppc: code motion from translate_init.c.inc to gdbstub.c

2021-04-26 Thread Bruno Larsen (billionai)
All the code related to gdb has been moved from translate_init.c.inc file to the gdbstub.c file, where it makes more sense. Version 4 fixes the omission of internal.h in gdbstub, mentioned in <87sg3d2gf5@linux.ibm.com>, and the extra blank line. Signed-off-by: Bruno Larsen (bil

[PATCH v2 0/7] target/ppc: untangle cpu init from translation

2021-04-29 Thread Bruno Larsen (billionai)
unnecessary * kept more functions as static * ensured that the project builds after every commit Bruno Larsen (billionai) (7): target/ppc: move opcode table logic to translate.c target/ppc: Created !TCG SPR registration macro target/ppc: Isolated SPR read/write callbacks target/ppc: tur

[PATCH v2 3/7] target/ppc: Isolated SPR read/write callbacks

2021-04-29 Thread Bruno Larsen (billionai)
spr_tcg.c.inc has to be included after SPR_NOACCESS has been used. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/internal.h |3 + target/ppc/spr_tcg.c.inc| 1033 +++ target/ppc/translate.c | 49 +- target/ppc/translate_init.c.inc | 981

[PATCH v2 4/7] target/ppc: turned SPR R/W callbacks not static

2021-04-29 Thread Bruno Larsen (billionai)
To be able to compile translate_init.c.inc as a standalone file, we have to make the callbacks accessible outside of translate.c; This patch does that, making the callbacks not static and creating a new .h file Signed-off-by: Bruno Larsen (billionai) --- target/ppc/spr_tcg.c.inc | 203

[PATCH v2 1/7] target/ppc: move opcode table logic to translate.c

2021-04-29 Thread Bruno Larsen (billionai)
code motion to remove opcode callback table from translate_init.c.inc to translate.c in preparation to remove the #include from translate.c. Also created destroy_ppc_opcodes and removed that logic from ppc_cpu_unrealize Signed-off-by: Bruno Larsen (billionai) --- target/ppc/internal.h

[PATCH v2 7/7] target/ppc: isolated cpu init from translation logic

2021-04-29 Thread Bruno Larsen (billionai)
finished isolation of CPU initialization logic from translation logic. CPU initialization now only has common code which may or may not call accelerator-specific code, as the build options require, and is compiled separately. Signed-off-by: Bruno Larsen (billionai) --- target/ppc

[PATCH v2 2/7] target/ppc: Created !TCG SPR registration macro

2021-04-29 Thread Bruno Larsen (billionai)
Added macros for spr_register and spr_register_kvm that can ignore SPR RW callbacks, in preparation to support building without TCG. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/translate_init.c.inc | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff

[PATCH v2 5/7] target/ppc: removed VSCR from SPR registration

2021-04-29 Thread Bruno Larsen (billionai)
-off-by: Bruno Larsen (billionai) --- target/ppc/translate_init.c.inc | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index f809941c5e..f470a8533e 100644 --- a/target/ppc/translate_init.c.inc

[PATCH v2 6/7] target/ttc: renamed SPR registration functions

2021-04-29 Thread Bruno Larsen (billionai)
Renamed all gen_spr_* and gen_* functions specifically related to registering SPRs to register_*_sprs and register_*, to avoid future confusion with other TCG related code. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/translate_init.c.inc | 860 1 file

[PATCH v3 1/7] target/ppc: Created !TCG SPR registration macro

2021-04-30 Thread Bruno Larsen (billionai)
moved RW callback parameters of _spr_register into an ifdef, to support building without TCG in the future, and added definitions for spr_register and spr_register_kvm, to keep the same call regardless of build options Signed-off-by: Bruno Larsen (billionai) --- target/ppc/translate_init.c.inc

[PATCH v3 2/7] target/ppc: Isolated SPR read/write callbacks

2021-04-30 Thread Bruno Larsen (billionai)
the project doesn't build Signed-off-by: Bruno Larsen (billionai) --- target/ppc/internal.h |3 + target/ppc/spr_tcg.c.inc| 1052 +++ target/ppc/translate.c | 47 +- target/ppc/translate_init.c.inc |

[PATCH v3 0/7] target/ppc: untangle CPU init from translation

2021-04-30 Thread Bruno Larsen (billionai)
ved a changed that would add a regression Changes for v2: * split and reordered patches, to make it easier to review * improved commit messages * Undid creation of spr_common, as it was unnecessary * kept more functions as static * ensured that the project builds after every commit Bruno L

[PATCH v3 3/7] target/ppc: remove unnecessary SPR functions

2021-04-30 Thread Bruno Larsen (billionai)
Removed functions gen_read_xer and gen_write_xer, moving their logic directly into spr_read_xer and spr_write_xer, respectively. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/spr_tcg.c.inc | 70 ++-- 1 file changed, 31 insertions(+), 39 deletions

[PATCH v3 4/7] target/ppc: turned SPR R/W callbacks not static

2021-04-30 Thread Bruno Larsen (billionai)
To be able to compile translate_init.c.inc as a standalone file, we have to make the callbacks accessible outside of translate.c; This patch does exactly that Signed-off-by: Bruno Larsen (billionai) --- target/ppc/spr_tcg.c.inc| 209 target/ppc/spr_tcg.h

[PATCH v3 6/7] target/ppc: renamed SPR registration functions

2021-04-30 Thread Bruno Larsen (billionai)
Renamed all gen_spr_* and gen_* functions specifically related to registering SPRs to register_*_sprs and register_*, to avoid future confusion with other TCG related code. Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/translate_init.c.inc | 860

[PATCH v3 5/7] target/ppc: removed VSCR from SPR registration

2021-04-30 Thread Bruno Larsen (billionai)
-off-by: Bruno Larsen (billionai) --- target/ppc/translate_init.c.inc | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index 67529e8648..b922b04f25 100644 --- a/target/ppc/translate_init.c.inc

[PATCH v3 7/7] target/ppc: isolated cpu init from translation logic

2021-04-30 Thread Bruno Larsen (billionai)
finished isolation of CPU initialization logic from translation logic. CPU initialization now only has common code and may or may not call accelerator-specific code, as the build options require. Signed-off-by: Bruno Larsen (billionai) --- target/ppc/{translate_init.c.inc => cpu_init.c}

[PATCH v4 1/5] target/ppc: Fold gen_*_xer into their callers

2021-05-04 Thread Bruno Larsen (billionai)
folded gen_{read,write}_xer into their only callers, spr_{read,write}_xer Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/translate.c | 37 - target/ppc/translate_init.c.inc | 33 +++-- 2

[PATCH v4 0/5] target/ppc: Untangle CPU init from translation

2021-05-04 Thread Bruno Larsen (billionai)
ved a changed that would add a regression Changes for v2: * split and reordered patches, to make it easier to review * improved commit messages * Undid creation of spr_common, as it was unnecessary * kept more functions as static * ensured that the project builds after every commit Bruno L

  1   2   >