Re: [PATCH v1 5/8] migration: Export dirty-limit time info

2022-10-01 Thread Hyman Huang
在 2022/10/2 2:31, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe the process of dirty limit during live migration. Signed-off-by: Hyman Huang(黄勇) [...] diff --git

Re: [PATCH for 7.1] linux-user: fix compat with glibc >= 2.36 sys/mount.h

2022-10-01 Thread Andreas Schwab
On Aug 02 2022, Daniel P. Berrangé wrote: > This patch removes linux/fs.h, meaning we have to define > various FS_IOC constants that are now unavailable. This breaks a lot of ioctl emulations, as it lacks their definitions: #define BLKGETSIZE64 _IOR(0x12,114,size_t) #define BLK

Re: [PATCH qemu] mips/malta: pass RNG seed to to kernel via env var

2022-10-01 Thread Jason A. Donenfeld
On Sat, Oct 1, 2022 at 9:32 PM Bernhard Reutner-Fischer wrote: > > On Sat, 1 Oct 2022 21:06:48 +0200 > "Jason A. Donenfeld" wrote: > > > On Fri, Sep 30, 2022 at 04:05:20PM +0200, Jason A. Donenfeld wrote: > > > With the kernel patch linked below, Linux ingests a RNG seed > > > passed from the hyp

Re: access guest address from within instruction

2022-10-01 Thread BitFriends
well, it doesn't give errors, but warnings because of unsigned longs being converted to TCGv_i64, which exact definiton I cannot find in the qemu repo. Where is it located? When stepping through the instructions' code, the value that should be read isn't read. Maybe that'll work when fixing the war

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

2022-10-01 Thread Paolo Bonzini
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 Paolo's feedback. > Reviewed-by: Paolo Bonzini > > r~ > > Based-on: 20220930212622.1

Re: access guest address from within instruction

2022-10-01 Thread Richard Henderson
On 10/1/22 13:10, BitFriends wrote: Hello, I am trying to create a custom instruction that accesses guest memory specified by an address in a register. I specifically want to read from that address. So I tried to do that using "tcg_gen_qemu_ld_i64(&res, env->regs[R_EDI], 0, MO_LEUQ);", but tha

access guest address from within instruction

2022-10-01 Thread BitFriends
Hello, I am trying to create a custom instruction that accesses guest memory specified by an address in a register. I specifically want to read from that address. So I tried to do that using "tcg_gen_qemu_ld_i64(&res, env->regs[R_EDI], 0, MO_LEUQ);", but that doesn't save any result in res. So eit

[PATCH] tests/avocado: Add missing require_netdev('user') checks

2022-10-01 Thread Peter Maydell
Some avocado tests fail if QEMU was built without libslirp. Add require_netdev('user') checks where necessary: These tests try to ping 10.0.2.2 and expect it to succeed: boot_linux_console.py:BootLinuxConsole.test_arm_emcraft_sf2 boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd pp

Re: [PATCH qemu] mips/malta: pass RNG seed to to kernel via env var

2022-10-01 Thread Bernhard Reutner-Fischer
On Sat, 1 Oct 2022 21:06:48 +0200 "Jason A. Donenfeld" wrote: > On Fri, Sep 30, 2022 at 04:05:20PM +0200, Jason A. Donenfeld wrote: > > With the kernel patch linked below, Linux ingests a RNG seed > > passed from the hypervisor. So, pass this for the Malta platform, and > > reinitialize it on reb

Re: [PULL v2 00/15] x86 + misc changes for 2022-09-29

2022-10-01 Thread Paolo Bonzini
On Sat, Oct 1, 2022 at 1:01 AM Stefan Hajnoczi wrote: > > This pull request doesn't build: > > ../meson.build:545:95: ERROR: Expecting endif got rparen. > gdbus_codegen_error = '@0@ uses gdbus-codegen, which does not support > control flow integrity') > > https://gitlab.com/qemu-project/qemu/-/job

