[PATCH v2 06/18 for-7.0] migration: fix use of TLS PSK credentials with a UNIX socket

2022-03-10 Thread Daniel P . Berrangé
The migration TLS code has a check mandating that a hostname be available when starting a TLS session. This is expected when using x509 credentials, but is bogus for PSK and anonymous credentials as neither involve hostname validation. The TLS crdentials object gained suitable error reporting in

[PATCH v2 09/18] tests: introduce ability to provide hooks for migration precopy test

2022-03-10 Thread Daniel P . Berrangé
There are alot of different scenarios to test with migration due to the wide number of parameters and capabilities available. To enable sharing of the basic precopy test scenario, we need to be able to set arbitrary parameters and capabilities before the migration is initiated, but don't want to

[PATCH v2 03/18] tests: support QTEST_TRACE env variable

2022-03-10 Thread Daniel P . Berrangé
When debugging failing qtests it is useful to be able to turn on trace output to stderr. The QTEST_TRACE env variable contents get injected as a '-trace ' command line arg Reviewed-by: Peter Xu Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé --- tests/qtest/libqtest.c | 8 ++--

[PATCH v2 12/18] tests: add migration tests of TLS with PSK credentials

2022-03-10 Thread Daniel P . Berrangé
This validates that we correctly handle migration success and failure scenarios when using TLS with pre shared keys. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 7 +- tests/qtest/migration-test.c| 159 +++-

[PATCH v2 08/18] tests: merge code for UNIX and TCP migration pre-copy tests

2022-03-10 Thread Daniel P . Berrangé
The test cases differ only in the URI they provide to the migration commands, and the ability to set the dirty_ring mode. This code is trivially merged into a common helper. Signed-off-by: Daniel P. Berrangé --- tests/qtest/migration-test.c | 98 ++-- 1 file

[PATCH v2 05/18] tests: add more helper macros for creating TLS x509 certs

2022-03-10 Thread Daniel P . Berrangé
These macros are more suited to the general consumers of certs in the test suite, where we don't need to exercise every single possible permutation. Signed-off-by: Daniel P. Berrangé --- tests/unit/crypto-tls-x509-helpers.h | 53 1 file changed, 53 insertions(+)

[PATCH v2 02/18] tests: improve error message when saving TLS PSK file fails

2022-03-10 Thread Daniel P . Berrangé
Reviewed-by: Peter Xu Signed-off-by: Daniel P. Berrangé --- tests/unit/crypto-tls-psk-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/crypto-tls-psk-helpers.c b/tests/unit/crypto-tls-psk-helpers.c index 7f8a488961..4bea7c6fa2 100644 ---

[PATCH v2 01/18] tests: fix encoding of IP addresses in x509 certs

2022-03-10 Thread Daniel P . Berrangé
We need to encode just the address bytes, not the whole struct sockaddr data. Add a test case to validate that we're matching on SAN IP addresses correctly. Signed-off-by: Daniel P. Berrangé --- tests/unit/crypto-tls-x509-helpers.c | 16 +--- tests/unit/test-crypto-tlssession.c |

Re: [PATCH-for-6.2 0/2] hw/block/fdc: Fix CVE-2021-3507

2022-03-10 Thread Thomas Huth
On 06/02/2022 20.19, Jon Maloy wrote: Trying again with correct email address. ///jon On 2/6/22 14:15, Jon Maloy wrote: On 1/27/22 15:14, Jon Maloy wrote: On 11/18/21 06:57, Philippe Mathieu-Daudé wrote: Trivial fix for CVE-2021-3507. Philippe Mathieu-Daudé (2):    hw/block/fdc: Prevent

Re: QEMU device refcounting when device creates a container MR

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 16:30, Igor Mammedov wrote: > > Do On Thu, 10 Mar 2022 16:05:24 + > Peter Maydell wrote: > > > On Thu, 10 Mar 2022 at 15:36, Igor Mammedov wrote: > > > > > > On Wed, 9 Mar 2022 16:56:21 + > > > Peter Maydell wrote: > > > > ...also, in the device-introspect-test

Re: [PATCH v3] vga: don't abort when adding a duplicate isa-vga device

2022-03-10 Thread Thomas Huth
On 16/08/2021 15.55, Jose R. Ziviani wrote: If users try to add an isa-vga device that was already registered, still in command line, qemu will crash: $ qemu-system-mips64el -M pica61 -device isa-vga RAMBlock "vga.vram" already registered, abort! Aborted (core dumped) That particular board

