[PATCH 1/2] tests/tcg/multiarch: Read fp flags before printf

2021-12-23 Thread Richard Henderson
We need to read the floating-point flags before printf may do other floating-point operations which may affect the flags. Hexagon reference files regenerated by Taylor Simpson. Signed-off-by: Taylor Simpson Signed-off-by: Richard Henderson Message-Id: <1639510781-3790-1-git-send-email-tsimp...@

[PATCH 0/2] tests/tcg: Fix float_{convs,madds}

2021-12-23 Thread Richard Henderson
We didn't read the fp flags early enough, so we got whatever came out of the guest printf. With careful review of the hexagon output, we would have seen this long ago. r~ Richard Henderson (2): tests/tcg/multiarch: Read fp flags before printf test/tcg/ppc64le: Add float reference files t

Re: [PATCH v3 kvm/queue 06/16] KVM: Implement fd-based memory using MEMFD_OPS interfaces

2021-12-23 Thread Chao Peng
On Thu, Dec 23, 2021 at 06:34:22PM +, Sean Christopherson wrote: > On Thu, Dec 23, 2021, Chao Peng wrote: > > diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig > > index 03b2ce34e7f4..86655cd660ca 100644 > > --- a/arch/x86/kvm/Kconfig > > +++ b/arch/x86/kvm/Kconfig > > @@ -46,6 +46,7 @@

Re: [PATCH v3 kvm/queue 11/16] KVM: Add kvm_map_gfn_range

2021-12-23 Thread Chao Peng
On Thu, Dec 23, 2021 at 06:06:19PM +, Sean Christopherson wrote: > On Thu, Dec 23, 2021, Chao Peng wrote: > > This new function establishes the mapping in KVM page tables for a > > given gfn range. It can be used in the memory fallocate callback for > > memfd based memory to establish the mappi

Re: [PATCH v3 kvm/queue 06/16] KVM: Implement fd-based memory using MEMFD_OPS interfaces

2021-12-23 Thread Chao Peng
On Thu, Dec 23, 2021 at 06:34:22PM +, Sean Christopherson wrote: > On Thu, Dec 23, 2021, Chao Peng wrote: > > > > -kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o > > +kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o > > $(KVM)/memfd.o > > This should be >

Re: [PATCH v3 kvm/queue 06/16] KVM: Implement fd-based memory using MEMFD_OPS interfaces

2021-12-23 Thread Chao Peng
On Fri, Dec 24, 2021 at 12:09:47AM +0100, Paolo Bonzini wrote: > On 12/23/21 19:34, Sean Christopherson wrote: > > > select HAVE_KVM_PM_NOTIFIER if PM > > > + select MEMFD_OPS > > MEMFD_OPS is a weird Kconfig name given that it's not just memfd() that can > > implement the ops. > > > >

Re: [PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2021-12-23 Thread Peter Xu
On Tue, Dec 14, 2021 at 07:07:33PM +0800, huang...@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) > > Setup a negative feedback system when vCPU thread > handling KVM_EXIT_DIRTY_RING_FULL exit by introducing > throttle_us_per_full field in struct CPUState. Sleep > throttle_us_per_full microsecond

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-23 Thread Peter Xu
On Tue, Dec 14, 2021 at 07:07:34PM +0800, huang...@chinatelecom.cn wrote: > +void qmp_vcpu_dirty_limit(bool enable, > + bool has_cpu_index, > + uint64_t cpu_index, > + bool has_dirty_rate, > + uint64

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-23 Thread Peter Xu
On Thu, Dec 16, 2021 at 11:23:37AM +0100, Markus Armbruster wrote: > Hyman Huang writes: > > [...] > > > So the final format of qmp we conclude are: > > > > case 1: setup vcpu 0 dirty page limit 100MB/s > > set-vcpu-dirty-limit cpu-index=0 dirty-rate=100 > > > > case 2: setup all vcpu dirty page

Re: [PATCH v10 0/3] support dirty restraint on vCPU

2021-12-23 Thread Peter Xu
On Tue, Dec 14, 2021 at 07:07:31PM +0800, huang...@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) > > v10: > - rebase on master > - make the following modifications on patch [1/3]: > 1. Make "dirtylimit-calc" thread joinable and join it after quitting. > > 2. Add finalize function to free di

[PATCH v3 2/8] migration: Don't return for postcopy_chunk_hostpages()

2021-12-23 Thread Peter Xu
It always return zero, because it just can't go wrong so far. Simplify the code with no functional change. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration

[PATCH v3 0/8] migration: Postcopy cleanup on ram disgard

2021-12-23 Thread Peter Xu
v3: - s/disgard/discard/, s/exit/return/ [DavidE] v2: - add r-bs for Dave - move mig_cmd_args reference later than index bound check [Dave] - use chars in tracepoints instead of number of steps [Dave] - add one patch for postcopy-run tracing Some queued patches for ram disgard cleanup, and some d