Re: [PATCH qemu] mips/malta: pass RNG seed to to kernel via env var

2022-10-01 Thread Jason A. Donenfeld
On Fri, Sep 30, 2022 at 04:05:20PM +0200, Jason A. Donenfeld wrote: > With the kernel patch linked below, Linux ingests a RNG seed > passed from the hypervisor. So, pass this for the Malta platform, and > reinitialize it on reboot too, so that it's always fresh. > > Link: > https://lore.kernel.or

Re: [PATCH v1 5/8] migration: Export dirty-limit time info

2022-10-01 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > Export dirty limit throttle time and estimated ring full > time, through which we can observe the process of dirty > limit during live migration. > > Signed-off-by: Hyman Huang(黄勇) [...] > diff --git a/qapi/migration.json b/qapi/migr

[PATCH v3 41/42] target/arm: Implement FEAT_HAFDBS

2022-10-01 Thread Richard Henderson
Perform the atomic update for hardware management of the access flag and the dirty bit. A limitation of the implementation so far is that the page table itself must already be writable, i.e. the dirty bit for the stage2 page table must already be set, i.e. we cannot set both dirty bits at the same

[PATCH v3 40/42] target/arm: Consider GP an attribute in get_phys_addr_lpae

2022-10-01 Thread Richard Henderson
Both GP and DBM are in the upper attribute block. Extend the computation of attrs to include them, then simplify the setting of guarded. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/p

[PATCH v3 38/42] target/arm: Fix fault reporting in get_phys_addr_lpae

2022-10-01 Thread Richard Henderson
Always overriding fi->type was incorrect, as we would not properly propagate the fault type from S1_ptw_translate, or arm_ldq_ptw. Simplify things by providing a new label for a translation fault. For other faults, store into fi directly. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 3

[PATCH v3 35/42] target/arm: Move S1_ptw_translate outside arm_ld[lq]_ptw

2022-10-01 Thread Richard Henderson
Separate S1 translation from the actual lookup. Will enable lpae hardware updates. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 92 +--- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c inde

[PATCH v3 32/42] target/arm: Extract HA and HD in aa64_va_parameters

2022-10-01 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/internals.h | 2 ++ target/arm/helper.c| 8 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index a50189e2e4..e95b6b1b8f 100644 --- a/target/arm/internals.h +++ b/target/arm/

[PATCH v3 31/42] target/arm: Add isar predicates for FEAT_HAFDBS

2022-10-01 Thread Richard Henderson
The MMFR1 field may indicate support for hardware update of access flag alone, or access flag and dirty bit. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 7108568685..e499a84850 1006

[PATCH v3 42/42] target/arm: Use the max page size in a 2-stage ptw

2022-10-01 Thread Richard Henderson
We had only been reporting the stage2 page size. This causes problems if stage1 is using a larger page size (16k, 2M, etc), but stage2 is using a smaller page size, because cputlb does not set large_page_{addr,mask} properly. Fix by using the max of the two page sizes. Reported-by: Marc Zyngier

[PATCH v3 27/42] target/arm: Use softmmu tlbs for page table walking

2022-10-01 Thread Richard Henderson
So far, limit the change to S1_ptw_translate, arm_ldl_ptw, and arm_ldq_ptw. Use probe_access_full to find the host address, and if so use a host load. If the probe fails, we've got our fault info already. On the off chance that page tables are not in RAM, continue to use the address_space_ld* fu

[PATCH v3 39/42] target/arm: Don't shift attrs in get_phys_addr_lpae

2022-10-01 Thread Richard Henderson
Leave the upper and lower attributes in the place they originate from in the descriptor. Shifting them around is confusing, since one cannot read the bit numbers out of the manual. Also, new attributes have been added which would alter the shifts. Signed-off-by: Richard Henderson --- target/ar

[PATCH v3 24/42] target/arm: Add ARMMMUIdx_Phys_{S,NS}

2022-10-01 Thread Richard Henderson
Not yet used, but add mmu indexes for 1-1 mapping to physical addresses. Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 2 +- target/arm/cpu.h | 7 ++- target/arm/ptw.c | 19 +-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/targ

