[RFC PATCH v2 2/2] target/ppc: make gdb able to translate priviledged addresses

2021-06-14 Thread Bruno Larsen (billionai)
it is an RFC. Suggested-by: Fabiano Rosas Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu_helper.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index 9dcdf88597..41c727c690 100644 --- a/target/ppc

[PATCH v2 1/2] target/ppc: fix address translation bug for radix mmus

2021-06-14 Thread Bruno Larsen (billionai)
orrect mmmu_idx when calling get_phys_page_debug, otherwise we might not be able to see the memory that the CPU could Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/internal.h| 12 target/ppc/mmu-radix64.

[PATCH v3] target/ppc: fix address translation bug for radix mmus

2021-06-16 Thread Bruno Larsen (billionai)
mu_idx when calling get_phys_page_debug, otherwise we might not be able to see the memory that the CPU could Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu-book3s-v3.h | 8 target/ppc/mmu-radix64.c

[PATCH v2 05/10] target/ppc: Split out ppc_hash64_xlate

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson Mirror the interface of ppc_radix64_xlate, putting all of the logic for hash64 translation into a single function. Signed-off-by: Richard Henderson --- target/ppc/mmu-hash64.c | 125 +++- 1 file changed, 59 insertions(+), 66

[PATCH v2 02/10] target/ppc: Use MMUAccessType with *_handle_mmu_fault

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson These changes were waiting until we didn't need to match the function type of PowerPCCPUClass.handle_mmu_fault. Signed-off-by: Richard Henderson --- target/ppc/mmu-hash32.c | 7 ++- target/ppc/mmu-hash32.h | 4 ++-- target/ppc/mmu-hash64.c | 6 +-

[PATCH v2 08/10] target/ppc: Introduce ppc_xlate

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson Create one common dispatch for all of the ppc_*_xlate functions. Use ppc64_v3_radix to directly dispatch between ppc_radix64_xlate and ppc_hash64_xlate. Remove the separate *_handle_mmu_fault and *_get_phys_page_debug functions, using common code for ppc_cpu_tlb_fill and

[PATCH v2 10/10] target/ppc: fix address translation bug for radix mmus

2021-06-21 Thread Bruno Larsen (billionai)
there to document the issue, in case a machine does have that and was missed. As part of this cleanup, we now need to send the correct mmmu_idx when calling get_phys_page_debug, otherwise we might not be able to see the memory that the CPU could Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen

[PATCH v2 01/10] target/ppc: Remove PowerPCCPUClass.handle_mmu_fault

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson Instead, use a switch on env->mmu_model. This avoids some replicated information in cpu setup. Signed-off-by: Richard Henderson --- target/ppc/cpu-qom.h| 1 - target/ppc/cpu_init.c | 45 - target/ppc/mmu_helper.c | 24

[PATCH v2 00/10] Clean up MMU translation

2021-06-21 Thread Bruno Larsen (billionai)
, but agreed is a good cleanup either way. Changes for v2: * rebased on ppc-for-6.1 * added the bugfix Bruno Larsen (billionai) (1): target/ppc: fix address translation bug for radix mmus Richard Henderson (9): target/ppc: Remove PowerPCCPUClass.handle_mmu_fault target/ppc: Use MMUAccessType

[PATCH v2 04/10] target/ppc: Use bool success for ppc_radix64_xlate

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson Instead of returning non-zero for failure, return true for success. Signed-off-by: Richard Henderson --- target/ppc/mmu-radix64.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/target/ppc/mmu-radix64.c

[PATCH v2 09/10] target/ppc: Restrict ppc_cpu_tlb_fill to TCG

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson This function is used by TCGCPUOps, and is thus TCG specific. Signed-off-by: Richard Henderson --- target/ppc/mmu_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index a0e4e027d3..ba1952c77d 100644 ---

