Re: docs: minor typo fix for "lower(anymultirange)"

2024-04-24 Thread Richard Guo
s empty has no lower bound). > > is missing "or" and should be: > > > (NULL if the multirange is empty or has no lower bound). Good catch! I checked the descriptions for "upper(anymultirange)", "lower(anyrange)" and "upper(anyrange)", and they are all correct. We should fix this one. Thanks Richard

Re: Out going Phone Calls on my iPhone.

2024-04-24 Thread Richard Turner
That is very strange. It almost sounds like someone else also has your phone number. It might get to the point that you might have to have them change your number. But, I know that is beyond a royal pain. Richard, USA“Grandma always told us, “Be careful when you pray for patience. God stores

[PATCH 07/45] target/hppa: Add install_iaq_entries

2024-04-24 Thread Richard Henderson
Instead of two separate cpu_iaoq_entry calls, use one call to update both IAQ_Front and IAQ_Back. Simplify with an argument combination that automatically handles a simple increment from Front to Back. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 64

[PATCH 36/45] target/hppa: Manage PSW_X and PSW_B in translator

2024-04-24 Thread Richard Henderson
PSW_X is cleared after every instruction, and only set by RFI. PSW_B is cleared after every non-branch, or branch not taken, and only set by taken branches. We can clear both bits with a single store, at most once per TB. Taken branches set PSW_B, at most once per TB. Signed-off-by: Richard

[PATCH 29/45] target/hppa: Use delay_excp for conditional traps

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/helper.h | 1 - target/hppa/int_helper.c | 2 +- target/hppa/op_helper.c | 7 --- target/hppa/translate.c | 41 ++-- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/target/hppa

[PATCH 38/45] target/hppa: Implement PSW_X

2024-04-24 Thread Richard Henderson
Use PAGE_WRITE_INV to temporarily enable write permission on for a given page, driven by PSW_X being set. Signed-off-by: Richard Henderson --- target/hppa/mem_helper.c | 46 +++- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/target/hppa

[PATCH 45/45] target/hppa: Log cpu state on return-from-interrupt

2024-04-24 Thread Richard Henderson
Inverse of the logging on taking an interrupt. Signed-off-by: Richard Henderson --- target/hppa/sys_helper.c | 12 1 file changed, 12 insertions(+) diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 22d6c89964..9b43b556fd 100644 --- a/target/hppa/sys_helper.c

[PATCH 28/45] target/hppa: Introduce DisasDelayException

2024-04-24 Thread Richard Henderson
Allow an exception to be emitted at the end of the TranslationBlock, leaving only the conditional branch inline. Use it for simple exception instructions like break, which happen to be nullified. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 60

[PATCH 14/45] target/hppa: Add space argument to do_ibranch

2024-04-24 Thread Richard Henderson
This allows unification of BE, BLR, BV, BVE with a common helper. Since we can now track space with IAQ_Next, we can now let the TranslationBlock continue across the delay slot with BE, BVE. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 76

[PATCH 05/45] target/hppa: Allow prior nullification in do_ibranch

2024-04-24 Thread Richard Henderson
Simplify the function by not attempting a conditional move on the branch destination -- just use nullify_over normally. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 73 +++-- 1 file changed, 20 insertions(+), 53 deletions(-) diff --git

[PATCH 35/45] target/hppa: Split PSW X and B into their own field

2024-04-24 Thread Richard Henderson
Generally, both of these bits are cleared at the end of each instruction. By separating these, we will be able to clear both with a single insn, instead of 2 or 3. Signed-off-by: Richard Henderson --- target/hppa/cpu.h| 3 ++- target/hppa/helper.c | 6 +++--- 2 files changed, 5 insertions

[PATCH 43/45] target/hppa: Implement PSW_H, PSW_L

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/cpu.c | 4 +-- target/hppa/translate.c | 68 + 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 42c413211a..5adbe0fe9c 100644 --- a/target

[PATCH 11/45] target/hppa: Simplify TB end

2024-04-24 Thread Richard Henderson
Minimize the amount of code in hppa_tr_translate_insn advancing the insn queue for the next insn. Move the goto_tb path to hppa_tr_tb_stop. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 109 +--- 1 file changed, 57 insertions(+), 52