[PATCH v3 33/42] target/arm: Split out S1TranslateResult type

2022-10-01 Thread Richard Henderson
Consolidate the results of S1_ptw_translate in one struct. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 70 +--- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 7a77bea2c7..99ad894180

[PATCH v3 37/42] target/arm: Remove loop from get_phys_addr_lpae

2022-10-01 Thread Richard Henderson
The unconditional loop was used both to iterate over levels and to control parsing of attributes. Use an explicit goto in both cases. While this appears less clean for iterating over levels, we will need to jump back into the middle of this loop for atomic updates, which is even uglier. Signed-o

[PATCH v3 30/42] target/arm: Add ptw_idx argument to S1_ptw_translate

2022-10-01 Thread Richard Henderson
Hoist the computation of the mmu_idx for the ptw up to get_phys_addr_with_secure_debug and get_phys_addr_twostage. This removes the duplicate check for stage2 disabled from the middle of the walk, performing it only once. Pass ptw_idx through get_phys_addr_{v5,v6,lpae} and arm_{ldl,ldq}_ptw. Sign

[PATCH v3 22/42] target/arm: Use probe_access_full for MTE

2022-10-01 Thread Richard Henderson
The CPUTLBEntryFull structure now stores the original pte attributes, as well as the physical address. Therefore, we no longer need a separate bit in MemTxAttrs, nor do we need to walk the tree of memory regions. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 1 - target

[PATCH v3 34/42] target/arm: Move be test for regime into S1TranslateResult

2022-10-01 Thread Richard Henderson
Hoist this test out of arm_ld[lq]_ptw into S1_ptw_translate. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 99ad894180..d356b0b22d 100644 --- a/target/arm/ptw.c +++

[PATCH v3 26/42] target/arm: Plumb debug into S1_ptw_translate

