[PATCH v1] vhost-vdpa : add support for vIOMMU

2022-10-05 Thread Cindy Lu
Add support for vIOMMU. Register a memory listener to dma_as in vhost_vdpa_dev_start - during region_add register a specific IOMMU notifier, and store all notifiers in a list. - during region_del, compare and delete the IOMMU notifier from the list - also change the IOTLB batch flag to support IOM

[PATCH 19/26] target/s390x: Simplify help_branch

2022-10-05 Thread Richard Henderson
Always use a tcg branch, instead of movcond. The movcond was not a bad idea before PER was added, but since then we have either 2 or 3 actions to perform on each leg of the branch, and multiple movcond is inefficient. Reorder the taken branch to be fallthrough of the tcg branch. This will be help

[PATCH 26/26] target/s390x: Enable TARGET_TB_PCREL

2022-10-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/s390x/cpu-param.h | 1 + target/s390x/cpu.c | 12 + target/s390x/tcg/translate.c | 88 +++- 3 files changed, 69 insertions(+), 32 deletions(-) diff --git a/target/s390x/cpu-param.h b/target/s390x/cpu-p

[PATCH 18/26] target/s390x: Split per_branch

2022-10-05 Thread Richard Henderson
Split into per_branch_dest and per_branch_disp, which can be used for direct and indirect. In preperation for TARGET_TB_PCREL, call per_branch_* before indirect branches. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 32 ++-- 1 file changed, 18

[PATCH 21/26] target/s390x: Remove PER check from use_goto_tb

2022-10-05 Thread Richard Henderson
While it is common for the PC update to happen in the shadow of a goto_tb, it is not required to be there. By moving it before the goto_tb, we can also place the call to helper_per_branch there, and then afterward chain to the next tb. Signed-off-by: Richard Henderson --- target/s390x/tcg/transl

[PATCH 23/26] tcg: Pass TCGTempKind to tcg_temp_new_internal

2022-10-05 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 14 +++--- tcg/tcg.c | 20 +++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index d84bae6e3f..e01a47ec20 100644

[PATCH 22/26] target/s390x: Pass original r2 register to BCR

2022-10-05 Thread Richard Henderson
We do not modify any general-purpose registers in BCR, which means that we may be able to avoid saving the value across a branch. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 10 ++ target/s390x/tcg/insn-data.def | 2 +- 2 files changed, 11 insertions(+), 1 dele

[PATCH 20/26] target/s390x: Split per_breaking_event from per_branch_*

2022-10-05 Thread Richard Henderson
This allows us to update gbea before other updates to psw_addr, which will be important for TARGET_TB_PCREL. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tc

[PATCH 16/26] target/s390x: Disable conditional branch-to-next for PER

2022-10-05 Thread Richard Henderson
For PER, we require a conditional call to helper_per_branch for the conditional branch. Fold the remaining optimization into a call to helper_goto_direct, which will take care of the remaining gbea adjustment. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 13 ++---

[PATCH 24/26] tcg: Introduce tcg_temp_ebb_new_*

2022-10-05 Thread Richard Henderson
Allow targets to allocate extended-basic-block temps. Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 2 ++ include/tcg/tcg.h| 20 +++- tcg/tcg.c| 16 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/tcg/tcg-op

[PATCH 13/26] target/s390x: Add disp argument to update_psw_addr

2022-10-05 Thread Richard Henderson
Rename to update_psw_addr_disp at the same time. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 9ee8146b87..a20c3bc4f0

[PATCH 17/26] target/s390x: Introduce help_goto_indirect

2022-10-05 Thread Richard Henderson
Add a small helper to handle unconditional indirect jumps. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index fc6b04e23e..712f

[PATCH 25/26] tcg: Introduce tcg_temp_is_normal_*

2022-10-05 Thread Richard Henderson
Allow targets to determine if a given temp will die across a branch. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 2 ++ include/tcg/tcg.h| 15 +++ 2 files changed, 17 insertions(+) diff --git a/include/tcg/tcg-op.h b/include/t

[PATCH 07/26] target/s390x: Remove pc argument to pc_to_link_into