[PATCH 41/45] target/hppa: Implement CF_PCREL

2024-04-24 Thread Richard Henderson
overhead of compilation when running a Linux kernel with address space randomization enabled. Signed-off-by: Richard Henderson --- target/hppa/cpu.c | 19 ++-- target/hppa/translate.c | 68 - 2 files changed, 55 insertions(+), 32 deletions(-) diff

[PATCH 04/45] target/hppa: Pass displacement to do_dbranch

2024-04-24 Thread Richard Henderson
indirect branch instead, which is what we got out of the attempted direct branch anyway. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 33 + 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa

[PATCH 10/45] target/hppa: Skip nullified insns in unconditional dbranch path

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ac181180a6..6a73b1d409 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c

[PATCH 08/45] target/hppa: Add install_link

2024-04-24 Thread Richard Henderson
Add a common routine for writing the return address. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 54 +++-- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index cad33e7aa6

[PATCH 15/45] target/hppa: Use umax in do_ibranch_priv

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2ddaefde21..7e01c21141 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1980,7 +1980,7

[PATCH 37/45] target/hppa: Implement PSW_B

2024-04-24 Thread Richard Henderson
PSW_B causes B,GATE to trap as an illegal instruction, removing the sequential execution test that was merely an approximation. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 25 ++--- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/target/hppa

RE: Out going Phone Calls on my iPhone.

2024-04-24 Thread Richard Turner
Try doing a web search for the number to see if you can discover what it is. Richard, USA "It's no great honor to be blind, but it's more than a nuisance and less than a disaster. Either you're going to fight like hell when your sight fails or you're going to stand on the side

[PATCH 26/45] target/hppa: Use TCG_COND_TST* in trans_ftest

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4b9092b1cf..b1311e7688 100644 --- a/target/hppa/translate.c +++ b/target/hppa

[PATCH 25/45] target/hppa: Use registerfields.h for FPSR

2024-04-24 Thread Richard Henderson
Define all of the context dependent field definitions. Use FIELD_EX32 and FIELD_DP32 with named fields instead of extract32 and deposit32 with raw constants. Signed-off-by: Richard Henderson --- target/hppa/cpu.h| 25 + target/hppa/fpu_helper.c | 26

[PATCH 01/45] target/hppa: Move cpu_get_tb_cpu_state out of line

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 43 ++- target/hppa/cpu.c | 42 ++ 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index a072d0bb63

[PATCH 30/45] target/hppa: Use delay_excp for conditional trap on overflow

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/helper.h | 1 - target/hppa/int_helper.c | 2 +- target/hppa/op_helper.c | 7 --- target/hppa/translate.c | 21 + 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa

[PATCH 44/45] target/hppa: Log cpu state at interrupt

2024-04-24 Thread Richard Henderson
This contains all of the information logged before, plus more. Signed-off-by: Richard Henderson --- target/hppa/int_helper.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index b82f32fd12

[PATCH 42/45] target/hppa: Implement PSW_T

2024-04-24 Thread Richard Henderson
PSW_T enables a trap on taken branches, at the very end of the execution of the branch instruction. Signed-off-by: Richard Henderson --- target/hppa/cpu.c | 4 +-- target/hppa/translate.c | 55 +++-- 2 files changed, 44 insertions(+), 15 deletions

[PATCH 23/45] target/hppa: Use TCG_COND_TST* in do_unit_addsub

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index de510fddb1..38697ddfbd 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1418,8

[PATCH 32/45] target/hppa: Store full iaoq_f and page bits of iaoq_d in TB

2024-04-24 Thread Richard Henderson
difference in TB means that we have to store at least iaoq_b before goto_tb. But we since we'll need both updated before goto_tb for CF_PCREL, do that now. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 2 ++ target/hppa/cpu.c | 72 ++--- target

[PATCH 22/45] target/hppa: Use TCG_COND_TST* in do_unit_zero_cond

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1e772bef4d..de510fddb1 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1004,9 +1004,8

[PATCH 06/45] target/hppa: Use CF_BP_PAGE instead of cpu_breakpoint_test

