[PULL V3 04/15] vhost: Add Shadow VirtQueue call forwarding capabilities

2022-03-14 Thread Jason Wang
From: Eugenio Pérez This will make qemu aware of the device used buffers, allowing it to write the guest memory with its contents if needed. Signed-off-by: Eugenio Pérez Acked-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/virtio/vhost-shadow-virtqueue.c | 38 +++

Re: Time to introduce a migration protocol negotiation (Re: [PATCH v2 00/25] migration: Postcopy Preemption)

2022-03-14 Thread Peter Xu
On Mon, Mar 14, 2022 at 06:49:25PM +, Daniel P. Berrangé wrote: > Taking a step back here and looking at the bigger picture of > migration protocol configuration > > Almost every time we add a new feature to migration, we end up > having to define at least one new migration parameter, then

[PULL V3 09/15] util: Add iova_tree_alloc_map

2022-03-14 Thread Jason Wang
From: Eugenio Pérez This iova tree function allows it to look for a hole in allocated regions and return a totally new translation for a given translated address. It's usage is mainly to allow devices to access qemu address space, remapping guest's one into a new iova space where qemu can add ch

[PULL V3 10/15] util: add iova_tree_find_iova

2022-03-14 Thread Jason Wang
From: Eugenio Pérez This function does the reverse operation of iova_tree_find: To look for a mapping that match a translated address so we can do the reverse. This have linear complexity instead of logarithmic, but it supports overlapping HVA. Future developments could reduce it. Signed-off-by

[PULL V3 14/15] vdpa: Never set log_base addr if SVQ is enabled

2022-03-14 Thread Jason Wang
From: Eugenio Pérez Setting the log address would make the device start reporting invalid dirty memory because the SVQ vrings are located in qemu's memory. Signed-off-by: Eugenio Pérez Acked-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 3 ++- 1 file changed,

[PULL V3 02/15] vhost: Add VhostShadowVirtqueue

2022-03-14 Thread Jason Wang
From: Eugenio Pérez Vhost shadow virtqueue (SVQ) is an intermediate jump for virtqueue notifications and buffers, allowing qemu to track them. While qemu is forwarding the buffers and virtqueue changes, it is able to commit the memory it's being dirtied, the same way regular qemu's VirtIO devices

[PULL V3 15/15] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-03-14 Thread Jason Wang
From: Eugenio Pérez SVQ is able to log the dirty bits by itself, so let's use it to not block migration. Also, ignore set and clear of VHOST_F_LOG_ALL on set_features if SVQ is enabled. Even if the device supports it, the reports would be nonsense because SVQ memory is in the qemu region. The l

[PULL V3 12/15] vdpa: Add custom IOTLB translations to SVQ

2022-03-14 Thread Jason Wang
From: Eugenio Pérez Use translations added in VhostIOVATree in SVQ. Only introduce usage here, not allocation and deallocation. As with previous patches, we use the dead code paths of shadow_vqs_enabled to avoid commiting too many changes at once. These are impossible to take at the moment. Sig

[PULL V3 03/15] vhost: Add Shadow VirtQueue kick forwarding capabilities

2022-03-14 Thread Jason Wang
From: Eugenio Pérez At this mode no buffer forwarding will be performed in SVQ mode: Qemu will just forward the guest's kicks to the device. Host memory notifiers regions are left out for simplicity, and they will not be addressed in this series. Signed-off-by: Eugenio Pérez Acked-by: Michael

[PULL V3 13/15] vdpa: Adapt vhost_vdpa_get_vring_base to SVQ

2022-03-14 Thread Jason Wang
From: Eugenio Pérez This is needed to achieve migration, so the destination can restore its index. Setting base as last used idx, so destination will see as available all the entries that the device did not use, including the in-flight processing ones. This is ok for networking, but other kinds

[PULL V3 05/15] vhost: Add vhost_svq_valid_features to shadow vq

2022-03-14 Thread Jason Wang
From: Eugenio Pérez This allows SVQ to negotiate features with the guest and the device. For the device, SVQ is a driver. While this function bypasses all non-transport features, it needs to disable the features that SVQ does not support when forwarding buffers. This includes packed vq layout, in

Re: [PATCH] MAINTAINERS: Volunteer to maintain Darwin-based hosts support

2022-03-14 Thread Gerd Hoffmann
On Mon, Mar 14, 2022 at 09:27:38PM +0100, Philippe Mathieu-Daudé wrote: > From: Philippe Mathieu-Daudé > > While I am not an experienced Darwin OS user, I now have to > use a macOS based workstation and alike CI, meaning I should > easily spot regressions and test fixes. I therefore volunteer > t