2022-10-05 Thread Richard Henderson
All callers pass s->pc_tmp. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 47a9d87416..7c98a72d

[PATCH 00/26] target/s390x: pc-relative translation blocks

2022-10-05 Thread Richard Henderson
This is the S390 specific changes required to reduce the amount of translation for address space randomization. Begin with some generic cleanups, then prepare by using displacements instead of addresses when possible, then add some tcg infrastructure to avoid a code gen ugly, then finalize the con

[PATCH 08/26] target/s390x: Use gen_psw_addr_disp in pc_to_link_info

2022-10-05 Thread Richard Henderson
This is slightly more complicated that a straight displacement for 31 and 24-bit modes. Dont bother with a cant-happen assert. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/target/s390

[PATCH 15/26] target/s390x: Introduce per_enabled

2022-10-05 Thread Richard Henderson
Hoist the test of FLAG_MASK_PER to a helper. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 868895b9ae..cd311b4b2a 100

[PATCH 11/26] target/s390x: Use ilen instead in branches

2022-10-05 Thread Richard Henderson
Remove the remaining uses of pc_tmp, and remove the variable. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 2ea3feb803..67c8699

[PATCH 12/26] target/s390x: Move masking of psw.addr to cpu_get_tb_cpu_state

2022-10-05 Thread Richard Henderson
Masking after the fact in s390x_tr_init_disas_context provides incorrect information to tb_lookup. Signed-off-by: Richard Henderson --- target/s390x/cpu.h | 13 +++-- target/s390x/tcg/translate.c | 6 -- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/targe

[PATCH 14/26] target/s390x: Don't set gbea for user-only

2022-10-05 Thread Richard Henderson
The rest of the per_* functions have this ifdef; this one seemed to be missing. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index a20c3bc4f0..868895b9ae 100644

[PATCH 02/26] target/s390x: Use tcg_constant_* for DisasCompare

2022-10-05 Thread Richard Henderson
The a and b fields are not modified by the consumer, and while we need not free a constant, tcg will quietly ignore such frees, so free_compare need not be changed. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 44 ++-- 1 file changed, 22 ins

[PATCH v6 8/9] target/arm: Introduce gen_pc_plus_diff for aarch32

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/translate.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/target/arm/translate.c b/ta

[PATCH 10/26] target/s390x: Use gen_psw_addr_disp in op_sam

2022-10-05 Thread Richard Henderson
Complicated because we may now require a runtime jump. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 40 +--- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index ad

[PATCH 06/26] target/s390x: Introduce gen_psw_addr_disp

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 69 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/tra

[PATCH 01/26] target/s390x: Use tcg_constant_* in local contexts

2022-10-05 Thread Richard Henderson
Replace tcg_const_* with tcg_constant_* in contexts where the free to remove is nearby. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 408 +-- 1 file changed, 145 insertions(+), 263 deletions(-) diff --gi

[PATCH v6 3/9] target/arm: Change gen_*set_pc_im to gen_*update_pc

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values by passing in pc difference. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/translate-a32.h | 2 +- target/arm/translate.h | 6 ++-- target/arm/translate-a64.c | 32 +---

[PATCH 05/26] target/s390x: Change help_goto_direct to work on displacements

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index f8cfddc181..

[PATCH 09/26] target/s390x: Use gen_psw_addr_disp in save_link_info

2022-10-05 Thread Richard Henderson
Trivial but non-mechanical conversion away from pc_tmp. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c ind

[PATCH v6 2/9] target/arm: Change gen_goto_tb to work on displacements

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 40 -- target/arm/translate.c | 10 ++ 2 files changed, 27 insertions(+), 23 delet

[PATCH v6 7/9] target/arm: Introduce gen_pc_plus_diff for aarch64

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 41 +++--- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/target/arm/translate-a6

[PATCH 03/26] target/s390x: Use tcg_constant_i32 for fpinst_extract_m34

2022-10-05 Thread Richard Henderson
Return a constant or NULL, which means the free may be removed from all callers of fpinst_extract_m34. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/target/s390x/tcg/translate.c b/t

[PATCH 04/26] target/s390x: Use tcg_constant_* in translate_vx.c.inc