2024-04-24 Thread Richard Henderson
The generic tcg driver will have already checked for breakpoints. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ceba7a98e5..dfdcb3e23c 100644

[PATCH 40/45] target/hppa: Adjust priv for B,GATE at runtime

2024-04-24 Thread Richard Henderson
Do not compile in the priv change based on the first translation; look up the PTE at execution time. Signed-off-by: Richard Henderson --- target/hppa/cpu.h| 1 - target/hppa/helper.h | 1 + target/hppa/mem_helper.c | 34 +++--- target/hppa/translate.c

[PATCH 18/45] target/hppa: Use displacements in DisasIAQE

2024-04-24 Thread Richard Henderson
This is a first step in enabling CF_PCREL, but for now we regenerate the absolute address before writeback. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 43 ++--- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/target/hppa

[PATCH 33/45] target/hppa: Do not mask in copy_iaoq_entry

2024-04-24 Thread Richard Henderson
As with loads and stores, code offsets are kept intact until the full gva is formed. In qemu, this is in cpu_get_tb_cpu_state. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/hppa/translate.c b/target

[PATCH 21/45] target/hppa: Use TCG_COND_TST* in do_log_cond

2024-04-24 Thread Richard Henderson
We can directly test bits of a 32-bit comparison without zero or sign-extending an intermediate result. We can directly test bit 0 for odd/even. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 78 ++--- 1 file changed, 27 insertions(+), 51

[PATCH 34/45] target/hppa: Improve hppa_cpu_dump_state

2024-04-24 Thread Richard Henderson
Print both raw IAQ_Front and IAQ_Back as well as the GVAs. Print control registers in system mode. Print floating point register if CPU_DUMP_FPU. Signed-off-by: Richard Henderson --- target/hppa/helper.c | 60 +++- 1 file changed, 54 insertions(+), 6

[PATCH 19/45] target/hppa: Rename cond_make_* helpers

2024-04-24 Thread Richard Henderson
cond_make -> cond_make_vv Pass 0 explictly, rather than implicitly in the function name. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/trans

[PATCH 24/45] target/hppa: Use TCG_COND_TST* in trans_bb_imm

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 38697ddfbd..c996eb9823 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c

[PATCH 27/45] target/hppa: Remove cond_free

2024-04-24 Thread Richard Henderson
no need for a special case anymore. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 102 +++- 1 file changed, 27 insertions(+), 75 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index b1311e7688..5714e2ad25 100644

[PATCH 39/45] target/hppa: Drop tlb_entry return from hppa_get_physical_address

2024-04-24 Thread Richard Henderson
The return-by-reference is never used. Signed-off-by: Richard Henderson --- target/hppa/cpu.h| 3 +-- target/hppa/int_helper.c | 2 +- target/hppa/mem_helper.c | 19 --- target/hppa/op_helper.c | 3 +-- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git

[PATCH 31/45] linux-user/hppa: Force all code addresses to PRIV_USER

2024-04-24 Thread Richard Henderson
The kernel does this along the return path to user mode. Signed-off-by: Richard Henderson --- linux-user/hppa/target_cpu.h | 4 ++-- target/hppa/cpu.h| 3 +++ linux-user/elfload.c | 4 ++-- linux-user/hppa/cpu_loop.c | 14 +++--- linux-user/hppa/signal.c

[PATCH 12/45] target/hppa: Add IASQ entries to DisasContext

2024-04-24 Thread Richard Henderson
Add variable to track space changes to IAQ. So far, no such changes are introduced, but the new checks vs ctx->iasq_b may eliminate an unnecessary copy to cpu_iasq_f with e.g. BLR. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 39 ++- 1 f

[PATCH 09/45] target/hppa: Delay computation of IAQ_Next

2024-04-24 Thread Richard Henderson
We no longer have to allocate a temp and perform an addition before translation of the rest of the insn. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/target/hppa/translate.c b/target

[PATCH 17/45] target/hppa: Introduce and use DisasIAQE for branch management

2024-04-24 Thread Richard Henderson
Wrap offset and space together in one structure, ensuring that they're copied together as required. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 378 +--- 1 file changed, 198 insertions(+), 180 deletions(-) diff --git a/target/hppa

[PATCH 03/45] target/hppa: Move constant destination check into use_goto_tb