2022-10-01 Thread Richard Henderson
Before using softmmu page tables for the ptw, plumb down a debug parameter so that we can query page table entries from gdbstub without modifying cpu state. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 66 +--- 1 file changed, 40 insertions(

[PATCH v3 21/42] target/arm: Enable TARGET_PAGE_ENTRY_EXTRA

2022-10-01 Thread Richard Henderson
Copy attrs and sharability, into the TLB. This will eventually be used by S1_ptw_translate to report stage1 translation failures, and by do_ats_write to fill in PAR_EL1. Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 8 target/arm/tlb_helper.c | 3 +++ 2 files changed,

[PATCH v3 28/42] target/arm: Split out get_phys_addr_twostage

2022-10-01 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.c | 196 +-- 1 file changed, 106 insertions(+), 90 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index ba496c3421..3f5733a237 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -2

[PATCH v3 19/42] target/arm: Fix cacheattr in get_phys_addr_disabled

2022-10-01 Thread Richard Henderson
Do not apply memattr or shareability for Stage2 translations. Make sure to apply HCR_{DC,DCT} only to Regime_EL10, per the pseudocode in AArch64.S1DisabledOutput. Signed-off-by: Richard Henderson --- v3: Do not use a switch or a goto. --- target/arm/ptw.c | 48 +--

[PATCH v3 23/42] target/arm: Use probe_access_full for BTI

2022-10-01 Thread Richard Henderson
Add a field to TARGET_PAGE_ENTRY_EXTRA to hold the guarded bit. In is_guarded_page, use probe_access_full instead of just guessing that the tlb entry is still present. Also handles the FIXME about executing from device memory. Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 8

[PATCH v3 25/42] target/arm: Move ARMMMUIdx_Stage2 to a real tlb mmu_idx

2022-10-01 Thread Richard Henderson
We had been marking this ARM_MMU_IDX_NOTLB, move it to a real tlb. Flush the tlb when invalidating stage 1+2 translations. Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 2 +- target/arm/cpu.h | 23 +-- target/arm/helper.c| 4 +++- 3 files changed,

[PATCH v3 17/42] target/arm: Fix ATS12NSO* from S PL1

2022-10-01 Thread Richard Henderson
Use arm_hcr_el2_eff_secstate instead of arm_hcr_el2_eff, so that we use is_secure instead of the current security state. These AT* operations have been broken since arm_hcr_el2_eff gained a check for "el2 enabled" for Secure EL2. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- t

[PATCH v3 20/42] target/arm: Use tlb_set_page_full

2022-10-01 Thread Richard Henderson
Adjust GetPhysAddrResult to fill in CPUTLBEntryFull, so that it may be passed directly to tlb_set_page_full. The change is large, but mostly mechanical. The major non-mechanical change is page_size -> lg_page_size. Most of the time this is obvious, and is related to TARGET_PAGE_BITS. Signed-off-

[PATCH v3 36/42] target/arm: Add ARMFault_UnsuppAtomicUpdate

2022-10-01 Thread Richard Henderson
This fault type is to be used with FEAT_HAFDBS when the guest enables hw updates, but places the tables in memory where atomic updates are unsupported. Signed-off-by: Richard Henderson --- target/arm/internals.h | 4 1 file changed, 4 insertions(+) diff --git a/target/arm/internals.h b/tar

[PATCH v3 15/42] target/arm: Remove env argument from combined_attrs_fwb

2022-10-01 Thread Richard Henderson
This value is unused. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index cb072792a2..2f0161 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -2172,8 +2172,7 @@ static

[PATCH v3 18/42] target/arm: Split out get_phys_addr_disabled

2022-10-01 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 138 +-- 1 file changed, 74 insertions(+), 64 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 7bf79779da..e494a9de67 100644 --- a/target/arm/ptw.c +

[PATCH v3 14/42] target/arm: Hoist read of *is_secure in S1_ptw_translate

2022-10-01 Thread Richard Henderson
Rename the argument to is_secure_ptr, and introduce a local variable is_secure with the value. We only write back to the pointer toward the end of the function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 22 -- 1 file changed, 12 inse

[PATCH v3 29/42] target/arm: Use bool consistently for get_phys_addr subroutines

2022-10-01 Thread Richard Henderson
The return type of the functions is already bool, but in a few instances we used an integer type with the return statement. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 3

[PATCH v3 16/42] target/arm: Pass HCR to attribute subroutines.

2022-10-01 Thread Richard Henderson
These subroutines did not need ENV for anything except retrieving the effective value of HCR anyway. We have computed the effective value of HCR in the callers, and this will be especially important for interpreting HCR in a non-current security state. Reviewed-by: Peter Maydell Signed-off-by: R

[PATCH v3 12/42] target/arm: Drop secure check for HCR.TGE vs SCTLR_EL1.M

2022-10-01 Thread Richard Henderson
The effect of TGE does not only apply to non-secure state, now that Secure EL2 exists. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 2875ea881c..1

[PATCH v3 13/42] target/arm: Introduce arm_hcr_el2_eff_secstate

2022-10-01 Thread Richard Henderson
For page walking, we may require HCR for a security state that is not "current". Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h| 20 +--- target/arm/helper.c | 11 --- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/

[PATCH v3 09/42] target/arm: Add is_secure parameter to do_ats_write

2022-10-01 Thread Richard Henderson
Use get_phys_addr_with_secure directly. For a-profile, this is the one place where the value of is_secure may not equal arm_is_secure(env). Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletion

[PATCH v3 11/42] target/arm: Reorg regime_translation_disabled

2022-10-01 Thread Richard Henderson
Use a switch on mmu_idx for the a-profile indexes, instead of three different if's vs regime_el and arm_mmu_idx_is_stage1_of_2. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-

[PATCH v3 10/42] target/arm: Fold secure and non-secure a-profile mmu indexes

2022-10-01 Thread Richard Henderson
For a-profile aarch64, which does not bank system registers, it takes quite a lot of code to switch between security states. In the process, registers such as TCR_EL{1,2} must be swapped, which in itself requires the flushing of softmmu tlbs. Therefore it doesn't buy us anything to separate tlbs

[PATCH v3 08/42] target/arm: Merge regime_is_secure into get_phys_addr

2022-10-01 Thread Richard Henderson
This is the last use of regime_is_secure; remove it entirely before changing the layout of ARMMMUIdx. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/internals.h | 42 target/arm/ptw.c | 44 +++

[PATCH v3 06/42] target/arm: Add is_secure parameter to v7m_read_half_insn

2022-10-01 Thread Richard Henderson
Remove the use of regime_is_secure from v7m_read_half_insn, using the new parameter instead. As it happens, both callers pass true, propagated from the argument to arm_v7m_mmu_idx_for_secstate which created the mmu_idx argument, but that is a detail of v7m_handle_execute_nsc we need not expose to

[PATCH v3 05/42] target/arm: Split out get_phys_addr_with_secure

2022-10-01 Thread Richard Henderson
Retain the existing get_phys_addr interface using the security state derived from mmu_idx. Move the kerneldoc comments to the header file where they belong. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v3: Move the kerneldoc to internals.h --- target/arm/internals.h | 40 +++

[PATCH v3 07/42] target/arm: Add TBFLAG_M32.SECURE

2022-10-01 Thread Richard Henderson
Remove the use of regime_is_secure from arm_tr_init_disas_context. Instead, provide the value of v8m_secure directly from tb_flags. Rather than use regime_is_secure, use the env->v7m.secure directly, as per arm_mmu_idx_el. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/a

[PATCH v3 02/42] target/arm: Add is_secure parameter to get_phys_addr_lpae

2022-10-01 Thread Richard Henderson
Remove the use of regime_is_secure from get_phys_addr_lpae, using the new parameter instead. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- v3: Update to use s2walk_secure. --- target/arm/ptw.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --g

[PATCH v3 03/42] target/arm: Fix S2 disabled check in S1_ptw_translate

2022-10-01 Thread Richard Henderson
Pass the correct stage2 mmu_idx to regime_translation_disabled, which we computed afterward. Signed-off-by: Richard Henderson --- v3: Move earlier in the patch set. --- target/arm/ptw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c

[PATCH v3 01/42] target/arm: Split s2walk_secure from ipa_secure in get_phys_addr

2022-10-01 Thread Richard Henderson
The starting security state comes with the translation regime, not the current state of arm_is_secure_below_el3(). Create a new local variable, s2walk_secure, which does not need to be written back to result->attrs.secure -- we compute that value later, after the S2 walk is complete. Signed-off-b

[PATCH v3 00/42] target/arm: Implement FEAT_HAFDBS

2022-10-01 Thread Richard Henderson
This is a major reorg to arm page table walking. While the result here is "merely" Hardware-assited Access Flag and Dirty Bit Setting (HAFDBS), the ultimate goal is the Realm Management Extension (RME). RME "recommends" that HAFDBS be implemented (I_CSLWZ). For HAFDBS, being able to find a host p

[PATCH v3 04/42] target/arm: Add is_secure parameter to regime_translation_disabled

2022-10-01 Thread Richard Henderson
Remove the use of regime_is_secure from regime_translation_disabled, using the new parameter instead. This fixes a bug in S1_ptw_translate and get_phys_addr where we had passed ARMMMUIdx_Stage2 and not ARMMMUIdx_Stage2_S to determine if Stage2 is disabled, affecting FEAT_SEL2. Reviewed-by: Peter

Re: [PATCH v1 0/8] migration: introduce dirtylimit capability

2022-10-01 Thread Hyman Huang
在 2022/10/1 22:37, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) v1: - make parameter vcpu-dirty-limit experimental - switch dirty limit off when cancel migrate - add cancel logic in migration test Please review, thanks, Yong Are you still pursuing this f