Re: [PATCH v1 1/1] hw: aspeed_scu: Add AST2600 hpll calculation function

2022-03-14 Thread Cédric Le Goater
Hello Steven, [ ... ] I was wondering if the following implementation is good to you. 1 Modify aspeed_scu_get_apb_freq() as below uint32_t aspeed_scu_get_apb_freq(AspeedSCUState *s) { return ASPEED_SCU_GET_CLASS(s)->get_apb(s); } 2. Introduce 2 APB class han

[PULL V3 06/15] virtio: Add vhost_svq_get_vring_addr

2022-03-14 Thread Jason Wang
From: Eugenio Pérez It reports the shadow virtqueue address from qemu virtual address space. Since this will be different from the guest's vaddr, but the device can access it, SVQ takes special care about its alignment & lack of garbage data. It assumes that IOMMU will work in host_page_size ran

[PULL V3 07/15] vdpa: adapt vhost_ops callbacks to svq

2022-03-14 Thread Jason Wang
From: Eugenio Pérez First half of the buffers forwarding part, preparing vhost-vdpa callbacks to SVQ to offer it. QEMU cannot enable it at this moment, so this is effectively dead code at the moment, but it helps to reduce patch size. Signed-off-by: Eugenio Pérez Acked-by: Michael S. Tsirkin S

[PULL V3 08/15] vhost: Shadow virtqueue buffers forwarding

2022-03-14 Thread Jason Wang
From: Eugenio Pérez Initial version of shadow virtqueue that actually forward buffers. There is no iommu support at the moment, and that will be addressed in future patches of this series. Since all vhost-vdpa devices use forced IOMMU, this means that SVQ is not usable at this point of the series

[PULL 01/20] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza 'prom-env-test' is a TCG test that will fail if QEMU is compiled with --disable-tcg: $ QTEST_QEMU_BINARY=./qemu-system-ppc64 ./tests/qtest/prom-env-test /ppc64/prom-env/mac99: qemu-system-ppc64: -accel tcg: invalid accelerator tcg (... hangs indefinitely ...) Fix i

[PULL 02/20] qtest/meson.build: check CONFIG_TCG for boot-serial-test in qtests_ppc

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza 'boot-serial-test' does not work with a QEMU built with --disable-tcg in a IBM POWER9 host. The reason is that without TCG QEMU will default to KVM acceleration, but then the KVM module in IBM POWER hosts aren't able to handle other CPUs. The result is that the test

[PULL 14/20] avocado/ppc_virtex_ml507.py: check TCG accel in test_ppc_virtex_ml507()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza This test times out when running in an IBM POWER host and --disable-tcg. Signed-off-by: Daniel Henrique Barboza Message-Id: <20220310183011.110391-10-danielhb...@gmail.com> Signed-off-by: Cédric Le Goater --- tests/avocado/ppc_virtex_ml507.py | 2 ++ 1 file chang

[PULL 03/20] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza The PowerNV8/9 machines does not work with KVM acceleration, meaning that boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8/9 tests will always fail when QEMU is compiled with --disable-tcg: ERROR 1-tests/avocado/boot_linux_console.py:BootLinuxConsole.test_pp

[PULL V3 11/15] vhost: Add VhostIOVATree