2024-04-24 Thread Richard Henderson
Share this check between gen_goto_tb and hppa_tr_translate_insn. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 42fa480950..cb874e1c1e

[PATCH 13/45] target/hppa: Add space arguments to install_iaq_entries

2024-04-24 Thread Richard Henderson
Move space assighments to a central location. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 58 +++-- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 43a74dafcf

[PATCH 20/45] target/hppa: Use TCG_COND_TST* in do_cond

2024-04-24 Thread Richard Henderson
We can directly test bits of a 32-bit comparison without zero or sign-extending an intermediate result. We can directly test bit 0 for odd/even. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 64 ++--- 1 file changed, 28 insertions(+), 36

[PATCH 00/45] target/hppa: Misc improvements

2024-04-24 Thread Richard Henderson
there's something wrong there, but that's right at the end of the patch set. So I'd like some feedback on the rest leading up to that too. r~ Richard Henderson (45): target/hppa: Move cpu_get_tb_cpu_state out of line target/hppa: Use hppa_form_gva_psw in hppa_cpu_get_pc target/hppa: Move

[PATCH 16/45] target/hppa: Always make a copy in do_ibranch_priv

2024-04-24 Thread Richard Henderson
This simplifies callers, which might otherwise have to make another copy. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 7e01c21141..dd5193cb6a 100644

[PATCH 02/45] target/hppa: Use hppa_form_gva_psw in hppa_cpu_get_pc

2024-04-24 Thread Richard Henderson
This function is for log_pc(), which needs to produce a similar result to cpu_get_tb_cpu_state(). Signed-off-by: Richard Henderson --- target/hppa/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1d5f5086bf..7315567910

[PATCH 2/5] target/alpha: Hoist branch shift to initial decode

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index a97cd54f0c..52c2e6248b 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -432,7

[PATCH 1/5] target/alpha: Use cpu_env in preference to ALPHA_CPU

2024-04-24 Thread Richard Henderson
ALPHA_CPU has a dynamic object type assert, which is unnecessary considering that these are all class hooks. Signed-off-by: Richard Henderson --- target/alpha/cpu.c| 15 ++- target/alpha/helper.c | 8 2 files changed, 10 insertions(+), 13 deletions(-) diff --git

[PATCH 0/5] target/alpha: Implement CF_PCREL

2024-04-24 Thread Richard Henderson
Implement pc-relative tcg code generation. r~ Richard Henderson (5): target/alpha: Use cpu_env in preference to ALPHA_CPU target/alpha: Hoist branch shift to initial decode target/alpha: Split out gen_goto_tb target/alpha: Split out gen_pc_disp target/alpha: Implement CF_PCREL target

[PATCH 5/5] target/alpha: Implement CF_PCREL

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/cpu.c | 23 ++- target/alpha/translate.c | 29 + 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index f98d022671..0e2fbcb397 100644

[PATCH 4/5] target/alpha: Split out gen_pc_disp

2024-04-24 Thread Richard Henderson
Prepare for pcrel by not modifying cpu_pc before use, in the case of JSR. Signed-off-by: Richard Henderson --- target/alpha/translate.c | 41 ++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha

[PATCH 3/5] target/alpha: Split out gen_goto_tb

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/translate.c | 61 ++-- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 52c2e6248b..c1a55e5153 100644 --- a/target/alpha/translate.c

[PATCH v2 13/33] plugins: Use DisasContextBase for qemu_plugin_insn_haddr

2024-04-24 Thread Richard Henderson
We can delay the computation of haddr until the plugin actually requests it. Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 4 accel/tcg/plugin-gen.c | 20 plugins/api.c | 25 - 3 files changed, 24 insertions(+), 25

[PATCH v2 07/33] accel/tcg: Record when translator_fake_ldb is used

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/exec/translator.h | 3 ++- accel/tcg/translator.c| 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/exec/translator.h b/include/exec/translator.h index 974cc4f9c4..e92dfba035 100644 --- a/include/exec/translator.h +++ b

[PATCH v2 18/33] disas: Split disas.c

