RE: [PATCH] target/i386: Restore TSX features with taa-no

2022-07-07 Thread Duan, Zhenzhong
>-Original Message- >From: Li, Xiaoyao >Sent: Friday, July 8, 2022 2:03 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: pbonz...@redhat.com; ehabk...@redhat.com; Ma, XiangfeiX > >Subject: Re: [PATCH] target/i386: Restore TSX features with taa-no > >On 7/8/2022 1:42 PM, Zhenzhong D

Re: [PATCH] target/i386: Restore TSX features with taa-no

2022-07-07 Thread Xiaoyao Li
On 7/8/2022 1:42 PM, Zhenzhong Duan wrote: In L1 kernel side, taa-no is cleared because RTM is disabled which will lead to below warning when starting L2 qemu: "warning: host doesn't support requested feature: MSR(10AH).taa-no [bit 8]" If host isn't susceptible to TSX Async Abort (TAA) vulnerab

[PATCH] target/i386: Fix CPU feature dependency check

2022-07-07 Thread Zhenzhong Duan
While in other call site "x-force-features" takes effect to keep the CPU feature even though not supported for any reason. This isn't consistent while expanding features, Fixed to keep user explicitly enabled features if "x-force-features" is specified. Fixes: 99e24dbdaa682 ("target/i386: introdu

[PATCH] target/i386: Restore TSX features with taa-no

2022-07-07 Thread Zhenzhong Duan
In L1 kernel side, taa-no is cleared because RTM is disabled which will lead to below warning when starting L2 qemu: "warning: host doesn't support requested feature: MSR(10AH).taa-no [bit 8]" If host isn't susceptible to TSX Async Abort (TAA) vulnerabilities, exposing TSX to L2 may help performa

[RFC v3 7/8] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-07-07 Thread Stefan Hajnoczi
Avoid bounce buffers when QEMUIOVector elements are within previously registered bdrv_register_buf() buffers. The idea is that emulated storage controllers will register guest RAM using bdrv_register_buf() and set the BDRV_REQ_REGISTERED_BUF on I/O requests. Therefore no blkio_map_mem_region() cal

[RFC v3 8/8] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-07-07 Thread Stefan Hajnoczi
Register guest RAM using BlockRAMRegistrar and set the BDRV_REQ_REGISTERED_BUF flag so block drivers can optimize memory accesses in I/O requests. This is for vdpa-blk, vhost-user-blk, and other I/O interfaces that rely on DMA mapping/unmapping. Signed-off-by: Stefan Hajnoczi --- include/hw/vir

[RFC v3 6/8] stubs: add memory_region_from_host() and memory_region_get_fd()

2022-07-07 Thread Stefan Hajnoczi
The blkio block driver will need to look up the file descriptor for a given pointer. This is possible in softmmu builds where the memory API is available for querying guest RAM. Add stubs so tools like qemu-img that link the block layer still build successfully. In this case there is no guest RAM

[RFC v3 3/8] block: pass size to bdrv_unregister_buf()

2022-07-07 Thread Stefan Hajnoczi
The only implementor of bdrv_register_buf() is block/nvme.c, where the size is not needed when unregistering a buffer. This is because util/vfio-helpers.c can look up mappings by address. Future block drivers that implement bdrv_register_buf() may not be able to do their job given only the buffer

[RFC v3 5/8] block: add BlockRAMRegistrar

2022-07-07 Thread Stefan Hajnoczi
Emulated devices and other BlockBackend users wishing to take advantage of blk_register_buf() all have the same repetitive job: register RAMBlocks with the BlockBackend using RAMBlockNotifier. Add a BlockRAMRegistrar API to do this. A later commit will use this from hw/block/virtio-blk.c. Signed-

[RFC v3 2/8] numa: call ->ram_block_removed() in ram_block_notifer_remove()

2022-07-07 Thread Stefan Hajnoczi
When a RAMBlockNotifier is added, ->ram_block_added() is called with all existing RAMBlocks. There is no equivalent ->ram_block_removed() call when a RAMBlockNotifier is removed. The util/vfio-helpers.c code (the sole user of RAMBlockNotifier) is fine with this asymmetry because it does not rely o

[RFC v3 4/8] block: add BDRV_REQ_REGISTERED_BUF request flag

2022-07-07 Thread Stefan Hajnoczi
Block drivers may optimize I/O requests accessing buffers previously registered with bdrv_register_buf(). Checking whether all elements of a request's QEMUIOVector are within previously registered buffers is expensive, so we need a hint from the user to avoid costly checks. Add a BDRV_REQ_REGISTER

[RFC v3 1/8] blkio: add io_uring block driver using libblkio