Re: [PULL V2 00/15] Net patches

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 02:39, Jason Wang wrote: > > The following changes since commit d9ccf33f9479201e5add8db0af68ca9ca8da358b: > > Merge remote-tracking branch > 'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging > (2022-03-09 20:01:17 +) > > are available in the

[PATCH] tulip: Assign default MAC address if not specified

2022-03-10 Thread Helge Deller
The MAC of the tulip card is stored in the EEPROM and at startup tulip_fill_eeprom() is called to initialize the EEPROM with the MAC address given on the command line, e.g.: -device tulip,mac=00:11:22:33:44:55 In case the mac address was not given on the command line, tulip_fill_eeprom()

Re: [RFC PATCH] hw/i386/e820: remove legacy reserved entries for e820

2022-03-10 Thread Igor Mammedov
On Thu, 10 Mar 2022 11:51:37 +0530 Ani Sinha wrote: > On Mon, Feb 28, 2022 at 8:56 PM Ani Sinha wrote: > > > > e820 reserved entries were used before the dynamic entries with fw config > > files > > were intoduced into qemu with the following change: > > 7d67110f2d9a6("pc: add etc/e820 fw_cfg

Re: QEMU device refcounting when device creates a container MR

2022-03-10 Thread Igor Mammedov
Do On Thu, 10 Mar 2022 16:05:24 + Peter Maydell wrote: > On Thu, 10 Mar 2022 at 15:36, Igor Mammedov wrote: > > > > On Wed, 9 Mar 2022 16:56:21 + > > Peter Maydell wrote: > > > ...also, in the device-introspect-test where I see this problem, > > > unrealize is never going to be

Re: any opinion on the patch "[RFC PATCH] hw/i386/e820: remove legacy reserved entries for e820"? EOM

2022-03-10 Thread Igor Mammedov
On Fri, 4 Mar 2022 16:16:38 +0530 Ani Sinha wrote: > On Fri, Mar 4, 2022 at 4:11 PM Ani Sinha wrote: > > > > On Fri, Mar 4, 2022 at 3:48 PM Gerd Hoffmann wrote: > > > > > > On Thu, Mar 03, 2022 at 03:12:51PM +0530, Ani Sinha wrote: > > > > On Thu, Mar 3, 2022 at 15:11 Gerd Hoffmann wrote:

Re: [RFC PATCH v3 3/3] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr

2022-03-10 Thread Matheus K. Ferst
On 04/03/2022 11:42, Laurent Vivier wrote: Le 13/01/2022 à 18:04, matheus.fe...@eldorado.org.br a écrit : From: Matheus Ferst The code in linux-user/ppc/cpu_loop.c expects POWERPC_EXCP_PRIV exception with error POWERPC_EXCP_PRIV_OPC or POWERPC_EXCP_PRIV_REG, while POWERPC_EXCP_INVAL_SPR is

Re: [PATCH 11/18] tests: expand the migration precopy helper to support failures

2022-03-10 Thread Daniel P . Berrangé
On Mon, Mar 07, 2022 at 03:57:16PM +0800, Peter Xu wrote: > On Wed, Mar 02, 2022 at 05:49:25PM +, Daniel P. Berrangé wrote: > > static void test_precopy_common(const char *listen_uri, > > const char *connect_uri, > >

Re: [PATCH 3/3] ppc/pnv: Fix PEC lookup function for POWER10

2022-03-10 Thread Cédric Le Goater
On 3/10/22 16:51, Frederic Barrat wrote: The PEC array used when looking for the PEC hosting a PHB is stored in the chip structure. The array is at a different offset in Pnv9Chip and Pnv10Chip. The lookup function was therefore not working properly on POWER10. This patch fixes it by introducing

Re: [PATCH 2/3] ppc/pnv: Fixes for user-created pnv-phb5 devices

2022-03-10 Thread Cédric Le Goater
On 3/10/22 16:51, Frederic Barrat wrote: Two small fixes to fix user-created devices for POWER10: - 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

Re: [PATCH 1/3] ppc/pnv: Introduce a pnv-phb5 device to match root port

2022-03-10 Thread Cédric Le Goater
On 3/10/22 16:50, Frederic Barrat wrote: We already have the pnv-phb3 and pnv-phb4 devices for POWER8 and POWER9 respectively. POWER10 uses version 5 of the PHB. It is very close to the PHB4 from POWER9, at least in our model and we could almost keep using the PHB4 model. However the matching

Re: [PATCH v3 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM

2022-03-10 Thread Cornelia Huck
On Mon, Mar 07 2022, Halil Pasic wrote: > Unlike most virtio features ACCESS_PLATFORM is considered mandatory by > QEMU, i.e. the driver must accept it if offered by the device. The > virtio specification says that the driver SHOULD accept the > ACCESS_PLATFORM feature if offered, and that the

Re: QEMU device refcounting when device creates a container MR

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 15:36, Igor Mammedov wrote: > > On Wed, 9 Mar 2022 16:56:21 + > Peter Maydell wrote: > > ...also, in the device-introspect-test where I see this problem, > > unrealize is never going to be called anyway, because the device > > is only put through "instance_init" and

Re: [PATCH V7 10/29] machine: memfd-alloc option

2022-03-10 Thread Igor Mammedov
On Thu, 10 Mar 2022 10:36:08 -0500 Steven Sistare wrote: > On 3/8/2022 2:20 AM, Igor Mammedov wrote: > > On Tue, 8 Mar 2022 01:50:11 -0500 > > "Michael S. Tsirkin" wrote: > > > >> On Mon, Mar 07, 2022 at 09:41:44AM -0500, Steven Sistare wrote: > >>> On 3/4/2022 5:41 AM, Igor Mammedov

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-03-10 Thread Stefan Hajnoczi
On Wed, Mar 09, 2022 at 02:26:28PM +0100, Emanuele Giuseppe Esposito wrote: > Am 02/03/2022 um 10:47 schrieb Stefan Hajnoczi: > > On Tue, Mar 01, 2022 at 09:21:08AM -0500, Emanuele Giuseppe Esposito wrote: > >> Possible scenarios > >> --- > >> Keeping in mind that we can only have

[PATCH 3/3] ppc/pnv: Fix PEC lookup function for POWER10

2022-03-10 Thread Frederic Barrat
The PEC array used when looking for the PEC hosting a PHB is stored in the chip structure. The array is at a different offset in Pnv9Chip and Pnv10Chip. The lookup function was therefore not working properly on POWER10. This patch fixes it by introducing a class method to get the correct PEC

[PATCH 2/3] ppc/pnv: Fixes for user-created pnv-phb5 devices

2022-03-10 Thread Frederic Barrat
Two small fixes to fix user-created devices for POWER10: - 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 - the machine class must allow

[PATCH 1/3] ppc/pnv: Introduce a pnv-phb5 device to match root port

2022-03-10 Thread Frederic Barrat
We already have the pnv-phb3 and pnv-phb4 devices for POWER8 and POWER9 respectively. POWER10 uses version 5 of the PHB. It is very close to the PHB4 from POWER9, at least in our model and we could almost keep using the PHB4 model. However the matching root port pnv-phb5-root-port is specific to

[PATCH 0/3] Fix user-created PHB devices on POWER10

2022-03-10 Thread Frederic Barrat
A short series to fix creating PHB devices and root ports on the newly merged powernv10 machine. Frederic Barrat (3): ppc/pnv: Introduce a pnv-phb5 device to match root port ppc/pnv: Fixes for user-created pnv-phb5 devices ppc/pnv: Fix PEC lookup function for POWER10

Re: [PATCH V7 10/29] machine: memfd-alloc option

2022-03-10 Thread Steven Sistare
On 3/8/2022 2:20 AM, Igor Mammedov wrote: > On Tue, 8 Mar 2022 01:50:11 -0500 > "Michael S. Tsirkin" wrote: > >> On Mon, Mar 07, 2022 at 09:41:44AM -0500, Steven Sistare wrote: >>> On 3/4/2022 5:41 AM, Igor Mammedov wrote: On Thu, 3 Mar 2022 12:21:15 -0500 "Michael S. Tsirkin"

[PATCH v5 8/8] migration: Use multifd before we check for the zero page

2022-03-10 Thread Juan Quintela
So we use multifd to transmit zero pages. Signed-off-by: Juan Quintela --- - Check zero_page property before using new code (Dave) --- migration/ram.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index

RE: [PULL 00/12] Hexagon (target/hexagon) queue

2022-03-10 Thread Taylor Simpson
My apologies. I'll investigate the mismatch between the toolchain I'm using and the one CI is using. > -Original Message- > From: Peter Maydell > Sent: Thursday, March 10, 2022 7:16 AM > To: Taylor Simpson > Cc: qemu-devel@nongnu.org; richard.hender...@linaro.org; > f4...@amsat.org;

Re: QEMU device refcounting when device creates a container MR

2022-03-10 Thread Igor Mammedov
On Wed, 9 Mar 2022 16:56:21 + Peter Maydell wrote: > On Wed, 9 Mar 2022 at 16:53, Peter Maydell wrote: > > > > On Wed, 9 Mar 2022 at 16:21, Paolo Bonzini wrote: > > > > > > On 3/9/22 11:33, Peter Maydell wrote: > > > > Hi; does anybody know how device reference counting is supposed > >

[PATCH v5 6/8] multifd: Support for zero pages transmission

2022-03-10 Thread Juan Quintela
This patch adds counters and similar. Logic will be added on the following patch. Signed-off-by: Juan Quintela --- Added counters for duplicated/non duplicated pages. Removed reviewed by from David. Add total_zero_pages --- migration/multifd.h| 17 - migration/multifd.c

[PATCH v5 3/8] migration: Make ram_save_target_page() a pointer

2022-03-10 Thread Juan Quintela
We are going to create a new function for multifd latest in the series. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index

[PATCH v5 7/8] multifd: Zero pages transmission

2022-03-10 Thread Juan Quintela
This implements the zero page dection and handling. Signed-off-by: Juan Quintela --- Add comment for offset (dave) Use local variables for offset/block to have shorter lines --- migration/multifd.h | 5 + migration/multifd.c | 42 -- 2 files

[PATCH v5 4/8] multifd: Add property to enable/disable zero_page

2022-03-10 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migration.h | 3 +++ hw/core/machine.c | 4 +++- migration/migration.c | 11 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/migration/migration.h b/migration/migration.h index

Re: [PULL 00/22] q800-updates-for-7.0 queue 20220309

2022-03-10 Thread Peter Maydell
On Wed, 9 Mar 2022 at 11:08, Mark Cave-Ayland wrote: > > The following changes since commit 9f0369efb0f2a200f18b1aacd2ef493e22da5351: > > Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging > (2022-03-08 22:27:34 +) > > are available in the Git repository at: > >

[PATCH v5 5/8] migration: Export ram_release_page()

2022-03-10 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/ram.h | 1 + migration/ram.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/ram.h b/migration/ram.h index 2e27c49f90..33686055b4 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -65,6 +65,7 @@ int

[PATCH v5 0/8] Migration: Transmit and detect zero pages in the multifd threads

2022-03-10 Thread Juan Quintela
Hi In this version: - Rebase to latest - Address all comments - statistics about zero pages are right now (or at least much better than before) - changed how we calculate the amount of transferred ram - numbers, who don't like numbers. Everything has been checked with a guest launched like the

[PATCH v5 2/8] multifd: Count the number of sent bytes correctly

2022-03-10 Thread Juan Quintela
Current code asumes that all pages are whole. That is not true for example for compression already. Fix it for creating a new field ->sent_bytes that includes it. All ram_counters are used only from the migration thread, so we have two options: - put a mutex and fill everything when we sent it

[PATCH v5 1/8] migration: Export ram_transferred_ram()

2022-03-10 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/ram.h | 2 ++ migration/ram.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/ram.h b/migration/ram.h index 2c6dc3675d..2e27c49f90 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -64,6 +64,8 @@ int

Re: bad virsh save /dev/null performance (600 MiB/s max)

2022-03-10 Thread Claudio Fontana
On 3/9/22 7:46 PM, Daniel P. Berrangé wrote: > On Wed, Mar 09, 2022 at 06:37:42PM +, Daniel P. Berrangé wrote: >> On Wed, Mar 09, 2022 at 07:27:12PM +0100, Claudio Fontana wrote: >>> >>> One difference I could see looking at the qmp commands issued by libvirt in >>> the "virsh save" case, >>>

Re: [PATCH-for-7.0 v2] softmmu: List CPU types again

2022-03-10 Thread Thomas Huth
On 10/03/2022 15.07, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Move list_cpus() declaration to "exec/cpu-common.h" because this function

Re: [PATCH v3 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM

2022-03-10 Thread Michael S. Tsirkin
On Mon, Mar 07, 2022 at 12:29:39PM +0100, Halil Pasic wrote: > Unlike most virtio features ACCESS_PLATFORM is considered mandatory by > QEMU, i.e. the driver must accept it if offered by the device. The > virtio specification says that the driver SHOULD accept the > ACCESS_PLATFORM feature if

Re: [PATCH V7 19/29] vfio-pci: cpr part 1 (fd and dma)

2022-03-10 Thread Steven Sistare
On 3/7/2022 5:16 PM, Alex Williamson wrote: > On Wed, 22 Dec 2021 11:05:24 -0800 > Steve Sistare wrote: > >> Enable vfio-pci devices to be saved and restored across an exec restart >> of qemu. >> >> At vfio creation time, save the value of vfio container, group, and device >> descriptors in cpr

Re: [RFC PATCH 2/2] tests: Add dirty page rate limit test

2022-03-10 Thread Hyman
在 2022/3/10 16:29, Peter Xu 写道: On Wed, Mar 09, 2022 at 11:58:01PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, create a standalone file to implement the test case. Thanks for writting this test case.

[PATCH v5 11/13] KVM: Zap existing KVM mappings when pages changed in the private fd

2022-03-10 Thread Chao Peng
KVM gets notified when memory pages changed in the memory backing store. When userspace allocates the memory with fallocate() or frees memory with fallocate(FALLOC_FL_PUNCH_HOLE), memory backing store calls into KVM fallocate/invalidate callbacks respectively. To ensure KVM never maps both the

[PATCH v5 05/13] KVM: Extend the memslot to support fd-based private memory

2022-03-10 Thread Chao Peng
Extend the memslot definition to provide fd-based private memory support by adding two new fields (private_fd/private_offset). The memslot then can maintain memory for both shared pages and private pages in a single memslot. Shared pages are provided by existing userspace_addr(hva) field and

[PATCH v5 03/13] mm/shmem: Support memfile_notifier

2022-03-10 Thread Chao Peng
From: "Kirill A. Shutemov" It maintains a memfile_notifier list in shmem_inode_info structure and implements memfile_pfn_ops callbacks defined by memfile_notifier. It then exposes them to memfile_notifier via shmem_get_memfile_notifier_info. We use SGP_NOALLOC in shmem_get_lock_pfn since the

[PATCH v5 02/13] mm: Introduce memfile_notifier

2022-03-10 Thread Chao Peng
This patch introduces memfile_notifier facility so existing memory file subsystems (e.g. tmpfs/hugetlbfs) can provide memory pages to allow a third kernel component to make use of memory bookmarked in the memory file and gets notified when the pages in the memory file become allocated/invalidated.

[PATCH v5 09/13] KVM: Handle page fault for private memory

2022-03-10 Thread Chao Peng
When page fault happens for a memslot with KVM_MEM_PRIVATE, we use kvm_memfile_get_pfn() which further calls into memfile_pfn_ops callbacks defined for each memslot to request the pfn from the memory backing store. One assumption is that private pages are persistent and pre-allocated in the

[PATCH v5 13/13] memfd_create.2: Describe MFD_INACCESSIBLE flag

2022-03-10 Thread Chao Peng
Signed-off-by: Chao Peng --- man2/memfd_create.2 | 13 + 1 file changed, 13 insertions(+) diff --git a/man2/memfd_create.2 b/man2/memfd_create.2 index 89e9c4136..2698222ae 100644 --- a/man2/memfd_create.2 +++ b/man2/memfd_create.2 @@ -101,6 +101,19 @@ meaning that no other seals can

[PATCH v5 10/13] KVM: Register private memslot to memory backing store

2022-03-10 Thread Chao Peng
Add 'notifier' to memslot to make it a memfile_notifier node and then register it to memory backing store via memfile_register_notifier() when memslot gets created. When memslot is deleted, do the reverse with memfile_unregister_notifier(). Note each KVM memslot can be registered to different

Re: [PATCH-for-7.0] softmmu: List CPU types again

2022-03-10 Thread Philippe Mathieu-Daudé
On 10/3/22 13:23, Thomas Huth wrote: On 10/03/2022 12.55, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Extract list_cpus() from the generic

Re: [PATCH 05/35] coroutine: small code cleanup in qemu_co_rwlock_wrlock

2022-03-10 Thread Philippe Mathieu-Daudé
On 10/3/22 13:43, Paolo Bonzini wrote: qemu_co_rwlock_wrlock stores the current coroutine in a local variable, use it instead of calling qemu_coroutine_self() again. Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v5 12/13] KVM: Expose KVM_MEM_PRIVATE

2022-03-10 Thread Chao Peng
KVM_MEM_PRIVATE is not exposed by default but architecture code can turn on it by implementing kvm_arch_private_memory_supported(). Signed-off-by: Yu Zhang Signed-off-by: Chao Peng --- include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 24 +++- 2 files changed, 20

[PATCH v5 07/13] KVM: Add KVM_EXIT_MEMORY_ERROR exit

2022-03-10 Thread Chao Peng
This new KVM exit allows userspace to handle memory-related errors. It indicates an error happens in KVM at guest memory range [gpa, gpa+size). The flags includes additional information for userspace to handle the error. Currently bit 0 is defined as 'private memory' where '1' indicates error

Re: [PATCH v3 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM

2022-03-10 Thread Halil Pasic
ping On Mon, 7 Mar 2022 12:29:39 +0100 Halil Pasic wrote: > Unlike most virtio features ACCESS_PLATFORM is considered mandatory by > QEMU, i.e. the driver must accept it if offered by the device. The > virtio specification says that the driver SHOULD accept the > ACCESS_PLATFORM feature if

[PATCH v5 08/13] KVM: Use memfile_pfn_ops to obtain pfn for private pages

2022-03-10 Thread Chao Peng
Private pages are not mmap-ed into userspace so can not reply on get_user_pages() to obtain the pfn. Instead we add a memfile_pfn_ops pointer pfn_ops in each private memslot and use it to obtain the pfn for a gfn. To do that, KVM should convert the gfn to the offset into the fd and then call

[PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-03-10 Thread Chao Peng
Since page migration / swapping is not supported yet, MFD_INACCESSIBLE memory behave like longterm pinned pages and thus should be accounted to mm->pinned_vm and be restricted by RLIMIT_MEMLOCK. Signed-off-by: Chao Peng --- mm/shmem.c | 25 - 1 file changed, 24

[PATCH v5 06/13] KVM: Use kvm_userspace_memory_region_ext

2022-03-10 Thread Chao Peng
Use the new extended memslot structure kvm_userspace_memory_region_ext. The extended part (private_fd/ private_offset) will be copied from userspace only when KVM_MEM_PRIVATE is set. Internally old kvm_userspace_memory_region will still be used for places where the extended fields are not needed.

[PATCH v5 01/13] mm/memfd: Introduce MFD_INACCESSIBLE flag

2022-03-10 Thread Chao Peng
From: "Kirill A. Shutemov" Introduce a new memfd_create() flag indicating the content of the created memfd is inaccessible from userspace through ordinary MMU access (e.g., read/write/mmap). However, the file content can be accessed via a different mechanism (e.g. KVM MMU) indirectly. It

[PATCH v5 00/13] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-03-10 Thread Chao Peng
This is the v5 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: d5089416b7fb KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2 Introduction In general this patch series introduce fd-based memslot

Re: [PATCH 04/18] tests: print newline after QMP response in qtest logs

2022-03-10 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > On Thu, Mar 10, 2022 at 03:11:08PM +0400, Marc-André Lureau wrote: > > Hi > > > > On Thu, Mar 10, 2022 at 2:56 PM Daniel P. Berrangé > > wrote: > > > > > On Mon, Mar 07, 2022 at 11:09:37AM +0100, Thomas Huth wrote: > > > > On 07/03/2022 11.06,

Re: qemu-softmmu -cpu help broken

2022-03-10 Thread Paolo Bonzini
On 3/10/22 12:10, Max Filippov wrote: Hello, I've noticed that the command qemu-system-xtensa -cpu help no longer prints anything. Apparently because cpu_list is no longer defined in list_cpus inside softmmu/cpus.c I think it'd be better to move list_cpus() to cpu.c in the root directory,

[PATCH-for-7.0 v2] softmmu: List CPU types again

2022-03-10 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Move list_cpus() declaration to "exec/cpu-common.h" because this function is not softmmu-specific and can also be used by

Re: [PULL 00/23] QEMU changes for 7.0 soft freeze

2022-03-10 Thread Paolo Bonzini
On 3/10/22 08:56, Thomas Huth wrote: Yes, understood, but again, that only works for me if I run:  make check-block But if I run:  make check-block -j8 I only get one single line saying:  [1/1]  qemu:block / qemu-iotests qcow2   2s And the progress report is only

[PATCH 30/35] qemu_co_rwlock_unlock

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index e7eb446566..c164cf6b15 100644 --- a/util/qemu-coroutine-lock.c +++

[PATCH 28/35] qemu_co_rwlock_maybe_wake_one

2022-03-10 Thread Paolo Bonzini
This is optimized a bit based on the assumption that qemu_co_mutex_unlock() never yields. In other words, qemu_co_mutex_unlock() and qemu_co_rwlock_maybe_wake_one() could be declared coroutine_only_fn instead of coroutine_fn. Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 11

[PATCH 26/35] convert qemu_co_mutex_lock_slowpath to magic macros

2022-03-10 Thread Paolo Bonzini
Replace the hand-written frame structure with one built with the CO_* macros, just to shake them a bit. The produced code is exactly the same (except for CO_INIT_FRAME using a statement expression to keep the "return" statement visible in the code). Signed-off-by: Paolo Bonzini ---

[PATCH 24/35] /basic/no-dangling-access

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index 080ee76dde..0fe9226b86 100644 --- a/tests/unit/test-coroutine.c +++

[PATCH 23/35] /perf/cost

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index c44287bcb0..080ee76dde 100644 --- a/tests/unit/test-coroutine.c +++

Re: [PATCH RESEND v1 0/2] i386: Make PIT and PIC the property of common x86 base machine type

2022-03-10 Thread Xiaoyao Li
On 3/10/2022 9:07 PM, Michael S. Tsirkin wrote: On Thu, Mar 10, 2022 at 08:28:09PM +0800, Xiaoyao Li wrote: For PIT, it's straightforward to merge microvm::pit and pc_machine::pit_enabled into x86ms::pit For PIC, move microvm::pic to x86ms:pic, which gives PC machine the ability to

[PATCH 22/35] /perf/function-call

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index 0b7b4d6ef8..c44287bcb0 100644 --- a/tests/unit/test-coroutine.c +++ b/tests/unit/test-coroutine.c

Re: QEMU device refcounting when device creates a container MR

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 13:19, Peter Xu wrote: > > On Wed, Mar 09, 2022 at 11:40:15AM +0100, Philippe Mathieu-Daudé wrote: > > Cc'ing David / Peter > > > > On 9/3/22 11:33, Peter Maydell wrote: > > > Hi; does anybody know how device reference counting is supposed > > > to work when the device

[PATCH 14/35] /basic/nesting

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index ae06e97c95..7aaadfd31a 100644 --- a/tests/unit/test-coroutine.c +++

[PATCH 07/35] coroutine: introduce the "stackless coroutine" backend

2022-03-10 Thread Paolo Bonzini
This backend is similar to the one that was written for the "Continuation Passing C" precompiler[1]. The main advantages of stackless coroutines, in the context of QEMU, are two. First, they do not make any assumption on the layout of the stack (e.g. they do not need any special treatment for

[PATCH 08/35] /basic/lifecycle

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index c230c2fa6e..3670750c5b 100644 --- a/tests/unit/test-coroutine.c +++

[PATCH 06/35] disable some code

2022-03-10 Thread Paolo Bonzini
Disable a lot of code that I can't be bothered to convert right now. Signed-off-by: Paolo Bonzini --- tests/unit/meson.build | 2 +- tests/unit/test-coroutine.c | 6 ++ util/meson.build| 10 +- util/qemu-coroutine-lock.c | 2 ++ util/qemu-coroutine-sleep.c | 2

Re: [PATCH-for-7.0] softmmu: List CPU types again

2022-03-10 Thread Paolo Bonzini
On 3/10/22 13:23, Thomas Huth wrote: On 10/03/2022 12.55, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Extract list_cpus() from the generic

[PATCH 05/35] coroutine: small code cleanup in qemu_co_rwlock_wrlock

2022-03-10 Thread Paolo Bonzini
qemu_co_rwlock_wrlock stores the current coroutine in a local variable, use it instead of calling qemu_coroutine_self() again. Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-coroutine-lock.c

Re: [PULL 00/12] Hexagon (target/hexagon) queue

2022-03-10 Thread Peter Maydell
On Tue, 8 Mar 2022 at 21:55, Taylor Simpson wrote: > > The following changes since commit 33d102e92e41a65c817d85ff8bfd5ffa2c16b1d3: > > Merge remote-tracking branch > 'remotes/kraxel/tags/seabios-20220307-pull-request' into staging (2022-03-08 > 12:40:58 +) > > are available in the Git

[PATCH 02/35] coroutine: qemu_coroutine_get_aio_context is not a coroutine_fn

2022-03-10 Thread Paolo Bonzini
Since it operates on a given coroutine, qemu_coroutine_get_aio_context can be called from outside coroutine context. This is for example how qio_channel_restart_read uses it. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 2 +- util/qemu-coroutine.c| 2 +- 2 files changed, 2

Re: [PATCH RESEND v1 0/2] i386: Make PIT and PIC the property of common x86 base machine type

2022-03-10 Thread Michael S. Tsirkin
On Thu, Mar 10, 2022 at 08:28:09PM +0800, Xiaoyao Li wrote: > For PIT, it's straightforward to merge microvm::pit and > pc_machine::pit_enabled into x86ms::pit > > For PIC, move microvm::pic to x86ms:pic, which gives PC machine the > ability to dis-/en-able PIC and it's the preparation for future

[PATCH 01/35] coroutine: add missing coroutine_fn annotations for CoRwlock functions

2022-03-10 Thread Paolo Bonzini
CoRwlock can only be taken or released from a coroutine, and it can yield. Mark it as coroutine_fn. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index

[PATCH 35/35] /locking/co-rwlock/downgrade

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 123 1 file changed, 98 insertions(+), 25 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index 39d0f31492..174ea8d579 100644 --- a/tests/unit/test-coroutine.c

Re: QEMU device refcounting when device creates a container MR

2022-03-10 Thread Peter Xu
On Wed, Mar 09, 2022 at 11:40:15AM +0100, Philippe Mathieu-Daudé wrote: > Cc'ing David / Peter > > On 9/3/22 11:33, Peter Maydell wrote: > > Hi; does anybody know how device reference counting is supposed > > to work when the device creates a "container" MemoryRegion which > > it then puts some

[PATCH experiment 00/35] stackless coroutine backend

2022-03-10 Thread Paolo Bonzini
Here is an experiment with using stackless coroutines in QEMU. It only compiles enough code to run tests/unit/test-coroutine, but at least it proves that it's possible to quickly test ideas in the area of coroutine runtimes. Another idea that could be toyed with in a similar manner could be

[PATCH 31/35] qemu_co_rwlock_downgrade

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index c164cf6b15..5a7b99cfaf 100644 --- a/util/qemu-coroutine-lock.c +++

Re: [PATCH v5 17/48] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 11:27, Richard Henderson wrote: > > WE is the architectural name of the field, not WR. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

[PATCH 29/35] qemu_co_rwlock_rdlock

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 40 +- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index 3b50e1dd5b..e7eb446566 100644 --- a/util/qemu-coroutine-lock.c +++

[PATCH 34/35] /locking/co-rwlock/upgrade

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 68 ++--- 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index db6718db40..39d0f31492 100644 --- a/tests/unit/test-coroutine.c

Re: [PATCH-for-7.0] softmmu: List CPU types again

2022-03-10 Thread Thomas Huth
On 10/03/2022 12.55, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Extract list_cpus() from the generic cpus.c into a new target-specific

[PATCH 33/35] qemu_co_rwlock_upgrade

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 30 +++--- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index c0541171d4..9674e8e3e3 100644 --- a/util/qemu-coroutine-lock.c +++

[PATCH 32/35] qemu_co_rwlock_wrlock

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 36 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index 5a7b99cfaf..c0541171d4 100644 --- a/util/qemu-coroutine-lock.c +++

Re: [PATCH v5 11/48] target/nios2: Do not zero the general registers on reset

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 11:27, Richard Henderson wrote: > > The bulk of the general register set is undefined on reset. They might be architecturally undefined, but for QEMU's purposes we want the state of the CPU on reset to be identical to the state it is in when QEMU is first started. thanks

[PATCH 20/35] /perf/nesting

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index 439bd269c9..75d54e5d29 100644 --- a/tests/unit/test-coroutine.c +++ b/tests/unit/test-coroutine.c

[PATCH 27/35] /locking/co-mutex/lockable

2022-03-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index 642ef36bc3..db6718db40 100644 --- a/tests/unit/test-coroutine.c

Re: [PATCH v5 08/48] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 11:27, Richard Henderson wrote: > > Drop the set of estatus in init_thread; it was clearly intended > to be setting the value of CR_STATUS for the application, but we > never actually performed that copy. However, the proper value is > set in nios2_cpu_reset so we don't

<    1   2   3   4   >