2022-10-05 Thread Richard Henderson
In most cases, this is a simple local allocate and free replaced by tcg_constant_*. In three cases, a variable temp was initialized with a constant value -- reorg to localize the constant. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate_vx.c.inc | 45 +---

[PATCH v6 4/9] target/arm: Change gen_exception_insn* to work on displacements

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/translate.h| 5 +++-- target/arm/translate-a64.c| 28 ++- target/arm/translate-m-nocp.c | 6 ++--- target

[PATCH v6 1/9] target/arm: Introduce curr_insn_len

2022-10-05 Thread Richard Henderson
A simple helper to retrieve the length of the current insn. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/translate.h | 5 + target/arm/translate-vfp.c | 2 +- target/arm/translate.c | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) d

[PATCH v6 5/9] target/arm: Remove gen_exception_internal_insn pc argument

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Since we always pass dc->pc_curr, fold the arithmetic to zero displacement. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 6 +++--- target/arm/translate.c | 10 ++

[PATCH v6 9/9] target/arm: Enable TARGET_TB_PCREL

2022-10-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 1 + target/arm/translate.h | 19 target/arm/cpu.c | 23 +++--- target/arm/translate-a64.c | 37 ++- target/arm/translate.c | 62 ++ 5

[PATCH v6 6/9] target/arm: Change gen_jmp* to work on displacements

2022-10-05 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/target/arm/translate.c b/tar

[PATCH v6 0/9] target/arm: pc-relative translation blocks

2022-10-05 Thread Richard Henderson
This is the Arm specific changes required to reduce the amount of translation for address space randomization. Changes for v6: * Minor updates for patch review, r-b. r~ Richard Henderson (9): target/arm: Introduce curr_insn_len target/arm: Change gen_goto_tb to work on displacements ta

[PATCH 24/24] accel/tcg: Move remainder of page locking to tb-maint.c

2022-10-05 Thread Richard Henderson
The only thing that still touches PageDesc in translate-all.c are some locking routines related to tb-maint.c which have not yet been moved. Do so now. Move some code up in tb-maint.c as well, to untangle the maze of ifdefs, and allow a sensible final ordering. Move some declarations from exec/t

[PATCH 23/24] accel/tcg: Move PageDesc tree into tb-maint.c for system

2022-10-05 Thread Richard Henderson
Now that PageDesc is not used for user-only, and for system it is only used for tb maintenance, move the implementation into tb-main.c appropriately ifdefed. We have not yet eliminated all references to PageDesc for user-only, so retain a typedef to the structure without definition. Signed-off-by

[PATCH 15/24] accel/tcg: Use interval tree for TBs in user-only mode

2022-10-05 Thread Richard Henderson
Begin weaning user-only away from PageDesc. Since, for user-only, all TB (and page) manipulation is done with a single mutex, and there is no virtual/physical discontinuity to split a TB across discontinuous pages, place all of the TBs into a single IntervalTree. This makes it trivial to find all

[PATCH 21/24] accel/tcg: Move page_{get,set}_flags to user-exec.c

2022-10-05 Thread Richard Henderson
This page tracking implementation is specific to user-only, since the system softmmu version is in cputlb.c. Move it out of translate-all.c to user-exec.c. Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 17 ++ accel/tcg/translate-all.c | 350 --

[PATCH 13/24] accel/tcg: Use tb_invalidate_phys_page in page_set_flags

2022-10-05 Thread Richard Henderson
We do not require detection of overlapping TBs here, so use the more appropriate function. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index aa8d213514..8d

[PATCH 22/24] accel/tcg: Use interval tree for user-only page tracking

2022-10-05 Thread Richard Henderson
Finish weaning user-only away from PageDesc. Using an interval tree to track page permissions means that we can represent very large regions efficiently. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/290 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/967 Resolves: https://gitla

[PATCH 20/24] accel/tcg: Use interval tree for TARGET_PAGE_DATA_SIZE

2022-10-05 Thread Richard Henderson
Continue weaning user-only away from PageDesc. Use an interval tree to record target data. Chunk the data, to minimize allocation overhead. Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 1 - accel/tcg/user-exec.c | 110 -- 2 files changed