2022-07-07 Thread Stefan Hajnoczi
libblkio (https://gitlab.com/libblkio/libblkio/) is a library for high-performance disk I/O. It currently supports io_uring and virtio-blk-vhost-vdpa with additional drivers under development. One of the reasons for developing libblkio is that other applications besides QEMU can use it. This will

[RFC v3 0/8] blkio: add libblkio BlockDriver

2022-07-07 Thread Stefan Hajnoczi
v3: - Add virtio-blk-vhost-vdpa for vdpa-blk devices including VDUSE - Add discard and write zeroes support - Rebase and adopt latest libblkio APIs v2: - Add BDRV_REQ_REGISTERED_BUF to bs.supported_write_flags [Stefano] - Use new blkioq_get_num_completions() API - Implement .bdrv_refresh_limits()

Re: [PATCH v6 6/8] KVM: Handle page fault for private memory

2022-07-07 Thread Xiaoyao Li
On 7/8/2022 4:08 AM, Sean Christopherson wrote: On Fri, Jul 01, 2022, Xiaoyao Li wrote: On 7/1/2022 6:21 AM, Michael Roth wrote: On Thu, Jun 30, 2022 at 12:14:13PM -0700, Vishal Annapurve wrote: With transparent_hugepages=always setting I see issues with the current implementation. ... Loo

Re: [PULL 0/9] target-arm queue

2022-07-07 Thread Richard Henderson
/qemu into staging (2022-07-07 06:21:05 +0530) are available in the Git repository at: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20220707 for you to fetch changes up to c2360eaa0262a816faf8032b7762d0c73df2cc62: target/arm: Fix qemu-system-arm handling of

Re: [PULL 00/18] s390x updates

2022-07-07 Thread Richard Henderson
On 7/7/22 13:24, Thomas Huth wrote: Hi Richard! The following changes since commit 39e19f5f67d925c60278a6156fd1776d04495a93: Merge tag 'pull-xen-20220705' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2022-07-05 22:13:51 +0530) are available in the Git reposit

RE: [Qemu] how to use viriofs in qemu without NUMA

2022-07-07 Thread Zhao, Shirley
Yes, the qemu version is too old. My previous qemu version is 4.2, and I upgraded it into 6.0, and it worked now. Thanks a lot. - Shirley -Original Message- From: Dr. David Alan Gilbert Sent: Tuesday, July 5, 2022 5:37 PM To: Zhao, Shirley Cc: Thomas Huth ; qemu-devel@nongnu.org;

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

2022-07-07 Thread Weiwei Li
在 2022/7/8 上午12:53, Mayuresh Chitale 写道: On Sat, 2022-07-02 at 18:19 +0800, angell1518 wrote: At 2022-06-04 00:04:22, "Mayuresh Chitale" wrote: Smstateen extension specifies a mechanism to close the potential covert channels that could cause security issues. This patch adds the CSRs defined

Re: [RFC PATCH v5 2/4] target/riscv: smstateen check for h/senvcfg

2022-07-07 Thread Weiwei Li
在 2022/7/8 上午1:20, Mayuresh Chitale 写道: On Sat, 2022-07-02 at 18:33 +0800, angell1518 wrote: At 2022-06-04 00:04:23, "Mayuresh Chitale" wrote: Accesses to henvcfg, henvcfgh and senvcfg are allowed only if corresponding bit in mstateen0/hstateen0 is enabled. Otherwise an illegal instruction tra

Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent

2022-07-07 Thread Peter Xu
On Thu, Jul 07, 2022 at 06:14:17PM -0300, Leonardo Brás wrote: > Having 'if(queued == sent)' will cause us to falsely return '1' in two buggy > cases, while 'if queued == 0) will either skip early or go into 'infinite' > loop. I'm not sure I strictly follow here.. Imagine the case we do flush()

[PATCH v3 3/4] target/ppc: use g_autofree in kvmppc_read_int_cpu_dt()

2022-07-07 Thread Daniel Henrique Barboza
This spares us a g_free() call. Let's also not use 'val' and return the value of kvmppc_read_int_dt() directly. Signed-off-by: Daniel Henrique Barboza --- target/ppc/kvm.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index cf4610

[PATCH v3 4/4] target/ppc: exit(1) on failure in kvmppc_get_clockfreq()

2022-07-07 Thread Daniel Henrique Barboza
When running under KVM accel it is expected to have 'clock-frequency' in the DT. Not having this attribute is too risky for both the machine emulation and userspace. We have a way of telling whether this error scenario might happen or not via kvmppc_read_int_cpu_dt() now being able to report error

[PATCH v3 1/4] target/ppc: add error report when fopen fails in kvmppc_read_int_dt()

2022-07-07 Thread Daniel Henrique Barboza
From: jianchunfu Use an Error pointer to report the error back to the caller. While we're at it, return '0' instead of '-1' on error since the function is supposed to return an uint64_t. Signed-off-by: jianchunfu [danielhb: return 0, use error_set_errno() instead of fprintf] Signed-off-by: Dan

[PATCH v3 2/4] target/ppc: enhance error report in kvmppc_read_int_cpu_dt()

2022-07-07 Thread Daniel Henrique Barboza
First and foremost, the function can't return '-1' when an error occurs because the return type is set to uint64_t. Let's fix that. After that, the function can't simply return 0 whether an error happened and call it a day. We must provide a way of letting callers know if the zero return is legiti

[PATCH v3 0/4] enhance error handling in kvmppc_read_int*

2022-07-07 Thread Daniel Henrique Barboza
Hi, In this v3 I changed the error report after fopen() to use error_setg_errno(), as suggested by Cedric. I also cut patch 1/1 because it's simpler to do all the function changes in a single patch instead of having a separated patch just to change the return value of both. Changes from v2: - fo

Re: [PATCH v3 3/3] migration/multifd: Warn user when zerocopy not working

