Re: [PATCH v2 01/11] dirtylimit: Fix overflow when computing MB

2022-12-03 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > overity points out a overflow problem when computing MB, Coverity > dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, > multiplication will be done as a 32-bit operation, which > could overflow. Simplify the formula. > > Meanwhil

Re: [PATCH v2 02/11] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit"

2022-12-03 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > dirty_rate paraemter of hmp command "set_vcpu_dirty_limit" is invalid > if less than 0, so add parameter check for it. > > Signed-off-by: Hyman Huang(黄勇) > --- > softmmu/dirtylimit.c | 5 + > 1 file changed, 5 insertions(+) > > di

Re: [PATCH v2 04/11] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-12-03 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > Introduce "x-vcpu-dirty-limit-period" migration experimental > parameter, which is in the range of 1 to 1000ms and used to > make dirtyrate calculation period configurable. > > Signed-off-by: Hyman Huang(黄勇) [...] > diff --git a/qapi

Re: [PATCH v2 04/11] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-12-03 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > Introduce "x-vcpu-dirty-limit-period" migration experimental > parameter, which is in the range of 1 to 1000ms and used to > make dirtyrate calculation period configurable. > > Signed-off-by: Hyman Huang(黄勇) > --- > migration/migratio

Re: [PATCH v2 05/11] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-12-03 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > Introduce "vcpu-dirty-limit" migration parameter used > to limit dirty page rate during live migration. > > "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are > two dirty-limit-related migration parameters, which can > be set before

Re: [PATCH v2 08/11] migration: Export dirty-limit time info

2022-12-03 Thread Hyman
在 2022/11/22 0:26, huang...@chinatelecom.cn 写道: 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(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ mig

Re: [PATCH v2 05/11] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-12-03 Thread Markus Armbruster
Markus Armbruster writes: > huang...@chinatelecom.cn writes: > >> From: Hyman Huang(黄勇) >> >> Introduce "vcpu-dirty-limit" migration parameter used >> to limit dirty page rate during live migration. >> >> "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are >> two dirty-limit-related migration

Re: [PATCH v2 06/11] migration: Introduce dirty-limit capability

2022-12-03 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > Introduce migration dirty-limit capability, which can > be turned on before live migration and limit dirty > page rate durty live migration. > > Introduce migrate_dirty_limit function to help check > if dirty-limit capability enabled du

Re: [PATCH v2 08/11] migration: Export dirty-limit time info

2022-12-03 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

Re: [PATCH v2 08/11] migration: Export dirty-limit time info

2022-12-03 Thread Markus Armbruster
Hyman writes: > 在 2022/11/22 0:26, huang...@chinatelecom.cn 写道: >> 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(黄勇) >> --- >> include/s

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-03 Thread Zhipeng Lu
Could you give the detail qemu cmdline about usb-bot? 在 2022/12/2 17:40, Paolo Bonzini 写道: On 12/2/22 03:26, Zhipeng Lu wrote: NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT sda 8:0    0  100M  1 disk vda   252:0    0   10G  0 disk ├─vda1    252:1    0    1G  0 part /

[PATCH] docs/acpi/bits: document BITS_DEBUG environment variable

2022-12-03 Thread Ani Sinha
Debug specific actions can be enabled in bios bits acpi tests by passing BITS_DEBUG in the environment variable while running the test. Document that. CC: qemu-triv...@nongnu.org Signed-off-by: Ani Sinha --- docs/devel/acpi-bits.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/dev

[PATCH] acpi/tests/avocado/bits: add mformat as one of the dependencies

2022-12-03 Thread Ani Sinha
mformat is needed by grub-mkrescue and hence, add this as one of the dependencies to run bits tests. This avoids errors such as the following: /var/tmp/acpi-bits-wju6tqoa.tmp/grub-inst-x86_64-efi/bin/grub-mkrescue: 360: mformat: not found Signed-off-by: Ani Sinha --- tests/avocado/acpi-bits.py

[PATCH v3 02/10] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit"

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) dirty_rate paraemter of hmp command "set_vcpu_dirty_limit" is invalid if less than 0, so add parameter check for it. Note that this patch also delete the unsolicited help message and clean up the code. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Markus Armbruster Revie

[PATCH v3 08/10] migration: Implement dirty-limit convergence algo

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Enable dirty page limit if dirty_rate_high_cnt greater than 2 when dirty-limit capability enabled,

[PATCH v3 05/10] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH v3 06/10] migration: Introduce dirty-limit capability

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH v3 04/10] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is in the range of 1 to 1000ms and used to make dirtyrate calculation period configurable. Currently with the "x-vcpu-dirty-limit-period" varies, the total time of live migration changes, test res

[PATCH v3 10/10] tests: Add migration dirty-limit capability test

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The te