[PATCH v2 03/10] target/ppc: Push real-mode handling into ppc_radix64_xlate

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson This removes some incomplete duplication between ppc_radix64_handle_mmu_fault and ppc_radix64_get_phys_page_debug. The former was correct wrt SPR_HRMOR and the latter was not. Signed-off-by: Richard Henderson --- target/ppc/mmu-radix64.c | 77

[PATCH v2 07/10] target/ppc: Split out ppc_jumbo_xlate

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson Mirror the interface of ppc_radix64_xlate (mostly), putting all of the logic for older mmu translation into a single entry point. For booke, we need to add mmu_idx to the xlate-style interface. Signed-off-by: Richard Henderson --- target/ppc/mmu_helper.c | 179

[PATCH v2 06/10] target/ppc: Split out ppc_hash32_xlate

2021-06-21 Thread Bruno Larsen (billionai)
From: Richard Henderson Mirror the interface of ppc_radix64_xlate, putting all of the logic for hash32 translation into a single entry point. Signed-off-by: Richard Henderson --- target/ppc/mmu-hash32.c | 224 1 file changed, 113 insertions(+), 111

[PATCH v3 1/3] target/ppc: fix address translation bug for radix mmus

2021-06-24 Thread Bruno Larsen (billionai)
to see the memory that the CPU could Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/mmu-book3s-v3.h | 13 + target/ppc/mmu-radix64.c | 37 + target/ppc/mmu-radix64.h | 2

[PATCH v3 3/3] target/ppc: changed ppc_hash64_xlate to use mmu_idx

2021-06-24 Thread Bruno Larsen (billionai)
Changed hash64 address translation to use the supplied mmu_idx instead of using the one stored in the msr, for parity purposes (other book3s MMUs already use it). Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu-hash64.c | 43 - target/ppc/mmu

[PATCH v3 0/3] Clean up MMU translation

2021-06-24 Thread Bruno Larsen (billionai)
* fixed comments on last patch * added 2 new patches Changes for v2: * rebase on ppc-for-6.1 * added the bugfix Bruno Larsen (billionai) (3): target/ppc: fix address translation bug for radix mmus target/ppc: change ppc_hash32_xlate to use mmu_idx target/ppc: changed ppc_hash64_xlate to use

[PATCH v3 2/3] target/ppc: change ppc_hash32_xlate to use mmu_idx

2021-06-24 Thread Bruno Larsen (billionai)
Changed hash32 address translation to use the supplied mmu_idx, instead of using what was stored in the msr, for parity purposes (radix64 already uses that). Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu-hash32.c | 18 +- target/ppc/mmu-hash32.h | 2 +- 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)
-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 compilation target/ppc