2022-03-14 Thread Jason Wang
From: Eugenio Pérez This tree is able to look for a translated address from an IOVA address. At first glance it is similar to util/iova-tree. However, SVQ working on devices with limited IOVA space need more capabilities, like allocating IOVA chunks or performing reverse translations (qemu addre

[PULL 20/20] ppc/pnv: Remove user-created PHB{3,4,5} devices

2022-03-14 Thread Cédric Le Goater
On a real system with POWER{8,9,10} processors, PHBs are sub-units of the processor, they can be deactivated by firmware but not plugged in or out like a PCI adapter on a slot. Nevertheless, having user-created PHBs in QEMU seemed to be a good idea for testing purposes : 1. having a limited set o

[PULL 00/20] ppc fixes for 7.0

2022-03-14 Thread Cédric Le Goater
s/pull-ppc-20220314 for you to fetch changes up to 9c10d86fee11d96274ea6f7cda12d2471abe3c47: ppc/pnv: Remove user-created PHB{3,4,5} devices (2022-03-14 15:57:17 +0100) ppc-7.0 queue : * Removal of user-created PHB devices * Avo

[PULL 19/20] ppc/pnv: Always create the PHB5 PEC devices

2022-03-14 Thread Cédric Le Goater
From: Frederic Barrat Always create the PECs (PCI Express Controller) for the system. The PECs host the PHBs and we try to find the matching PEC when creating a PHB, so it must exist. It also matches what we do on POWER9 Fixes: 623575e16cd5 ("ppc/pnv: Add model for POWER10 PHB5 PCIe Host bridge"

[PULL 11/20] avocado/ppc_bamboo.py: check TCG accel in test_ppc_bamboo()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza This tests times out in an IBM POWER host when compiled with --disable-tcg. Signed-off-by: Daniel Henrique Barboza Message-Id: <20220310183011.110391-7-danielhb...@gmail.com> Signed-off-by: Cédric Le Goater --- tests/avocado/ppc_bamboo.py | 2 ++ 1 file changed,

[PULL 15/20] target/ppc: fix ISI fault cause for Radix MMU

2022-03-14 Thread Cédric Le Goater
From: Leandro Lupori Fix Instruction Storage Interrupt (ISI) fault cause for Radix MMU, when caused by missing PAGE_EXEC permission, to be SRR1_NOEXEC_GUARD instead of DSISR_PROTFAULT. This matches POWER9 hardware behavior. Fixes: d5fee0bbe68 ("target/ppc: Implement ISA V3.00 radix page fault ha

[PULL 07/20] avocado/boot_linux_console.py: check TCG accel in test_ppc_mac99()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza This test breaks when run in an IBM POWER host with a QEMU compiled with --disable-tcg and the ppc-softmmu target in a similar manner as test_ppc_g3beige did. There's also an observation made about kvm_pr in the error message: Command: ./qemu-system-ppc -display no

[PULL 06/20] avocado/boot_linux_console.py: check TCG accel in test_ppc_g3beige()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza This test breaks when run in an IBM POWER host with a QEMU compiled with --disable-tcg and the ppc-softmmu target. One thing to note is that the error message explictly mentions kvm_pr support: Command: ./qemu-system-ppc -display none -vga none (...) -machine g3bei

[PULL 09/20] avocado/ppc_405.py: check TCG accel in test_ppc_ref405ep()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza Running this test without TCG support in an IBM POWER server results in the following error: Command: ./qemu-system-ppc -display none -vga none (...) -machine ref405ep (...) Output: qemu-system-ppc: Register sync failed... If you're using kvm-hv.ko,

[PULL 05/20] avocado/replay_kernel.py: make tcg-icount check in run_vm()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza The icount framework relies on TCG availability. If QEMU is built with --disable-tcg we won't have icount either, and then this test will fail with the following message in an IBM POWER9 host: tests/avocado/replay_kernel.py:ReplayKernelNormal.test_ppc64_pseries: ERR

[PULL 12/20] avocado/ppc_mpc8544ds.py: check TCG accel in test_ppc_mpc8544ds()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza This tests times out in an IBM POWER host when compiled with --disable-tcg. Signed-off-by: Daniel Henrique Barboza Message-Id: <20220310183011.110391-8-danielhb...@gmail.com> Signed-off-by: Cédric Le Goater --- tests/avocado/ppc_mpc8544ds.py | 2 ++ 1 file change

[PULL 04/20] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza Some ppc64 hosts (e.g. IBM POWER hosts) aren't able to run the e500 machine using KVM accel. Skip this test if TCG accel isn't available. Cc: Cleber Rosa Signed-off-by: Daniel Henrique Barboza Reviewed-by: Cédric Le Goater Message-Id: <20220303153517.168943-5-dan

[PULL 08/20] avocado/ppc_405.py: remove test_ppc_taihu()

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza Running this test gives us a deprecation warning telling that this machine type is no longer supported: Output: qemu-system-ppc: Machine type 'taihu' is deprecated: incomplete, use 'ref405ep' instead Moreover, this test fails to pass running in an IBM POWER

[PULL 13/20] avocado/ppc_prep_40p.py: check TCG accel in all tests

2022-03-14 Thread Cédric Le Goater
From: Daniel Henrique Barboza All tests in the file times out when running in an IBM POWER host and --disable-tcg with an error like the following: Command: ./qemu-system-ppc -display none -vga none (...) -machine 40p (...) Output: qemu-system-ppc: Register sync failed... If you'

<    1   2   3   4