[PATCH v3 00/10] migration: introduce dirtylimit capabilit

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) v3: This version make some modifications inspired by Peter and Markus as following: 1. Do the code clean up in [PATCH v2 02/11] suggested by Markus 2. Replace the [PATCH v2 03/11] with a much simpler patch posted by Peter to fix the following bug: https://bugzilla.red

[PATCH v3 01/10] dirtylimit: Fix overflow when computing MB

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

[PATCH v3 09/10] migration: Export dirty-limit time info for observation

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe if dirty limit take effect during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH v3 03/10] kvm: dirty-ring: Fix race with vcpu creation

2022-12-03 Thread huangy81
From: Peter Xu It's possible that we want to reap a dirty ring on a vcpu that is during creation, because the vcpu is put onto list (CPU_FOREACH visible) before initialization of the structures. In this case: qemu_init_vcpu x86_cpu_realizefn cpu_exec_realizefn cpu_list_a

[PATCH v3 07/10] migration: Refactor auto-converge capability logic

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Check if block migration is running before throttling guest down in auto-converge way. Note that this modification is kind of like code clean, because block migration does not depend on auto-converge capability, so the order of checks can be adjusted. Signed-off-by: Hyman

[PATCH RESEND v3 04/10] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is in the range of 1 to 1000ms and used to make dirtyrate calculation period configurable. Currently with the "x-vcpu-dirty-limit-period" varies, the total time of live migration changes, test res

[PATCH RESEND v3 08/10] migration: Implement dirty-limit convergence algo

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Enable dirty page limit if dirty_rate_high_cnt greater than 2 when dirty-limit capability enabled,

[PATCH RESEND v3 05/10] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH RESEND v3 03/10] kvm: dirty-ring: Fix race with vcpu creation

2022-12-03 Thread huangy81
From: Peter Xu It's possible that we want to reap a dirty ring on a vcpu that is during creation, because the vcpu is put onto list (CPU_FOREACH visible) before initialization of the structures. In this case: qemu_init_vcpu x86_cpu_realizefn cpu_exec_realizefn cpu_list_a

[PATCH RESEND v3 07/10] migration: Refactor auto-converge capability logic

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Check if block migration is running before throttling guest down in auto-converge way. Note that this modification is kind of like code clean, because block migration does not depend on auto-converge capability, so the order of checks can be adjusted. Signed-off-by: Hyman

[PATCH RESEND v3 10/10] tests: Add migration dirty-limit capability test

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The te

[PATCH RESEND v3 00/10] migration: introduce dirtylimit capability

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) v3(resend): - fix the syntax error of the topic. v3: This version make some modifications inspired by Peter and Markus as following: 1. Do the code clean up in [PATCH v2 02/11] suggested by Markus 2. Replace the [PATCH v2 03/11] with a much simpler patch posted by Peter

[PATCH RESEND v3 01/10] dirtylimit: Fix overflow when computing MB

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

[PATCH RESEND v3 09/10] migration: Export dirty-limit time info for observation

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe if dirty limit take effect during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH RESEND v3 06/10] migration: Introduce dirty-limit capability

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH RESEND v3 02/10] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit"

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) dirty_rate paraemter of hmp command "set_vcpu_dirty_limit" is invalid if less than 0, so add parameter check for it. Note that this patch also delete the unsolicited help message and clean up the code. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Markus Armbruster Revie

[PATCH] target/riscv: Set pc_succ_insn for !rvc illegal insn

2022-12-03 Thread Richard Henderson
Failure to set pc_succ_insn may result in a TB covering zero bytes, which triggers an assert within the code generator. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1224 Signed-off-by: Richard Henderson --- target/riscv/translate.c | 12

[PATCH 3/6] hw/i2c: Allwinner TWI/I2C Emulation

2022-12-03 Thread Strahinja Jankovic
This patch implements Allwinner TWI/I2C controller emulation. Only master-mode functionality is implemented. The SPL boot for Cubieboard expects AXP209 PMIC on TWI0/I2C0 bus, so this is first part enabling the TWI/I2C bus operation. Since both Allwinner A10 and H3 use the same module, it is added

[PATCH 4/6] hw/misc: Allwinner AXP-209 Emulation

2022-12-03 Thread Strahinja Jankovic
This patch adds minimal support for AXP-209 PMU. Most important is chip ID since U-Boot SPL expects version 0x1. Besides the chip ID register, reset values for two more registers used by A10 U-Boot SPL are covered. Signed-off-by: Strahinja Jankovic --- hw/arm/Kconfig | 1 + hw/mis

[PATCH 5/6] hw/arm: Add AXP-209 to Cubieboard

2022-12-03 Thread Strahinja Jankovic
SPL Boot for Cubieboard expects AXP-209 connected to I2C0 bus. Signed-off-by: Strahinja Jankovic --- hw/arm/cubieboard.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 5e3372a3c7..afc7980414 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/

[PATCH 0/6] Enable Cubieboard A10 boot SPL from SD card