[PATCH 12/24] accel/tcg: Unify declarations of tb_invalidate_phys_range

2022-10-05 Thread Richard Henderson
We missed this function when we introduced tb_page_addr_t. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 2 +- include/exec/ram_addr.h | 2 -- accel/tcg/tb-maint.c| 13 ++--- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/include/exec/exec-all.h b/

[PATCH 14/24] accel/tcg: Call tb_invalidate_phys_page for PAGE_RESET

2022-10-05 Thread Richard Henderson
When PAGE_RESET is set, we are replacing pages with new content, which means that we need to invalidate existing cached data, such as TranslationBlocks. Perform the reset invalidate while we're doing other invalidates, which allows us to remove the separate invalidates from the user-only mmap/munm

[PATCH 19/24] accel/tcg: Simplify page_get/alloc_target_data

2022-10-05 Thread Richard Henderson
Since the only user, Arm MTE, always requires allocation, merge the get and alloc functions to always produce a non-null result. Also assume that the user has already checked page validity. Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 21 ++--- accel/tcg/user-e

[PATCH 11/24] accel/tcg: Rename tb_invalidate_phys_page_range and drop end parameter

2022-10-05 Thread Richard Henderson
This function is is never called with a real range, only for a single page. Drop the second parameter and rename to tb_invalidate_phys_page. Signed-off-by: Richard Henderson --- include/exec/translate-all.h | 2 +- accel/tcg/tb-maint.c | 15 --- cpu.c

[PATCH 10/24] accel/tcg: Rename tb_invalidate_phys_page

2022-10-05 Thread Richard Henderson
Rename to tb_invalidate_phys_page_unwind to emphasize that we also detect invalidating the current TB, and also to free up that name for other usage. Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 2 +- accel/tcg/tb-maint.c | 2 +- accel/tcg/translate-all.c | 5 +++-- 3 fi

[PATCH 17/24] accel/tcg: Use tb_invalidate_phys_range in page_set_flags

2022-10-05 Thread Richard Henderson
Flush translation blocks in bulk, rather than page-by-page. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 0006290694..04401ceac7 100644 --- a/a

[PATCH 04/24] accel/tcg: Split out PageDesc to internal.h

2022-10-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 31 +++ accel/tcg/translate-all.c | 31 +-- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index dc800fd485..62da4

[PATCH 18/24] accel/tcg: Move TARGET_PAGE_DATA_SIZE impl to user-exec.c

2022-10-05 Thread Richard Henderson
Since "target data" is always user-only, move it out of translate-all.c to user-exec.c. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 50 --- accel/tcg/user-exec.c | 50 +++ 2 files changed, 50 inserti

[PATCH 09/24] accel/tcg: Introduce tb_{set_}page_addr{0,1}

2022-10-05 Thread Richard Henderson
This data structure will be replaced for user-only: add accessors. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 22 ++ accel/tcg/cpu-exec.c | 9 + accel/tcg/tb-maint.c | 29 +++-- accel/tcg/translate-all.c | 16 ++

[PATCH 08/24] accel/tcg: Remove duplicate store to tb->page_addr[]

2022-10-05 Thread Richard Henderson
When we added the fast path, we initialized page_addr[] early. These stores in and around tb_page_add() are redundant; remove them. Fixes: 50627f1b7b1 ("accel/tcg: Add fast path for translator_ld*") Signed-off-by: Richard Henderson --- accel/tcg/tb-maint.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH 07/24] accel/tcg: Drop cpu_get_tb_cpu_state from TARGET_HAS_PRECISE_SMC

2022-10-05 Thread Richard Henderson
The results of the calls to cpu_get_tb_cpu_state, current_{pc,cs_base,flags}, are not used. In tb_invalidate_phys_page, use bool for current_tb_modified. Signed-off-by: Richard Henderson --- accel/tcg/tb-maint.c | 25 ++--- 1 file changed, 2 insertions(+), 23 deletions(-) di

[PATCH 16/24] accel/tcg: Use page_reset_target_data in page_set_flags

2022-10-05 Thread Richard Henderson
Use the existing function for clearing target data. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index e002981a9f..0006290694 100644 --- a/acc