2022-07-07 Thread Leonardo Brás
On Thu, 2022-07-07 at 16:06 -0400, Peter Xu wrote: > On Thu, Jul 07, 2022 at 04:59:22PM -0300, Leonardo Bras Soares Passos wrote: > > Hello Peter, > > > > On Thu, Jul 7, 2022 at 2:56 PM Peter Xu wrote: > > > > > > On Mon, Jul 04, 2022 at 05:23:15PM -0300, Leonardo Bras wrote: > > > > Some errors

Re: [PATCH v3 2/3] Add dirty-sync-missed-zero-copy migration stat

2022-07-07 Thread Leonardo Brás
On Thu, 2022-07-07 at 15:56 -0400, Peter Xu wrote: > On Thu, Jul 07, 2022 at 04:50:47PM -0300, Leonardo Bras Soares Passos wrote: > > > I also think we should squash > > > patch 2/3 as patch 3 only started to provide meaningful values. > > > > IIRC Previously in zero-copy-send implementation, I wa

Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent

2022-07-07 Thread Leonardo Brás
On Thu, 2022-07-07 at 15:52 -0400, Peter Xu wrote: > On Thu, Jul 07, 2022 at 04:44:21PM -0300, Leonardo Bras Soares Passos wrote: > > Hello Peter, > > > > On Thu, Jul 7, 2022 at 2:47 PM Peter Xu wrote: > > > > > > Hi, Leo, > > > > > > On Mon, Jul 04, 2022 at 05:23:13PM -0300, Leonardo Bras wrot

[Bug 1745312] Re: Regression report: Disk subsystem I/O failures/issues surfacing in DOS/early Windows [two separate issues: one bisected, one root-caused]

2022-07-07 Thread Lev Kujawski
Hi, Thanks to everyone who contributed information to this report. As far as issue #1 from David, I cannot reproduce the intermittent MS-DOS or Windows NT 4 I/O failures with the latest git revision (a74c66b1). I am similarly unable to reproduce Mdasoh's issue. For the NT 4 testing script, I had

[PATCH 1/2] Hexagon (target/hexagon) fix store w/mem_noshuf & predicated load