2022-12-03 Thread Strahinja Jankovic
This patch series adds missing Allwinner A10 modules needed for successful SPL boot: - Clock controller module - DRAM controller - I2C0 controller (added also for Allwinner H3 since it is the same) - AXP-209 connected to I2C0 bus It also updates Allwinner A10 emulation so SPL is copied from attach

[PATCH 2/6] hw/misc: Allwinner A10 DRAM Controller Emulation

2022-12-03 Thread Strahinja Jankovic
During SPL boot several DRAM Controller registers are used. Most important registers are those related to DRAM initialization and calibration, where SPL initiates process and waits until certain bit is set/cleared. This patch adds these registers, initializes reset values from user's guide and upd

[PATCH 1/6] hw/misc: Allwinner-A10 Clock Controller Module Emulation

2022-12-03 Thread Strahinja Jankovic
During SPL boot several Clock Controller Module (CCM) registers are read, most important are PLL and Tuning, as well as divisor registers. This patch adds these registers and initializes reset values from user's guide. Signed-off-by: Strahinja Jankovic --- hw/arm/Kconfig |

[PATCH 6/6] hw/arm: Allwinner A10 enable SPL load from MMC

2022-12-03 Thread Strahinja Jankovic
This patch enables copying of SPL from MMC if `-kernel` parameter is not passed when starting QEMU. SPL is copied to SRAM_A. The approach is reused from Allwinner H3 implementation. Tested with Armbian and custom Yocto image. Signed-off-by: Strahinja Jankovic --- hw/arm/allwinner-a10.c

[PATCH] configure: Add --enable-lto

2022-12-03 Thread Richard Henderson
Separately control b_lto without --enable-cfi. Also add --disable-lto for completeness. Signed-off-by: Richard Henderson --- configure | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 26c7bc5154..d9c9babfc3 100755 --- a/configure +++ b/co

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

2022-12-03 Thread Richard Henderson
On 12/1/22 08:22, Alex Bennée wrote: Richard Henderson writes: 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

[PATCH 1/2] util/bufferiszero: Use __attribute__((target)) for avx2/avx512

2022-12-03 Thread Richard Henderson
Use the attribute, which is supported by clang, instead of the #pragma, which is not supported and, for some reason, also not detected by the meson probe, so we fail by -Werror. Signed-off-by: Richard Henderson --- meson.build | 8 ++-- util/bufferiszero.c | 41 ++---

[PATCH 2/2] meson: Set avx512f option to auto

2022-12-03 Thread Richard Henderson
I'm not sure why this option wasn't set the same as avx2. Signed-off-by: Richard Henderson --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 4b749ca549..f98ee101e2 100644 --- a/meson_options.txt +++ b/meson_optio

[PATCH v2 0/2] Use a more portable way to enable target specific functions

2022-12-03 Thread Richard Henderson
This is a revision of Tom Stellard's patch from last month which also removes the use of the #pragma. Also, tweak --enable/disable-avx512f. r~ Richard Henderson (2): util/bufferiszero: Use __attribute__((target)) for avx2/avx512 meson: Set avx512f option to auto meson.build | 8

Re: [PULL 02/10] pci-bridge/cxl_downstream: Add a CXL switch downstream port

2022-12-03 Thread Thomas Huth
On 04/11/2022 07.47, Thomas Huth wrote: On 16/06/2022 18.57, Michael S. Tsirkin wrote: From: Jonathan Cameron Emulation of a simple CXL Switch downstream port. The Device ID has been allocated for this use. Signed-off-by: Jonathan Cameron Message-Id: <20220616145126.8002-3-jonathan.came...@h

[PULL 3/3] hw/display/next-fb: Fix comment typo

2022-12-03 Thread Thomas Huth
From: Evgeny Ermakov Signed-off-by: Evgeny Ermakov Message-Id: <20221125160849.23711-1-evgeny.v.erma...@gmail.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Thomas Huth --- hw/display/next-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PULL 0/3] Optional fixes for inclusion into QEMU 7.2.0-rc4

2022-12-03 Thread Thomas Huth
Hi Stefan! The following changes since commit c4ffd91aba1c3d878e99a3e7ba8aad4826728ece: Update VERSION for v7.2.0-rc3 (2022-11-29 18:15:26 -0500) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull-request-2022-12-04 for you to fetch changes up to c1966f515

[PULL 2/3] target/s390x/tcg: Fix and improve the SACF instruction

2022-12-03 Thread Thomas Huth
The SET ADDRESS SPACE CONTROL FAST instruction is not privileged, it can be used from problem space, too. Just the switching to the home address space is privileged and should still generate a privilege exception. This bug is e.g. causing programs like Java that use the "getcpu" vdso kernel functio

[PULL 1/3] tests/qtest/migration-test: Fix unlink error and memory leaks

2022-12-03 Thread Thomas Huth
When running the migration test compiled with Clang from Fedora 37 and sanitizers enabled, there is an error complaining about unlink(): ../tests/qtest/migration-test.c:1072:12: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/unistd.h:858:48: n