2024-04-24 Thread Richard Henderson
The routines in disas-common.c are also used from disas-mon.c. Otherwise the rest of disassembly is only used from tcg. While we're at it, put host and target code into separate files. Signed-off-by: Richard Henderson --- disas/disas-internal.h | 4 + include/disas/disas.h | 4 + disas

[PATCH v2 02/33] accel/tcg: Hide in_same_page outside of a target-specific context

2024-04-24 Thread Richard Henderson
While there are other methods that could be used to replace TARGET_PAGE_MASK, the function is not really required outside the context of target-specific translation. This makes the header usable by target independent code. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson

[PATCH v2 11/33] plugins: Use translator_st for qemu_plugin_insn_data

2024-04-24 Thread Richard Henderson
Use the bytes that we record for the entire TB, rather than a per-insn GByteArray. Record the length of the insn in plugin_gen_insn_end rather than infering from the length of the array. Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 14 +- accel/tcg/plugin-gen.c

[PATCH v2 06/33] accel/tcg: Record mmio bytes during translation

2024-04-24 Thread Richard Henderson
This will be able to replace plugin_insn_append, and will be usable for disassembly. Signed-off-by: Richard Henderson --- include/exec/translator.h | 12 accel/tcg/translator.c| 41 +++ 2 files changed, 53 insertions(+) diff --git a/include

[PATCH v2 09/33] plugins: Copy memory in qemu_plugin_insn_data

2024-04-24 Thread Richard Henderson
Instead of returning a host pointer, copy the data into storage provided by the caller. Signed-off-by: Richard Henderson --- include/qemu/qemu-plugin.h | 15 +++ contrib/plugins/execlog.c | 5 +++-- contrib/plugins/howvec.c | 4 ++-- plugins/api.c | 7 +-- 4

[PATCH v2 29/33] target/riscv: Use translator_ld* for everything

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/riscv/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index c999e942e1..2c27fd4ce1 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -20,7

[PATCH v2 28/33] target/cris: Use cris_fetch in translate_v10.c.inc

2024-04-24 Thread Richard Henderson
Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/cris/translate.c | 1 - target/cris/translate_v10.c.inc | 30 +- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/target/cris

[PATCH v2 00/33] accel/tcg: Improve disassembly for target and plugin

2024-04-24 Thread Richard Henderson
e-EXECUTEd-instructions.patch 23-target-hexagon-Use-translator_ldl-in-pkt_crosses_.patch 29-target-riscv-Use-translator_ld-for-everything.patch 32-target-s390x-Use-translator_lduw-in-get_next_pc.patch r~ Philippe Mathieu-Daudé (1): accel/tcg: Remove cpu_ldsb_code / cpu_ldsw_code Richard

[PATCH v2 31/33] target/xtensa: Use translator_ldub in xtensa_insn_len

2024-04-24 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 42109d33ad..75b7bfda4c 100644 --- a/target/xtensa/translate.c

[PATCH v2 03/33] accel/tcg: Pass DisasContextBase to translator_fake_ldb

2024-04-24 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h| 5 +++-- accel/tcg/translator.c | 2 +- target/s390x/tcg/translate.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/exec/translator.h b/include/exec

[PATCH v2 17/33] accel/tcg: Return bool from TranslatorOps.disas_log

2024-04-24 Thread Richard Henderson
We have eliminated most uses of this hook. Reduce further by allowing the hook to handle only the special cases, returning false for normal processing. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h| 2 +- accel/tcg/translator.c

[PATCH v2 01/33] accel/tcg: Use vaddr in translator_ld*

2024-04-24 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h | 18 +- accel/tcg/translator.c| 15 --- target/hexagon/translate.c| 1 + target/microblaze/translate.c | 1 + 4 files changed, 19 insertions(+), 16

[PATCH v2 14/33] plugins: Use DisasContextBase for qemu_plugin_tb_vaddr

2024-04-24 Thread Richard Henderson
We do not need to separately record the start of the TB. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 1 - accel/tcg/plugin-gen.c | 3 +-- plugins/api.c | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include

[PATCH v2 12/33] plugins: Read mem_only directly from TB cflags