[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 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 files

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

2021-05-18 Thread Bruno Larsen (billionai)
. 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_vscr

[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 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

[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

[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 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

[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)
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 insertions(+) create

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

2021-05-12 Thread Bruno Larsen (billionai)
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_init.c

[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 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 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,

[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 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 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 v5 3/4] target/ppc: created tcg-stub.c file

2021-05-25 Thread Bruno Larsen (billionai)
. 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.build index

[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 2/4] target/ppc: added ifdefs around TCG-only code

2021-05-25 Thread Bruno Larsen (billionai)
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 | 11

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

2021-05-25 Thread Bruno Larsen (billionai)
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 deletions

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

2021-05-25 Thread Bruno Larsen (billionai)
mpiles 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 registeri

[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 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

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

2021-05-31 Thread Bruno Larsen (billionai)
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): hw/core/cpu: removed

[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> Re

[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

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

2021-06-02 Thread Bruno Larsen (billionai)
d here 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-hash64.

[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 7/9] target/ppc: Added options to disable many TCG-only functions

2021-05-21 Thread Bruno Larsen (billionai)
will 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 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 0/9] target/ppc: add support to disable-tcg

2021-05-21 Thread Bruno Larsen (billionai)
cepted * 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_store_msr to cpu.c

[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 8/9] target/ppc: created tcg-stub.c file

2021-05-21 Thread Bruno Larsen (billionai)
. 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..848e625302

[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 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/ppc/mmu

[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

[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)
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/ppc/cpu_init.c | 205

[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 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 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 --git

[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 2

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

2021-05-26 Thread Bruno Larsen (billionai)
-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 @@ typedef

[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/target/ppc

[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 targ

[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 0/5] target/ppc: add support to disable-tcg

2021-05-24 Thread Bruno Larsen (billionai)
e_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 code targ

[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 3/5] target/ppc: added ifdefs around TCG-only code

2021-05-24 Thread Bruno Larsen (billionai)
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 | 11

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

2021-05-24 Thread Bruno Larsen (billionai)
. 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.build index

[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

[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 working

[PATCH v5 1/2] target/ppc: introduce mmu-books.h

2021-07-06 Thread Bruno Larsen (billionai)
Intrudoce a header common to all BookS MMUs, that can hold code that is common to hash32 and book3s-v3 MMUs. Suggested-by: David Gibson Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu-book3s-v3.h | 14 +- target/ppc/mmu-books.h | 30 ++ 2

[PATCH v5 2/2] target/ppc: change ppc_hash32_xlate to use mmu_idx

2021-07-06 Thread Bruno Larsen (billionai)
that the mmu_idx stored in the CPU variable will not desync. Signed-off-by: Bruno Larsen (billionai) Reviewed-by: David Gibson --- target/ppc/mmu-hash32.c | 40 +++- target/ppc/mmu-hash32.h | 2 +- target/ppc/mmu_helper.c | 2 +- 3 files changed, 21 insertions(+), 23

[PATCH v5 0/2] Clean up MMU translation

2021-07-06 Thread Bruno Larsen (billionai)
patches Changes for v2: * rebase on ppc-for-6.1 * added the bugfix Bruno Larsen (billionai) (2): target/ppc: introduce mmu-books.h target/ppc: change ppc_hash32_xlate to use mmu_idx target/ppc/mmu-book3s-v3.h | 14 + target/ppc/mmu-books.h | 30

[PATCH v4 0/3] Clean up MMU translation

2021-06-28 Thread Bruno Larsen (billionai)
message of the first patch * removed function parameters that were no longer used Changes for v3: * removed patches that were already applied * fixed comments on last patch * added 2 new patches Changes for v2: * rebase on ppc-for-6.1 * added the bugfix Bruno Larsen (billionai) (3): target/ppc

[PATCH v4 1/3] target/ppc: fix address translation bug for radix mmus

2021-06-28 Thread Bruno Larsen (billionai)
need to send the correct mmmu_idx when calling get_phys_page_debug, otherwise we might not be able to see the memory that the CPU could Suggested-by: Richard Henderson Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Tested-by: Cédric Le

[PATCH v4 3/3] target/ppc: changed ppc_hash64_xlate to use mmu_idx

2021-06-28 Thread Bruno Larsen (billionai)
Changed hash64 address translation to use the supplied mmu_idx instead of using the one stored in the msr, for parity purposes (other book3s MMUs already use it). Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson --- target/ppc/mmu-hash64.c | 43

[PATCH v4 2/3] target/ppc: change ppc_hash32_xlate to use mmu_idx

2021-06-28 Thread Bruno Larsen (billionai)
Changed hash32 address translation to use the supplied mmu_idx, instead of using what was stored in the msr, for parity purposes (radix64 already uses that). Signed-off-by: Bruno Larsen (billionai) --- target/ppc/mmu-hash32.c | 40 +++- target/ppc/mmu-hash32

[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 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 3/7] target/ppc: Isolated SPR read/write callbacks

2021-04-29 Thread Bruno Larsen (billionai)
, as 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 0/7] target/ppc: untangle cpu init from translation

2021-04-29 Thread Bruno Larsen (billionai)
essary * 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: turned S

[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 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 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 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 | 981

[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

  1   2   >