[PATCH v3 25/26] target/i386: Inline gen_jmp_im

2022-10-01 Thread Richard Henderson
Expand this function at each of its callers. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index f08fa060c4..689a45256c 100644 --- a/t

[PATCH v3 23/26] target/i386: Create eip_cur_tl

2022-10-01 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 2e7b94700b..5b0dab8633 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translat

Re: [PATCH v1 0/8] migration: introduce dirtylimit capability

2022-10-01 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > v1: > - make parameter vcpu-dirty-limit experimental > - switch dirty limit off when cancel migrate > - add cancel logic in migration test > > Please review, thanks, > > Yong Are you still pursuing this feature? > Abstract > ==

[PATCH v3 26/26] target/i386: Enable TARGET_TB_PCREL

2022-10-01 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/i386/cpu-param.h | 4 ++ target/i386/tcg/tcg-cpu.c | 8 ++- target/i386/tcg/translate.c | 130 3 files changed, 113 insertions(+), 29 deletions(-) diff --git a/target/i386/cpu-param.h b/target/i386/cpu-par

[PATCH v3 22/26] target/i386: Merge gen_jmp_tb and gen_goto_tb into gen_jmp_rel

2022-10-01 Thread Richard Henderson
These functions have only one caller, and the logic is more obvious this way. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 50 + 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg

[PATCH v3 19/26] target/i386: Use gen_jmp_rel for gen_jcc

2022-10-01 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 57 - 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 434a6ad6cd..5b84be4975 100644 --- a/target/i386/tcg/translat

[PATCH v3 16/26] target/i386: Use DISAS_TOO_MANY to exit after gen_io_start

2022-10-01 Thread Richard Henderson
We can set is_jmp early, using only one if, and let that be overwritten by gen_rep*'s calls to gen_jmp_tb. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 42 + 1 file changed, 10 insertions(+), 32 deletions(-) d

[PATCH v3 24/26] target/i386: Add cpu_eip

2022-10-01 Thread Richard Henderson
Create a tcg global temp for this, and use it instead of explicit stores. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 5b0dab8633

[PATCH v3 15/26] target/i386: Create eip_next_*

2022-10-01 Thread Richard Henderson
Create helpers for loading the address of the next insn. Use tcg_constant_* in adjacent code where convenient. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 55 +++-- 1 file changed, 34 insertions(+), 21 deletions(-

[PATCH v3 20/26] target/i386: Use gen_jmp_rel for DISAS_TOO_MANY

2022-10-01 Thread Richard Henderson
With gen_jmp_rel, we may chain between two translation blocks which may only be separated because of TB size limits. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/tcg/translate.c b/t

[PATCH v3 14/26] target/i386: Truncate values for lcall_real to i32

2022-10-01 Thread Richard Henderson
Use i32 not int or tl for eip and cs arguments. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/helper.h | 2 +- target/i386/tcg/seg_helper.c | 6 ++ target/i386/tcg/translate.c | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/targ

[PATCH v3 18/26] target/i386: Use gen_jmp_rel for loop, repz, jecxz insns

2022-10-01 Thread Richard Henderson
With gen_jmp_rel, we may chain to the next tb instead of merely writing to eip and exiting. For repz, subtract cur_insn_len to restart the current insn. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 36 +++- 1 file changed, 15 insertions(+),

[PATCH v3 05/26] target/i386: Create gen_update_eip_cur

2022-10-01 Thread Richard Henderson
Like gen_update_cc_op, sync EIP before doing something that could raise an exception. Replace all gen_jmp_im that use s->base.pc_next. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 52 - 1 file changed, 28 inse

[PATCH v3 21/26] target/i386: Remove MemOp argument to gen_op_j*_ecx

2022-10-01 Thread Richard Henderson
These functions are always passed aflag, so we might as well read it from DisasContext directly. While we're at it, use a common subroutine for these two functions. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 31 --- 1 file changed, 16 insertio

[PATCH v3 12/26] target/i386: Remove cur_eip, next_eip arguments to gen_repz*

2022-10-01 Thread Richard Henderson
All callers pass s->base.pc_next and s->pc, which we can just as well compute within the functions. Pull out common helpers and reduce the amount of code under macros. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 116 ++--

[PATCH v3 03/26] target/i386: Remove cur_eip argument to gen_exception

2022-10-01 Thread Richard Henderson
All callers pass s->base.pc_next - s->cs_base, which we can just as well compute within the function. Note the special case of EXCP_VSYSCALL in which s->cs_base wasn't subtracted, but cs_base is always zero in 64-bit mode, when vsyscall is used. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe M

[PATCH v3 17/26] target/i386: Create gen_jmp_rel

2022-10-01 Thread Richard Henderson
Create a common helper for pc-relative branches. The jmp jb insn was missing a mask for CODE32. In all cases the CODE64 check was incorrectly placed, allowing PREFIX_DATA to truncate %rip to 16 bits. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 58 ++--

[PATCH v3 10/26] target/i386: USe DISAS_EOB_ONLY

2022-10-01 Thread Richard Henderson
Replace lone calls to gen_eob() with the new enumerator. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 7

[PATCH v3 13/26] target/i386: Introduce DISAS_JUMP

2022-10-01 Thread Richard Henderson
Drop the unused dest argument to gen_jr(). Remove most of the calls to gen_jr, and use DISAS_JUMP. Remove some unused loads of eip for lcall and ljmp. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 24 +--- 1 file changed, 13 in

[PATCH v3 08/26] target/i386: Use DISAS_EOB* in gen_movl_seg_T0

2022-10-01 Thread Richard Henderson
Set is_jmp properly in gen_movl_seg_T0, so that the callers need to nothing special. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 36 +--- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/target/i386/

[PATCH v3 11/26] target/i386: Create cur_insn_len, cur_insn_len_i32

2022-10-01 Thread Richard Henderson
Create common routines for computing the length of the insn. Use tcg_constant_i32 in the new function, while we're at it. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 31 +++ 1 file

[PATCH v3 02/26] target/i386: Return bool from disas_insn

2022-10-01 Thread Richard Henderson
Instead of returning the new pc, which is present in DisasContext, return true if an insn was translated. This is false when we detect a page crossing and must undo the insn under translation. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c |

[PATCH v3 04/26] target/i386: Remove cur_eip, next_eip arguments to gen_interrupt

2022-10-01 Thread Richard Henderson
All callers pass s->base.pc_next and s->pc, which we can just as well compute within the function. Adjust to use tcg_constant_i32 while we're at it. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 13 ++-

[PATCH v3 06/26] target/i386: Create gen_update_eip_next

2022-10-01 Thread Richard Henderson
Sync EIP before exiting a translation block. Replace all gen_jmp_im that use s->pc. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 45 - 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/target/i386

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

2022-10-01 Thread Richard Henderson
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 Paolo's feedback. r~ Based-on: 20220930212622.108363-1-richard.hender...@linaro.org ("[PATCH v6 00/18] tcg: CPUTLBEntryFull and TARGET_TB_PCREL")

[PATCH v3 01/26] target/i386: Remove pc_start

2022-10-01 Thread Richard Henderson
The DisasContext member and the disas_insn local variable of the same name are identical to DisasContextBase.pc_next. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 114 +++- 1 file changed, 60 insertions(+), 54 dele

[PATCH v3 07/26] target/i386: Introduce DISAS_EOB*

2022-10-01 Thread Richard Henderson
Add a few DISAS_TARGET_* aliases to reduce the number of calls to gen_eob() and gen_eob_inhibit_irq(). So far, only update i386_tr_translate_insn for exiting the block because of single-step or previous inhibit irq. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tc

[PATCH v3 09/26] target/i386: Use DISAS_EOB_NEXT

2022-10-01 Thread Richard Henderson
Replace sequences of gen_update_cc_op, gen_update_eip_next, and gen_eob with the new is_jmp enumerator. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 40 - 1 file changed, 13 insertions(+), 27 deletions(-) diff

Re: [PATCH v9 3/4] target/riscv: smstateen check for fcsr

2022-10-01 Thread mchitale
On Thu, 2022-09-29 at 09:09 +0800, weiwei wrote: > On 2022/9/19 14:29, Mayuresh Chitale wrote: > > If smstateen is implemented and sstateen0.fcsr is clear then the > > floating point > > operations must return illegal instruction exception or virtual > > instruction > > trap, if relevant. > > > >

Re: [PATCH v2 19/23] target/i386: Use gen_jmp_rel for gen_jcc

2022-10-01 Thread Richard Henderson
On 10/1/22 00:03, Paolo Bonzini wrote: On Sat, Oct 1, 2022 at 3:04 AM Richard Henderson wrote: On 9/21/22 06:09, Paolo Bonzini wrote: On Tue, Sep 6, 2022 at 12:09 PM Richard Henderson wrote: +gen_jcc1(s, b, l1); +gen_jmp_rel(s, ot, 0, 1); +gen_set_label(l1); +gen_jmp_rel(s,

Re: [PATCH v9 1/4] target/riscv: Add smstateen support

2022-10-01 Thread mchitale
On Thu, 2022-09-29 at 11:43 +1000, Alistair Francis wrote: > On Thu, Sep 29, 2022 at 10:58 AM weiwei wrote: > > > > On 2022/9/19 14:29, Mayuresh Chitale wrote: > > > Smstateen extension specifies a mechanism to close > > > the potential covert channels that could cause security issues. > > > > >

Re: [PATCH 5/6] rx: re-randomize rng-seed on reboot

2022-10-01 Thread Yoshinori Sato
On Fri, 30 Sep 2022 08:23:38 +0900, Jason A. Donenfeld wrote: > > When the system reboots, the rng-seed that the FDT has should be > re-randomized, so that the new boot gets a new seed. Since the FDT is in > the ROM region at this point, we add a hook right after the ROM has been > added, so that

Re: [PATCH v4 26/54] fsdev/virtfs-proxy-helper: Use g_mkdir()

2022-10-01 Thread Christian Schoenebeck
On Samstag, 1. Oktober 2022 05:48:18 CEST Bin Meng wrote: > Hi Christian, > > On Tue, Sep 27, 2022 at 7:07 PM Bin Meng wrote: > > From: Bin Meng > > > > Use g_mkdir() to create a directory on all platforms. > > > > Signed-off-by: Bin Meng > > Reviewed-by: Christian Schoenebeck > > --- > > >

Re: [PATCH 11/12] audio: fix sw->buf size for audio recording

2022-10-01 Thread Volker Rümelin
Am 27.09.22 um 13:54 schrieb Marc-André Lureau: On Fri, Sep 23, 2022 at 10:48 PM Volker Rümelin wrote: The calculation of the buffer size needed to store audio samples after resampling is wrong for audio recording. For audio recording sw->ratio is calculated as sw->ratio =

Re: [PATCH v2] tests/9p: split virtio-9p-test.c into tests and 9p client part

2022-10-01 Thread Christian Schoenebeck
On Donnerstag, 29. September 2022 13:41:06 CEST Christian Schoenebeck wrote: > This patch is pure refactoring, it does not change behaviour. > > virtio-9p-test.c grew to 1657 lines. Let's split this file up between > actual 9p test cases vs. 9p test client, to make it easier to > concentrate on th

Re: [PATCH v2 19/23] target/i386: Use gen_jmp_rel for gen_jcc

2022-10-01 Thread Paolo Bonzini
On Sat, Oct 1, 2022 at 3:04 AM Richard Henderson wrote: > > On 9/21/22 06:09, Paolo Bonzini wrote: > > On Tue, Sep 6, 2022 at 12:09 PM Richard Henderson > > wrote: > > > +gen_jcc1(s, b, l1); > > > +gen_jmp_rel(s, ot, 0, 1); > > > +gen_set_label(l1); > > > +gen_jmp_rel(s, ot, diff,