2024-04-24 Thread Richard Henderson
Do not pass around a boolean between multiple structures, just read it from the TranslationBlock in the TCGContext. Signed-off-by: Richard Henderson --- include/exec/plugin-gen.h | 7 +++ include/qemu/plugin.h | 3 --- accel/tcg/plugin-gen.c| 4 +--- accel/tcg/translator.c

[PATCH v2 33/33] accel/tcg: Remove cpu_ldsb_code / cpu_ldsw_code

2024-04-24 Thread Richard Henderson
From: Philippe Mathieu-Daudé Previous commits replaced them by translator_ld* calls. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240405131532.40913-1-phi...@linaro.org> Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 10 -- 1 file changed, 10 del

[PATCH v2 20/33] accel/tcg: Introduce translator_fake_ld

2024-04-24 Thread Richard Henderson
Replace translator_fake_ldb, which required multiple calls, with translator_fake_ld, which can take all data at once. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h| 8 accel/tcg/translator.c | 5 ++--- target/s390x/tcg

[PATCH v2 25/33] target/i386: Use translator_ldub for everything

2024-04-24 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 6658adc4bc..6f04a77eed 100644 --- a/target/i386/tcg

[PATCH v2 32/33] target/s390x: Use translator_lduw in get_next_pc

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index bac033c63c..ebd96abe6c 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg

[PATCH v2 08/33] accel/tcg: Record DisasContextBase in tcg_ctx for plugins

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 + accel/tcg/plugin-gen.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 135e36d729..2a1c080bab 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -537,6 +537,7 @@ struct

[PATCH v2 16/33] accel/tcg: Provide default implementation of disas_log

2024-04-24 Thread Richard Henderson
Almost all of the disas_log implementations are identical. Unify them within translator_loop. Drop extra Priv/Virt logging from target/riscv. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 9 - target/alpha/translate.c

[PATCH v2 30/33] target/rx: Use translator_ld*

2024-04-24 Thread Richard Henderson
Reviewed-by: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/rx/translate.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 92fb2b43ad

[PATCH v2 04/33] accel/tcg: Reorg translator_ld*

2024-04-24 Thread Richard Henderson
as it is within the first page. Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 189 ++--- 1 file changed, 101 insertions(+), 88 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 92eb77c3a0..dbd54e25a2 100644 --- a/accel

[PATCH v2 15/33] plugins: Merge alloc_tcg_plugin_context into plugin_gen_tb_start

2024-04-24 Thread Richard Henderson
We don't need to allocate plugin context at startup, we can wait until we actually use it. Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 36 tcg/tcg.c | 11 --- 2 files changed, 20 insertions(+), 27 deletions(-) diff

[PATCH v2 24/33] target/microblaze: Use translator_ldl

2024-04-24 Thread Richard Henderson
Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 08d98dab07..bac7e30cd1

[PATCH v2 10/33] accel/tcg: Implement translator_st

2024-04-24 Thread Richard Henderson
Copy data out of a completed translation. This will be used for both plugins and disassembly. Signed-off-by: Richard Henderson --- include/exec/translator.h | 23 accel/tcg/translator.c| 55 +++ 2 files changed, 78 insertions(+) diff

[PATCH v2 27/33] target/cris: Use translator_ld* in cris_fetch

2024-04-24 Thread Richard Henderson
Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/cris/translate.c | 25 - 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index b5410189d4

[PATCH v2 22/33] target/s390x: Disassemble EXECUTEd instructions

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 95d4d6ebc3..bac033c63c 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg

[PATCH v2 19/33] disas: Use translator_st to get disassembly data

2024-04-24 Thread Richard Henderson
Read from already translated pages, or saved mmio data. Signed-off-by: Richard Henderson --- include/disas/disas.h | 5 +++-- include/exec/translator.h | 4 ++-- include/qemu/typedefs.h | 1 + accel/tcg/translator.c| 2 +- disas/disas-common.c | 14 -- disas/disas

[PATCH v2 21/33] target/s390x: Fix translator_fake_ld length

2024-04-24 Thread Richard Henderson
The ilen value extracted from ex_value is the length of the EXECUTE instruction itself, and so is the increment to the pc. However, the length of the synthetic insn is located in the opcode like all other instructions. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 4

[PATCH v2 26/33] target/avr: Use translator_lduw