[PATCH 05/24] accel/tcg: Split out tb-maint.c

2022-10-05 Thread Richard Henderson
Move all of the TranslationBlock flushing and page linking code from translate-all.c to tb-maint.c. Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 55 +++ accel/tcg/tb-maint.c | 735 accel/tcg/translate-all.c | 766 +---

[PATCH 01/24] util: Add interval-tree.c

2022-10-05 Thread Richard Henderson
Copy and simplify the Linux kernel's interval_tree_generic.h, instantiating for uint64_t. Signed-off-by: Richard Henderson --- include/qemu/interval-tree.h| 99 tests/unit/test-interval-tree.c | 209 util/interval-tree.c| 881 tests

[PATCH 06/24] accel/tcg: Move assert_no_pages_locked to internal.h

2022-10-05 Thread Richard Henderson
There are no users outside of accel/tcg; this function does not need to be defined in exec-all.h. Signed-off-by: Richard Henderson --- accel/tcg/internal.h| 5 + include/exec/exec-all.h | 8 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/accel/tcg/internal.h b/ac

[PATCH 03/24] accel/tcg: Remove disabled debug in translate-all.c

2022-10-05 Thread Richard Henderson
These items printf, and could be replaced with proper tracepoints if we really cared. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 109 -- 1 file changed, 109 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c

[PATCH 02/24] accel/tcg: Make page_alloc_target_data allocation constant

2022-10-05 Thread Richard Henderson
Use a constant target data allocation size for all pages. This will be necessary to reduce overhead of page tracking. Since TARGET_PAGE_DATA_SIZE is now required, we can use this to omit data tracking for targets that don't require it. Signed-off-by: Richard Henderson --- include/exec/cpu-all.h

[PATCH 00/24] accel/tcg: Rewrite user-only vma tracking