2022-07-07 Thread Taylor Simpson
Call the CHECK_NOSHUF macro multiple times: once in the fGEN_TCG_PRED_LOAD() and again in fLOAD(). Before this commit, a packet with a store and a predicated load with mem_noshuf that gets encoded like this: { P0 = cmp.eq(R17,#0x0) memw(R18+#0x0) = R2 if (!P0.new) R3 = memw(R17+#0

[PATCH 2/2] Hexagon (target/hexagon) fix bug in mem_noshuf load exception

2022-07-07 Thread Taylor Simpson
The semantics of a mem_noshuf packet are that the store effectively happens before the load. However, in cases where the load raises an exception, we cannot simply execute the store first. This change adds a probe to check that the load will not raise an exception before executing the store. If

[PATCH 0/2] Hexagon (target/hexagon) bug fixes for mem_noshuf

2022-07-07 Thread Taylor Simpson
Recall that the semantics of a Hexagon mem_noshuf packet are that the store effectively happens before the load. There are two bug fixes in this series. Taylor Simpson (2): Hexagon (target/hexagon) fix store w/mem_noshuf & predicated load Hexagon (target/hexagon) fix bug in mem_noshuf load e

[PATCH] hw/block/hd-geometry: Do not override specified bios-chs-trans

2022-07-07 Thread Lev Kujawski
For small disk images (<4 GiB), QEMU and SeaBIOS default to the LARGE/ECHS disk translation method, but it is not uncommon for other BIOS software to use LBA in these cases as well. Some operating system boot loaders (e.g., NT 4) do not handle LARGE translations outside of fixed configurations. S

Re: Support for Gaisler multicore LEONx SoCs

2022-07-07 Thread Peter Maydell
On Thu, 7 Jul 2022 at 20:54, Gregg Allison wrote: > We are considering the Gaisler GR712RC (2 core LEON3) and GR740 (4 core > LEON4) SoCs for a new deep space mission. > > Does QEMU support these two multicore configurations at present? Is there > an effort planned to provide multicore LEONx emul

Re: [PULL 14/15] qdev: Base object creation on QDict rather than QemuOpts

2022-07-07 Thread Peter Maydell
On Mon, 4 Jul 2022 at 05:50, Markus Armbruster wrote: > My initial (knee-jerk) reaction to breaking array properties: Faster, > Pussycat! Kill! Kill! In an ideal world, what would you replace them with? thanks -- PMM

Re: [PATCH v6 6/8] KVM: Handle page fault for private memory

2022-07-07 Thread Sean Christopherson
On Fri, Jul 01, 2022, Xiaoyao Li wrote: > On 7/1/2022 6:21 AM, Michael Roth wrote: > > On Thu, Jun 30, 2022 at 12:14:13PM -0700, Vishal Annapurve wrote: > > > With transparent_hugepages=always setting I see issues with the > > > current implementation. ... > > > Looks like with transparent huge p

Re: [PATCH v3 3/3] migration/multifd: Warn user when zerocopy not working

2022-07-07 Thread Peter Xu
On Thu, Jul 07, 2022 at 04:59:22PM -0300, Leonardo Bras Soares Passos wrote: > Hello Peter, > > On Thu, Jul 7, 2022 at 2:56 PM Peter Xu wrote: > > > > On Mon, Jul 04, 2022 at 05:23:15PM -0300, Leonardo Bras wrote: > > > Some errors, like the lack of Scatter-Gather support by the network > > > int

Re: [PATCH v3 3/3] migration/multifd: Warn user when zerocopy not working

2022-07-07 Thread Leonardo Bras Soares Passos
Hello Peter, On Thu, Jul 7, 2022 at 2:56 PM Peter Xu wrote: > > On Mon, Jul 04, 2022 at 05:23:15PM -0300, Leonardo Bras wrote: > > Some errors, like the lack of Scatter-Gather support by the network > > interface(NETIF_F_SG) may cause sendmsg(...,MSG_ZEROCOPY) to fail on using > > zero-copy, whic

Re: [PATCH v3 2/3] Add dirty-sync-missed-zero-copy migration stat

2022-07-07 Thread Peter Xu
On Thu, Jul 07, 2022 at 04:50:47PM -0300, Leonardo Bras Soares Passos wrote: > > I also think we should squash > > patch 2/3 as patch 3 only started to provide meaningful values. > > IIRC Previously in zero-copy-send implementation, I was asked to keep the > property/capability in a separated patc

Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent

2022-07-07 Thread Peter Xu
On Thu, Jul 07, 2022 at 04:44:21PM -0300, Leonardo Bras Soares Passos wrote: > Hello Peter, > > On Thu, Jul 7, 2022 at 2:47 PM Peter Xu wrote: > > > > Hi, Leo, > > > > On Mon, Jul 04, 2022 at 05:23:13PM -0300, Leonardo Bras wrote: > > > If flush is called when no buffer was sent with MSG_ZEROCOPY

Support for Gaisler multicore LEONx SoCs

2022-07-07 Thread Gregg Allison
We are considering the Gaisler GR712RC (2 core LEON3) and GR740 (4 core LEON4) SoCs for a new deep space mission. Does QEMU support these two multicore configurations at present? Is there an effort planned to provide multicore LEONx emulation? Gregg Allison [signature_1890048335] Senior Profess

Re: [PATCH v3 2/3] Add dirty-sync-missed-zero-copy migration stat

2022-07-07 Thread Leonardo Bras Soares Passos
Hello Peter, On Thu, Jul 7, 2022 at 2:54 PM Peter Xu wrote: > > On Mon, Jul 04, 2022 at 05:23:14PM -0300, Leonardo Bras wrote: > > Signed-off-by: Leonardo Bras > > --- > > qapi/migration.json | 7 ++- > > migration/migration.c | 2 ++ > > monitor/hmp-cmds.c| 4 > > 3 files change

[PATCH] linux-user/hppa: Fix segfaults on page zero

2022-07-07 Thread Helge Deller
This program: int main(void) { asm("bv %r0(%r0)"); return 0; } produces on real hardware the expected segfault: --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3} --- +++ killed by SIGSEGV +++ Segmentation fault But when run on linux-user you get instead internal qemu errors:

Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent

2022-07-07 Thread Leonardo Bras Soares Passos
Hello Peter, On Thu, Jul 7, 2022 at 2:47 PM Peter Xu wrote: > > Hi, Leo, > > On Mon, Jul 04, 2022 at 05:23:13PM -0300, Leonardo Bras wrote: > > If flush is called when no buffer was sent with MSG_ZEROCOPY, it currently > > returns 1. This return code should be used only when Linux fails to use >

[PATCH v9 12/14] tests: Add postcopy tls migration test

2022-07-07 Thread Peter Xu
We just added TLS tests for precopy but not postcopy. Add the corresponding test for vanilla postcopy. Rename the vanilla postcopy to "postcopy/plain" because all postcopy tests will only use unix sockets as channel. Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 61 +++

[PATCH v9 11/14] tests: Move MigrateCommon upper

2022-07-07 Thread Peter Xu
So that it can be used in postcopy tests too soon. Reviewed-by: Daniel P. Berrange Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 144 +-- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migra

[PATCH v9 06/14] migration: Add property x-postcopy-preempt-break-huge

2022-07-07 Thread Peter Xu
Add a property field that can conditionally disable the "break sending huge page" behavior in postcopy preemption. By default it's enabled. It should only be used for debugging purposes, and we should never remove the "x-" prefix. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Manish Mishra

Re: [PATCH 1/2] hw/gpio/aspeed: Don't let guests modify input pins

2022-07-07 Thread Peter Delevoryas
On Thu, Jul 07, 2022 at 10:53:57AM -0700, Peter Delevoryas wrote: > On Thu, Jul 07, 2022 at 10:56:02AM +0200, Cédric Le Goater wrote: > > On 7/7/22 09:17, Peter Delevoryas wrote: > > > It seems that aspeed_gpio_update is allowing the value for input pins to > > > be > > > modified through register

[PATCH v9 07/14] migration: Add helpers to detect TLS capability

2022-07-07 Thread Peter Xu
Add migrate_channel_requires_tls() to detect whether the specific channel requires TLS, leveraging the recently introduced migrate_use_tls(). No functional change intended. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/channel.c | 9 ++--- migration/migration.

[PATCH v9 13/14] tests: Add postcopy tls recovery migration test

2022-07-07 Thread Peter Xu
It's easy to build this upon the postcopy tls test. Rename the old postcopy recovery test to postcopy/recovery/plain. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 37 1 file changed, 29 insertions(+), 8 dele

[PATCH v9 05/14] migration: Create the postcopy preempt channel asynchronously

2022-07-07 Thread Peter Xu
This patch allows the postcopy preempt channel to be created asynchronously. The benefit is that when the connection is slow, we won't take the BQL (and potentially block all things like QMP) for a long time without releasing. A function postcopy_preempt_wait_channel() is introduced, allowing the

[PATCH v9 08/14] migration: Export tls-[creds|hostname|authz] params to cmdline too

2022-07-07 Thread Peter Xu
It's useful for specifying tls credentials all in the cmdline (along with the -object tls-creds-*), especially for debugging purpose. The trick here is we must remember to not free these fields again in the finalize() function of migration object, otherwise it'll cause double-free. The thing is w

[PATCH v9 04/14] migration: Postcopy recover with preempt enabled

2022-07-07 Thread Peter Xu
To allow postcopy recovery, the ram fast load (preempt-only) dest QEMU thread needs similar handling on fault tolerance. When ram_load_postcopy() fails, instead of stopping the thread it halts with a semaphore, preparing to be kicked again when recovery is detected. A mutex is introduced to make

[PATCH v9 14/14] tests: Add postcopy preempt tests

2022-07-07 Thread Peter Xu
Four tests are added for preempt mode: - Postcopy plain - Postcopy recovery - Postcopy tls - Postcopy tls+recovery Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 56 1 file changed, 56 insertions(+) d

[PATCH v9 09/14] migration: Enable TLS for preempt channel

2022-07-07 Thread Peter Xu
This patch is based on the async preempt channel creation. It continues wiring up the new channel with TLS handshake to destionation when enabled. Note that only the src QEMU needs such operation; the dest QEMU does not need any change for TLS support due to the fact that all channels are establi

[PATCH v9 01/14] migration: Add postcopy-preempt capability

2022-07-07 Thread Peter Xu
Firstly, postcopy already preempts precopy due to the fact that we do unqueue_page() first before looking into dirty bits. However that's not enough, e.g., when there're host huge page enabled, when sending a precopy huge page, a postcopy request needs to wait until the whole huge page that is sen

[PATCH v9 10/14] migration: Respect postcopy request order in preemption mode

2022-07-07 Thread Peter Xu
With preemption mode on, when we see a postcopy request that was requesting for exactly the page that we have preempted before (so we've partially sent the page already via PRECOPY channel and it got preempted by another postcopy request), currently we drop the request so that after all the other p

[PATCH v9 03/14] migration: Postcopy preemption enablement

2022-07-07 Thread Peter Xu
This patch enables postcopy-preempt feature. It contains two major changes to the migration logic: (1) Postcopy requests are now sent via a different socket from precopy background migration stream, so as to be isolated from very high page request delays. (2) For huge page enabled hosts:

[PATCH v9 02/14] migration: Postcopy preemption preparation on channel creation

2022-07-07 Thread Peter Xu
Create a new socket for postcopy to be prepared to send postcopy requested pages via this specific channel, so as to not get blocked by precopy pages. A new thread is also created on dest qemu to receive data from this new channel based on the ram_load_postcopy() routine. The ram_load_postcopy(PO

[PATCH v9 00/14] migration: Postcopy Preemption

2022-07-07 Thread Peter Xu
Based on: [PATCH] tests: migration-test: Allow test to run without uffd https://lore.kernel.org/qemu-devel/20220707184600.24164-1-pet...@redhat.com/ This is v8 of postcopy preempt series. It can also be found here: https://github.com/xzpeter/qemu/tree/postcopy-preempt RFC: https://lore.ker

Re: [PATCH RESEND] python/machine: Fix AF_UNIX path too long on macOS

2022-07-07 Thread Peter Delevoryas
On Wed, Jul 06, 2022 at 05:52:48PM -0700, Peter Delevoryas wrote: > On Wed, Jul 06, 2022 at 09:46:48AM -0700, Peter Delevoryas wrote: > > On Wed, Jul 06, 2022 at 09:02:14AM +0100, Daniel P. Berrangé wrote: > > > On Tue, Jul 05, 2022 at 02:46:59PM -0700, Peter Delevoryas wrote: > > > > I noticed tha

[PATCH] tests: migration-test: Allow test to run without uffd

2022-07-07 Thread Peter Xu
We used to stop running all tests if uffd is not detected. However logically that's only needed for postcopy not the rest of tests. Keep running the rest when still possible. Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions

Re: [PATCH 5/9] error-report: introduce ErrorReportDetailedFunc

2022-07-07 Thread Marc-André Lureau
Hi On Thu, Jul 7, 2022 at 4:13 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Remove monitor dependency from error printing code, by allowing programs > > to set a callback for when to use "detailed" reporting or not. > > > > Signed-off-b

Re: [PATCH 6/9] error-report: add a callback to overwrite error_vprintf

2022-07-07 Thread Marc-André Lureau
Hi On Thu, Jul 7, 2022 at 4:18 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > error_vprintf() is implemented in monitor.c, which overrides the > > default implementation from stubs/, while avoiding a direct dependency > > to the monitor f

Re: [PATCH v3 3/3] migration/multifd: Warn user when zerocopy not working

2022-07-07 Thread Peter Xu
On Mon, Jul 04, 2022 at 05:23:15PM -0300, Leonardo Bras wrote: > Some errors, like the lack of Scatter-Gather support by the network > interface(NETIF_F_SG) may cause sendmsg(...,MSG_ZEROCOPY) to fail on using > zero-copy, which causes it to fall back to the default copying mechanism. > > After ea

Re: [PATCH v3 2/3] Add dirty-sync-missed-zero-copy migration stat

2022-07-07 Thread Peter Xu
On Mon, Jul 04, 2022 at 05:23:14PM -0300, Leonardo Bras wrote: > Signed-off-by: Leonardo Bras > --- > qapi/migration.json | 7 ++- > migration/migration.c | 2 ++ > monitor/hmp-cmds.c| 4 > 3 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/qapi/migration.json b/qap

Re: [PATCH 1/2] hw/gpio/aspeed: Don't let guests modify input pins

2022-07-07 Thread Peter Delevoryas
On Thu, Jul 07, 2022 at 10:56:02AM +0200, Cédric Le Goater wrote: > On 7/7/22 09:17, Peter Delevoryas wrote: > > It seems that aspeed_gpio_update is allowing the value for input pins to be > > modified through register writes and QOM property modification. > > > > The QOM property modification is

Re: [PATCH 1/2] hw/gpio/aspeed: Don't let guests modify input pins

2022-07-07 Thread Peter Delevoryas
On Thu, Jul 07, 2022 at 08:20:01AM +, Joel Stanley wrote: > On Thu, 7 Jul 2022 at 07:17, Peter Delevoryas wrote: > > > > It seems that aspeed_gpio_update is allowing the value for input pins to be > > modified through register writes and QOM property modification. > > > > The QOM property modi

Re: [PATCH v3 1/3] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent

2022-07-07 Thread Peter Xu
Hi, Leo, On Mon, Jul 04, 2022 at 05:23:13PM -0300, Leonardo Bras wrote: > If flush is called when no buffer was sent with MSG_ZEROCOPY, it currently > returns 1. This return code should be used only when Linux fails to use > MSG_ZEROCOPY on a lot of sendmsg(). > > Fix this by returning early from

Re: [PATCH 1/9] monitor: make error_vprintf_unless_qmp() static

2022-07-07 Thread Marc-André Lureau
Hi On Thu, Jul 7, 2022 at 4:25 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Not needed outside monitor.c. Remove the needless stub. > > > > Signed-off-by: Marc-André Lureau > > --- > > include/monitor/monitor.h | 1 - > > monitor/moni

Re: [RFC PATCH v5 2/4] target/riscv: smstateen check for h/senvcfg

2022-07-07 Thread Mayuresh Chitale
On Sat, 2022-07-02 at 18:33 +0800, angell1518 wrote: > At 2022-06-04 00:04:23, "Mayuresh Chitale" > wrote: > >Accesses to henvcfg, henvcfgh and senvcfg are allowed > >only if corresponding bit in mstateen0/hstateen0 is > >enabled. Otherwise an illegal instruction trap is > >generated. > > > >Signe

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

2022-07-07 Thread Mayuresh Chitale
On Sat, 2022-07-02 at 18:19 +0800, angell1518 wrote: > At 2022-06-04 00:04:22, "Mayuresh Chitale" > wrote: > >Smstateen extension specifies a mechanism to close > >the potential covert channels that could cause security issues. > > > >This patch adds the CSRs defined in the specification and > >th

Re: [PATCH v2 1/7] tests: introduce tree-wide code style checking

2022-07-07 Thread Daniel P . Berrangé
On Mon, Jul 04, 2022 at 04:46:53PM +0100, Peter Maydell wrote: > On Mon, 4 Jul 2022 at 16:23, Daniel P. Berrangé wrote: > > > > Historically QEMU has used the 'scripts/checkpatch.pl' script to > > validate various style rules but there are a number of issues: > > > meson.build | 3

[PATCH v3 4/9] misc: fix commonly doubled up words

2022-07-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- block/linux-aio.c | 2 +- block/qcow2-bitmap.c | 8 contrib/plugins/cache.c| 2 +- disas/libvixl/vixl/invalset.h | 2 +- docs/devel/qom.rst | 4 ++-- docs/interop/liv

Re: [PATCH v2 00/15] virtio-gpio and various virtio cleanups

2022-07-07 Thread Stefan Hajnoczi
On Thu, Jul 7, 2022, 17:28 Alex Bennée wrote: > > Stefan Hajnoczi writes: > > > On Thu, 7 Jul 2022 at 14:42, Alex Bennée wrote: > >> > >> > >> Stefan Hajnoczi writes: > >> > >> > [[PGP Signed Part:Undecided]] > >> > On Tue, May 24, 2022 at 04:40:41PM +0100, Alex Bennée wrote: > >> >> Hi, > >>

[PATCH v3 6/9] misc: ensure qemu/osdep.h is included first in all .c files

2022-07-07 Thread Daniel P . Berrangé
A few files relied on qemu/osdep.h being included via a common header. Others didn't need it because they were actually an included file, so ought to have been named '.c.inc'. Finally some didn't have it as the first header included. Signed-off-by: Daniel P. Berrangé --- backends/hostmem-epc.c

[PATCH v3 7/9] tests/style: check qemu/osdep.h is included in all .c files

2022-07-07 Thread Daniel P . Berrangé
The qemu/osdep.h file must be included as the very first header in all C source files, to ensure its definitions take effect over all other header files, including system headers. Signed-off-by: Daniel P. Berrangé --- tests/style.yml | 24 +++- 1 file changed, 23 insertions(+

[PATCH v3 8/9] misc: remove qemu/osdep.h from headers / included source files

2022-07-07 Thread Daniel P . Berrangé
Since qemu/osdep.h is guaranteed present in all C source files, there is hno reason for it to be present in header files. Some C source files are not directly directly, but rather included from other source files. These should also not have qemu/osdep.h present, as the primary source will have alre

[PATCH v3 5/9] tests/style: check for commonly doubled up words

2022-07-07 Thread Daniel P . Berrangé
This style check looks for cases where the words the then in an on if is it but for or at and do to are repeated in a sentence. It uses a multi-line match to catch the especially common mistake in docs where the last word on a line is repeated as the first word of the next line. There are inev

[PATCH v3 9/9] tests/style: check qemu/osdep.h is NOT included in all .h/.c.inc files

2022-07-07 Thread Daniel P . Berrangé
Since the qemu/osdep.h file must be included as the very first header in all C source files, there is no reason to include it in .h or .c.in files. Signed-off-by: Daniel P. Berrangé --- tests/style.yml | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/style.yml b/tests/style.yml ind

[PATCH v3 1/9] tests: introduce tree-wide code style checking

2022-07-07 Thread Daniel P . Berrangé
Historically QEMU has used the 'scripts/checkpatch.pl' script to validate various style rules but there are a number of issues: - Contributors / maintainers are reluctant to add new tests to it, nor fix existint rules, because the Perl code is much too hard to understand for most people.

[PATCH v3 3/9] tests/style: check for mixups of bool constants with int variables

2022-07-07 Thread Daniel P . Berrangé
The 'true' and 'false' constants should only ever be used with the 'bool' type, never 'int'. Signed-off-by: Daniel P. Berrangé --- tests/style.yml | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/style.yml b/tests/style.yml index b4e7c6111f..704227d8e9 100644 --- a/tests/style.yml

[PATCH v3 2/9] misc: fix mixups of bool constants with int variables

2022-07-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- block/vhdx-log.c | 2 +- hw/xtensa/sim.c| 4 ++-- nbd/client.c | 8 +--- target/i386/cpu-dump.c | 3 ++- ui/spice-display.c | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/block/vhdx-log.c b/block/vhdx

[PATCH v3 0/9] tests: introduce a tree-wide code style checking facility

2022-07-07 Thread Daniel P . Berrangé
Update of: v2: https://lists.gnu.org/archive/html/qemu-devel/2022-07/msg00595.html The first patch gives a detailed description, but the overall goal here is to provide a code style checking facility to augment (and ideally replace) checkstyle.pl. The key conceptual differences are: - Always a

[PATCH RFC v2 2/2] qtests/arm: add some mte tests

2022-07-07 Thread Cornelia Huck
Signed-off-by: Cornelia Huck --- tests/qtest/arm-cpu-features.c | 77 ++ 1 file changed, 77 insertions(+) diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 5a145273860c..466be857d391 100644 --- a/tests/qtest/arm-cpu-features.c +++

[PATCH RFC v2 0/2] arm: enable MTE for QEMU + kvm

2022-07-07 Thread Cornelia Huck
This series makes it possible to enable MTE for kvm guests, if the kernel supports it. Again, tested on the simulator via patiently waiting for the arm64/mte kselftests to finish successfully. For tcg, turning on mte on the machine level (to get tag memory) stays a requirement. If the new mte cpu

[PATCH RFC v2 1/2] arm/kvm: add support for MTE

2022-07-07 Thread Cornelia Huck
Introduce a new cpu feature flag to control MTE support. To preserve backwards compatibility for tcg, MTE will continue to be enabled as long as tag memory has been provided. If MTE has been enabled, we need to disable migration, as we do not yet have a way to migrate the tags as well. Therefore,

Re: [RFC PATCH v5 4/4] target/riscv: smstateen check for AIA/IMSIC

2022-07-07 Thread Mayuresh Chitale
On Thu, 2022-06-16 at 17:18 +1000, Alistair Francis wrote: > On Sat, Jun 4, 2022 at 2:15 AM Mayuresh Chitale > wrote: > > If smstateen is implemented then accesses to AIA > > registers CSRS, IMSIC CSRs and other IMSIC registers > > is controlled by setting of corresponding bits in > > mstateen/hst

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

2022-07-07 Thread Mayuresh Chitale
On Thu, 2022-06-16 at 17:17 +1000, Alistair Francis wrote: > On Sat, Jun 4, 2022 at 2:08 AM Mayuresh Chitale > wrote: > > If smstateen is implemented and sstateen0.fcsr is clear > > then the floating point operations must return illegal > > instruction exception. > > > > Signed-off-by: Mayuresh C

Re: [PATCH v6 09/10] i386/pc: relocate 4g start to 1T where applicable

2022-07-07 Thread Joao Martins
On 7/1/22 17:10, Joao Martins wrote: > +/* > + * The HyperTransport range close to the 1T boundary is unique to AMD > + * hosts with IOMMUs enabled. Restrict the ram-above-4g relocation > + * to above 1T to AMD vCPUs only. > + */ > +if (IS_AMD_CPU(&cpu->env)) { > +pc

Re: [PATCH v3 10/13] tests/vm: Remove docker cross-compile test from CentOS VM

2022-07-07 Thread Daniel P . Berrangé
On Thu, Jul 07, 2022 at 11:48:35AM -0400, John Snow wrote: > On Thu, Jul 7, 2022 at 4:33 AM Daniel P. Berrangé wrote: > > > > On Thu, Jul 07, 2022 at 12:03:07AM -0400, John Snow wrote: > > > The fedora container has since been split apart, so there's no suitable > > > nearby target that would supp

Re: [RFC PATCH] qobject: Rewrite implementation of QDict for in-order traversal

2022-07-07 Thread Alex Bennée
Markus Armbruster writes: > QDict is implemented as a simple hash table of fixed size. Observe: > > * Slow for large n. Not sure this matters. > > * A QDict with n entries takes 4120 + n * 32 bytes on my box. Wastes > space for small n, which is a common case. > > * Order of traversal depe

Re: [PATCH v3 10/13] tests/vm: Remove docker cross-compile test from CentOS VM

2022-07-07 Thread John Snow
On Thu, Jul 7, 2022 at 4:33 AM Daniel P. Berrangé wrote: > > On Thu, Jul 07, 2022 at 12:03:07AM -0400, John Snow wrote: > > The fedora container has since been split apart, so there's no suitable > > nearby target that would support "test-mingw" as it requires both x32 > > and x64 support -- so ei

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

2022-07-07 Thread Mayuresh Chitale
On Thu, 2022-06-16 at 15:48 +1000, Alistair Francis wrote: > On Sat, Jun 4, 2022 at 2:13 AM Mayuresh Chitale > wrote: > > Smstateen extension specifies a mechanism to close > > the potential covert channels that could cause security issues. > > > > This patch adds the CSRs defined in the specific

Re: [PATCH v3 09/13] tests/vm: upgrade Ubuntu 18.04 VM to 20.04

2022-07-07 Thread John Snow
On Thu, Jul 7, 2022 at 7:05 AM Richard Henderson wrote: > > On 7/7/22 09:33, John Snow wrote: > > 18.04 has fallen out of our support window, so move ubuntu.aarch64 > > forward to ubuntu 20.04, which is now our oldest supported Ubuntu > > release. > > Ah. Squash with patch 5? Can do. I left it s

Re: [RFC PATCH] qobject: Rewrite implementation of QDict for in-order traversal

2022-07-07 Thread Daniel P . Berrangé
On Tue, Jul 05, 2022 at 11:54:21AM +0200, Markus Armbruster wrote: > QDict is implemented as a simple hash table of fixed size. Observe: > > * Slow for large n. Not sure this matters. I presume you're referring qdict_find() here, which would ideally be O(1). Our bucket size is 512, so for hash

Re: [PATCH v2 00/15] virtio-gpio and various virtio cleanups

2022-07-07 Thread Alex Bennée
Stefan Hajnoczi writes: > On Thu, 7 Jul 2022 at 14:42, Alex Bennée wrote: >> >> >> Stefan Hajnoczi writes: >> >> > [[PGP Signed Part:Undecided]] >> > On Tue, May 24, 2022 at 04:40:41PM +0100, Alex Bennée wrote: >> >> Hi, >> >> >> >> This series ostensibly adds virtio-user-gpio stubs to the bu

Re: [PATCH v6 08/10] i386/pc: factor out device_memory base/size to helper

2022-07-07 Thread Joao Martins
On 7/7/22 14:15, Igor Mammedov wrote: > On Fri, 1 Jul 2022 17:10:12 +0100 > Joao Martins wrote: > >> Move obtaining hole64_start from device_memory MR base/size into an helper >> alongside correspondent getters in pc_memory_init() when the hotplug >> range is unitialized. >> >> This is the fi

Re: [PATCH v3 01/13] qga: treat get-guest-fsinfo as "best effort"

2022-07-07 Thread John Snow
On Thu, Jul 7, 2022 at 4:40 AM Marc-André Lureau wrote: > > Hi > > On Thu, Jul 7, 2022 at 8:10 AM John Snow wrote: >> >> In some container environments, there may be references to block devices >> witnessable from a container through /proc/self/mountinfo that reference >> devices we simply don't

Re: [PATCH v6 07/10] i386/pc: handle unitialized mr in pc_get_cxl_range_end()

2022-07-07 Thread Joao Martins
On 7/7/22 14:05, Igor Mammedov wrote: > On Fri, 1 Jul 2022 17:10:11 +0100 > Joao Martins wrote: > >> This in preparation to allow pc_pci_hole64_start() to be called early >> in pc_memory_init(), handle CXL memory region end when its underlying >> memory region isn't yet initialized. >> >> Cc:

  1   2   >