2024-04-24 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/avr/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index 6df93d4c77..2d51892115 100644 --- a/target/avr/translate.c +++ b/target/avr

[PATCH v2 05/33] accel/tcg: Cap the translation block when we encounter mmio

2024-04-24 Thread Richard Henderson
Do not allow translation to proceed beyond one insn with mmio, as we will not be caching the TranslationBlock. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 4 1 file changed, 4 insertions(+) diff --git a/accel/tcg/translator.c b/accel

[PATCH v2 23/33] target/hexagon: Use translator_ldl in pkt_crosses_page

2024-04-24 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hexagon/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 1344a3e4ab..37dec8b5c5 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c

Re: [PATCH 0/5] target/arm: Update emulation.rst, add some easy features

2024-04-24 Thread Richard Henderson
for -cpu max Reviewed-by: Richard Henderson r~

[PATCH v3 07/20] plugins: Use emit_before_op for PLUGIN_GEN_FROM_TB

2024-04-24 Thread Richard Henderson
By having the qemu_plugin_cb_flags be recorded in the TCGHelperInfo, we no longer need to distinguish PLUGIN_CB_REGULAR from PLUGIN_CB_REGULAR_R, so place all TB callbacks in the same queue. Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 96

[PATCH v3 15/20] plugins: Introduce PLUGIN_CB_MEM_REGULAR

2024-04-24 Thread Richard Henderson
Use different enumerators for vcpu_udata and vcpu_mem callbacks. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 1 + accel/tcg/plugin-gen.c | 2 +- plugins/core.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH v3 01/20] tcg: Make tcg/helper-info.h self-contained

2024-04-24 Thread Richard Henderson
Move MAX_CALL_IARGS from tcg.h and include for the define of TCG_TARGET_REG_BITS. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/tcg/helper-info.h | 3 +++ include/tcg/tcg.h | 2 -- tcg/tci.c | 1 + 3 files changed, 4 insertions(+), 2 deletions

[PATCH v3 18/20] plugins: Merge qemu_plugin_tb_insn_get to plugin-gen.c

2024-04-24 Thread Richard Henderson
Merge qemu_plugin_insn_alloc and qemu_plugin_tb_insn_get into plugin_gen_insn_start, since it is used nowhere else. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 39 --- accel/tcg/plugin-gen.c | 39

[PATCH v3 17/20] plugins: Split out common cb expanders

2024-04-24 Thread Richard Henderson
Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 84 +- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 49d9b07438..5b63b93114 100644

[PATCH v3 19/20] plugins: Inline plugin_gen_empty_callback

2024-04-24 Thread Richard Henderson
Each caller can use tcg_gen_plugin_cb directly. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index c0cbc26984

[PATCH v3 06/20] plugins: Use emit_before_op for PLUGIN_GEN_AFTER_INSN

2024-04-24 Thread Richard Henderson
Introduce a new plugin_cb op and migrate one operation. By using emit_before_op, we do not need to emit opcodes early and modify them later -- we can simply emit the final set of opcodes once. Signed-off-by: Richard Henderson --- include/tcg/tcg-op-common.h | 1 + include/tcg/tcg-opc.h

[PATCH v3 00/20] Rewrite plugin code generation

2024-04-24 Thread Richard Henderson
Patches 6 & 7 still lack review. Changes for v3: - Rebase. r~ Richard Henderson (20): tcg: Make tcg/helper-info.h self-contained tcg: Pass function pointer to tcg_gen_call* plugins: Zero new qemu_plugin_dyn_cb entries plugins: Move function pointer in qemu_plugin_dyn_cb plu

[PATCH v3 16/20] plugins: Replace pr_ops with a proper debug dump flag

2024-04-24 Thread Richard Henderson
The DEBUG_PLUGIN_GEN_OPS ifdef is replaced with "-d op_plugin". The second pr_ops call can be obtained with "-d op". Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- include/qemu/log.h | 1 + include/tcg/tcg.h | 1 + accel/t

[PATCH v3 20/20] plugins: Update the documentation block for plugin-gen.c

2024-04-24 Thread Richard Henderson
Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 31 --- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index d914d64de0..3db74ae9bf 100644 --- a/accel/tcg

  1   2   3   4   5   6   7   8   9   10   >