2022-10-05 Thread Richard Henderson
The primary motivator here are the numerous bug reports (e.g. #290) about not being able to handle very large memory allocations. I presume all or most of these are due to guest use of the clang address sanitizer, which allocates a massive shadow vma. This patch set copies the linux kernel code fo

Re: [PATCH 49/51] io/channel-watch: Fix socket watch on Windows

2022-10-05 Thread Bin Meng
Hi Paolo, On Wed, Sep 28, 2022 at 2:10 PM Bin Meng wrote: > > Hi Paolo, > > On Wed, Sep 21, 2022 at 9:02 AM Bin Meng wrote: > > > > On Wed, Sep 14, 2022 at 4:08 PM Bin Meng wrote: > > > > > > On Wed, Sep 7, 2022 at 1:07 PM Bin Meng wrote: > > > > > > > > Hi Clément, > > > > > > > > On Tue, Sep

Re: [PATCH v9 05/16] qapi: net: add stream and dgram netdevs

2022-10-05 Thread David Gibson
On Wed, Oct 05, 2022 at 12:08:27PM +0200, Laurent Vivier wrote: > On 9/28/22 07:55, David Gibson wrote: > > > +static int net_stream_server_init(NetClientState *peer, > > > + const char *model, > > > + const char *name, > > > +

Re: [PATCH v9 08/16] net: stream: add unix socket

2022-10-05 Thread David Gibson
On Wed, Oct 05, 2022 at 03:38:09PM +0200, Laurent Vivier wrote: > On 9/28/22 08:12, David Gibson wrote: > > > @@ -253,9 +253,27 @@ static void net_stream_accept(void *opaque) > > > s->fd = fd; > > > s->nc.link_down = false; > > > net_stream_connect(s); > > > -snprintf(s->nc.in

[PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-05 Thread Gourry
Type 3 devices were hard-coded to always present as persistent memory devices. This patch adds the "is_pmem" attribute which can be used to instantiate a device as either a pmem or vmem. Right now it is only possible to choose one or the other, but future devices may present both (such as multi-lo

Re: [PULL 00/54] testing, gdbstub, plugin and gitdm updates

2022-10-05 Thread Paolo Bonzini
On 10/5/22 17:23, Alex Bennée wrote: Stefan Hajnoczi writes: On Tue, 4 Oct 2022 at 09:38, Alex Bennée wrote: The following changes since commit efbf38d73e5dcc4d5f8b98c6e7a12be1f3b91745: Merge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging (2022-10-03 15:06:07 -0400) a

Re: [PATCH] coroutine: Drop coroutine_fn annotation from qemu_coroutine_self()

2022-10-05 Thread Paolo Bonzini
On 10/5/22 19:52, Alberto Faria wrote: qemu_coroutine_self() can be called from outside coroutine context, returning the leader coroutine, and several such invocations currently exist (mostly in qcow2 tracing calls). Signed-off-by: Alberto Faria --- include/qemu/coroutine.h | 2 +- 1 file ch

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-05 Thread Jarkko Sakkinen
On Wed, Oct 05, 2022 at 04:04:05PM +0300, Jarkko Sakkinen wrote: > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > In memory encryption usage, guest memory may be encrypted with special > > key and can be accessed only by the VM itself. We call such memory > > private memory. It's va

Re: [PATCH v3] virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events.

2022-10-05 Thread Paolo Bonzini
On 10/4/22 01:13, Venu Busireddy wrote: script? Something must be putting the SCSI command in the queue. Perhaps the driver is doing so when it sees an event? And if it is bypassing the normal submission mechanism, the REPORT LUNS commands is hidden in scsitrac; that in turn retruns a unit attent

Re: [PATCH v3 00/26] target/i386: pc-relative translation blocks

2022-10-05 Thread Richard Henderson
On 10/5/22 14:06, Paolo Bonzini wrote: Great, then if you want I can merge this myself. Yes, please. r~

Re: [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode?

2022-10-05 Thread Vivek Goyal
On Mon, Oct 03, 2022 at 06:51:42PM -0400, Colin Walters wrote: > > > On Thu, Sep 29, 2022, at 1:03 PM, Vivek Goyal wrote: > > > > So rust version of virtiofsd, already supports running unprivileged > > (inside a user namespace). > > I know, but as I already said, the use case here is running in

Re: [PATCH v2 1/2] file-posix: add the tracking of the zones wp

2022-10-05 Thread Damien Le Moal
On 10/5/22 17:30, Sam Li wrote: > Damien Le Moal 于2022年10月5日周三 15:34写道: >> >> On 10/5/22 10:44, Damien Le Moal wrote: >>> On 9/29/22 18:31, Sam Li wrote: Since Linux doesn't have a user API to issue zone append operations to zoned devices from user space, the file-posix driver is modifie

Re: [PULL v2 00/53] testing, gdbstub, plugin and gitdm updates

2022-10-05 Thread Stefan Hajnoczi
Hi Alex, This pull request fails two CI jobs: 1. https://gitlab.com/qemu-project/qemu/-/jobs/3132270506 2. https://gitlab.com/qemu-project/qemu/-/jobs/3132270625 Maybe there is an issue with the "tests/docker: update fedora-win[32|64]-cross with lcitool" commit (I haven't bisected)? Thanks, Stefa

Re: [PATCH 06/26] blkdebug: add missing coroutine_fn annotations

2022-10-05 Thread Paolo Bonzini
Il mer 5 ott 2022, 06:32 Kevin Wolf ha scritto: > Hm... blkdebug_debug_event() is called from bdrv_debug_event(), which is > not coroutine_fn. And I think that it's not coroutine_fn is correct: > For example, with 'qemu-img snapshot -c' you get img_snapshot() -> > bdrv_snapshot_create() -> qcow2_

Re: [PATCH v3 00/26] target/i386: pc-relative translation blocks

2022-10-05 Thread Paolo Bonzini
Great, then if you want I can merge this myself. Paolo Il mer 5 ott 2022, 16:26 Richard Henderson ha scritto: > On 10/1/22 13:59, Paolo Bonzini wrote: > > > > > > Il sab 1 ott 2022, 16:09 Richard Henderson > > ha scritto: > > > > This is the x86 specifi

Re: [RFC PATCH 0/4] Idea for using hardfloat in PPC

2022-10-05 Thread Richard Henderson
On 10/5/22 07:37, Víctor Colombo wrote: However, the impact in performance was not the expected. In x86_64 I had a small 3% improvement, while in a Power9 machine there was a small performance loss, as can be seem below (100 executions). || min [s] | max [s] | avg [s] | | before | 122.30

Re: [PATCH v3 00/26] target/i386: pc-relative translation blocks

2022-10-05 Thread Richard Henderson
On 10/1/22 13:59, Paolo Bonzini wrote: Il sab 1 ott 2022, 16:09 Richard Henderson > ha scritto: This is the x86 specific changes required to reduce the amount of translation for address space randomization. For v3, quite a few changes based on

Re: [PATCH 05/14] migration: Yield bitmap_mutex properly when sending/sleeping

2022-10-05 Thread Peter Xu
On Wed, Oct 05, 2022 at 09:40:53AM -0400, Peter Xu wrote: > On Wed, Oct 05, 2022 at 12:18:00PM +0100, Dr. David Alan Gilbert wrote: > > * Peter Xu (pet...@redhat.com) wrote: > > > On Tue, Oct 04, 2022 at 02:55:10PM +0100, Dr. David Alan Gilbert wrote: > > > > * Peter Xu (pet...@redhat.com) wrote: >

Re: [PATCH 10/14] migration: Make PageSearchStatus part of RAMState

2022-10-05 Thread Peter Xu
On Wed, Oct 05, 2022 at 07:51:34PM +0100, Dr. David Alan Gilbert wrote: > > /* struct contains XBZRLE cache and a static page > > used by the compression */ > > static struct { > > @@ -319,6 +359,11 @@ typedef struct { > > struct RAMState { > > /* QEMUFile used for this migration */ > >

Re: [PATCH 10/14] migration: Make PageSearchStatus part of RAMState

2022-10-05 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > We used to allocate PSS structure on the stack for precopy when sending > pages. Make it static, so as to describe per-channel ram migration status. > > Here we declared RAM_CHANNEL_MAX instances, preparing for postcopy to use > it, even though this patch h

Re: [PATCH 02/26] block: add missing coroutine_fn annotations

2022-10-05 Thread Alberto Campinho Faria
On Sat, Sep 24, 2022 at 2:42 PM Paolo Bonzini wrote: > Because at the time I wrote the patch, blk_pwrite_zeroes() was a > coroutine_fn. :) > > It is called from bdrv_co_create_opts_simple which is coroutine_fn and > performs I/O, so it should be a coroutine_fn. I have a few more patches > to not g

Re: [PULL 00/20] tcg patch queue

2022-10-05 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH] linux-user: fix pidfd_send_signal()

2022-10-05 Thread Helge Deller
On 10/5/22 18:38, Laurent Vivier wrote: According to pidfd_send_signal(2), info argument can be a NULL pointer. Fix strace to correctly manage ending comma in parameters. Fixes: cc054c6f13 ("linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls") cc: Helge Deller Signed-

[PATCH] coroutine: Drop coroutine_fn annotation from qemu_coroutine_self()

2022-10-05 Thread Alberto Faria
qemu_coroutine_self() can be called from outside coroutine context, returning the leader coroutine, and several such invocations currently exist (mostly in qcow2 tracing calls). Signed-off-by: Alberto Faria --- include/qemu/coroutine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PULL v3 0/4] Hexagon (target/hexagon) improve store handling and gen_tcg_funcs.py

2022-10-05 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH] coroutine: Make qemu_coroutine_self() return NULL if not in coroutine

2022-10-05 Thread Alberto Campinho Faria
On Wed, Oct 5, 2022 at 5:34 PM Kevin Wolf wrote: > The coroutine_fn annotation for qemu_coroutine_self() is wrong, but I > think it already works outside of coroutine context, and consistently in > all three backends, by returning &leader. > > Changing that to NULL makes me kind of nervous because

[PULL v2 00/53] testing, gdbstub, plugin and gitdm updates

2022-10-05 Thread Alex Bennée
The following changes since commit fafd35a6dab8e70a7c395aaa8e1273267cf9f3c8: Merge tag 'trivial-branch-for-7.2-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2022-10-04 14:04:18 -0400) are available in the Git repository at: https://github.com/stsquad/qemu.git tags/p

Re: [PATCH] coroutine: Make qemu_coroutine_self() return NULL if not in coroutine

2022-10-05 Thread Kevin Wolf
Am 05.10.2022 um 16:20 hat Alberto Faria geschrieben: > qemu_coroutine_self() is used in several places outside of coroutine > context (mostly in qcow2 tracing calls). > > Ensure qemu_coroutine_self() works properly when not called from > coroutine context, returning NULL in that case, and remove

[PATCH v10 17/17] net: stream: add QAPI events to report connection state

2022-10-05 Thread Laurent Vivier
The netdev reports NETDEV_STREAM_CONNECTED event when the backend is connected, and NETDEV_STREAM_EOC when it is disconnected. The NETDEV_STREAM_CONNECTED event includes the URI of the destination address. Signed-off-by: Laurent Vivier --- net/stream.c | 11 +-- qapi/net.json | 46

[PATCH] linux-user: fix pidfd_send_signal()

2022-10-05 Thread Laurent Vivier
According to pidfd_send_signal(2), info argument can be a NULL pointer. Fix strace to correctly manage ending comma in parameters. Fixes: cc054c6f13 ("linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls") cc: Helge Deller Signed-off-by: Laurent Vivier --- linux-user/st

[PATCH v10 15/17] net: stream: move to QIO to enable additional parameters

2022-10-05 Thread Laurent Vivier
Use QIOChannel, QIOChannelSocket and QIONetListener. This allows net/stream to use all the available parameters provided by SocketAddress. Signed-off-by: Laurent Vivier --- net/stream.c| 484 +--- qemu-options.hx | 4 +- 2 files changed, 171 inse

[PATCH v10 16/17] tests/qtest: netdev: test stream and dgram backends

2022-10-05 Thread Laurent Vivier
Signed-off-by: Laurent Vivier --- tests/qtest/meson.build | 1 + tests/qtest/netdev-socket.c | 417 2 files changed, 418 insertions(+) create mode 100644 tests/qtest/netdev-socket.c diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 4

[PATCH v10 07/17] net: socket: Don't ignore EINVAL on netdev socket connection

2022-10-05 Thread Laurent Vivier
From: Stefano Brivio Other errors are treated as failure by net_socket_connect_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio Signed-off-by: Laurent Vivier --- net/socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 de

[PATCH v10 08/17] net: stream: Don't ignore EINVAL on netdev socket connection

2022-10-05 Thread Laurent Vivier
From: Stefano Brivio Other errors are treated as failure by net_stream_client_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio [lvivier: applied to net/stream.c] Signed-off-by: Laurent Vivier Reviewed-by: Daniel P. Berran

[PATCH v10 14/17] qemu-sockets: update socket_uri() and socket_parse() to be consistent

2022-10-05 Thread Laurent Vivier
To be consistent with socket_uri(), add 'tcp:' prefix for inet type in socket_parse(), by default socket_parse() use tcp when no prefix is provided (format is host:port). In socket_uri(), use 'vsock:' prefix for vsock type rather than 'tcp:' because it makes a vsock address look like an inet addre

[PATCH v10 10/17] net: dgram: make dgram_dst generic

2022-10-05 Thread Laurent Vivier
dgram_dst is a sockaddr_in structure. To be able to use it with unix socket, use a pointer to a generic sockaddr structure. Rename it dest_addr, and store socket length in dest_len. Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 82 +

[PATCH v10 11/17] net: dgram: move mcast specific code from net_socket_fd_init_dgram()

2022-10-05 Thread Laurent Vivier
It is less complex to manage special cases directly in net_dgram_mcast_init() and net_dgram_udp_init(). Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 143 1 file changed, 76 insertions(+), 67 deletions(-) diff -

[PATCH v10 03/17] net: simplify net_client_parse() error management

2022-10-05 Thread Laurent Vivier
All net_client_parse() callers exit in case of error. Move exit(1) to net_client_parse() and remove error checking from the callers. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster Reviewed-by: David Gibson --- include/net/net.h | 2 +- net/net.c

  1   2   >