[PATCH v3 4/8] migration: Do chunk page in postcopy_each_ram_send_discard()

2021-12-23 Thread Peter Xu
Right now we loop ramblocks for twice, the 1st time chunk the dirty bits with huge page information; the 2nd time we send the discard ranges. That's not necessary - we can do them in a single loop. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 20 ++-

[PATCH v3 3/8] migration: Drop postcopy_chunk_hostpages()

2021-12-23 Thread Peter Xu
This function calls three functions: - postcopy_discard_send_init(ms, block->idstr); - postcopy_chunk_hostpages_pass(ms, block); - postcopy_discard_send_finish(ms); However only the 2nd function call is meaningful. It's major role is to make sure dirty bits are applied in host-page-size gr

[PATCH v3 6/8] migration: Dump sub-cmd name in loadvm_process_command tp

2021-12-23 Thread Peter Xu
It'll be easier to read the name rather than index of sub-cmd when debugging. Signed-off-by: Peter Xu --- migration/savevm.c | 3 ++- migration/trace-events | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 0bef031acb..7f7af6

[PATCH v3 8/8] migration: Tracepoint change in postcopy-run bottom half

2021-12-23 Thread Peter Xu
Remove the old two tracepoints and they're even near each other: trace_loadvm_postcopy_handle_run_cpu_sync() trace_loadvm_postcopy_handle_run_vmstart() Add trace_loadvm_postcopy_handle_run_bh() with a finer granule trace. Signed-off-by: Peter Xu --- migration/savevm.c | 12

[PATCH v3 5/8] migration: Drop return code for disgard ram process

2021-12-23 Thread Peter Xu
It will just never fail. Drop those return values where they're constantly zeros. A tiny touch-up on the tracepoint so trace_ram_postcopy_send_discard_bitmap() is called after the logic itself (which sounds more reasonable). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migr

[PATCH v3 1/8] migration: Drop dead code of ram_debug_dump_bitmap()

2021-12-23 Thread Peter Xu
I planned to add "#ifdef DEBUG_POSTCOPY" around the function too because otherwise it'll be compiled into qemu binary even if it'll never be used. Then I found that maybe it's easier to just drop it for good.. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 39

Re: [PATCH v2 1/6] migration: All this fields are unsigned

2021-12-23 Thread Peter Xu
On Tue, Dec 21, 2021 at 01:52:30PM +0100, Juan Quintela wrote: > So printing it as %d is wrong. Notice that for the channel id, that > is an uint8_t, but I changed it anyways for consistency. Just curious: uint_8 can always correctly converted to a int, so the patch shouldn't have a functional ch

[PATCH v3 7/8] migration: Finer grained tracepoints for POSTCOPY_LISTEN

2021-12-23 Thread Peter Xu
The enablement of postcopy listening has a few steps, add a few tracepoints to be there ready for some basic measurements for them. Signed-off-by: Peter Xu --- migration/savevm.c | 9 - migration/trace-events | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/migr

Re: [PATCH v2 2/6] migration: We only need last_stage in two places

2021-12-23 Thread Peter Xu
On Tue, Dec 21, 2021 at 01:52:31PM +0100, Juan Quintela wrote: > We only need last_stage in two places and we are passing it all > around. Just add a field to RAMState that passes it. > > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- Peter Xu

[PATCH v2] vl: Add support to set properties when using JSON syntax for -device via -set option

2021-12-23 Thread MkfsSion
When using JSON syntax for -device, -set option can not find device specified in JSON by id field. The following commandline is an example: $ qemu-system-x86_64 -device '{"id":"foo"}' -set device.foo.bar=1 qemu-system-x86_64: -set device.foo.bar=1: there is no device "foo" defined The patch fixes

Re: [PATCH v2 6/6] migration: Move ram_release_pages() call to save_zero_page_to_file()

2021-12-23 Thread Peter Xu
On Tue, Dec 21, 2021 at 01:52:35PM +0100, Juan Quintela wrote: > We always need to call it when we find a zero page, so put it in a > single place. > > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH v2 3/6] migration: ram_release_pages() always receive 1 page as argument

2021-12-23 Thread Peter Xu
On Tue, Dec 21, 2021 at 01:52:32PM +0100, Juan Quintela wrote: > -static void ram_release_pages(const char *rbname, uint64_t offset, int pages) > +static void ram_release_page(const char *rbname, uint64_t offset) > { > if (!migrate_release_ram() || !migration_in_postcopy()) { > retur

Re: [PATCH v2 5/6] migration: simplify do_compress_ram_page

2021-12-23 Thread Peter Xu
On Tue, Dec 21, 2021 at 02:29:13PM +0100, Philippe Mathieu-Daudé wrote: > On 12/21/21 13:52, Juan Quintela wrote: > > The goto is not needed at all. > > > > Signed-off-by: Juan Quintela > > --- > > migration/ram.c | 11 +++ > > 1 file changed, 3 insertions(+), 8 deletions(-) > > > > dif

<    1   2   3