Re: [PATCH v5 00/18] tests/qtest: Enable running qtest on Windows

2022-10-06 Thread Bin Meng
On Fri, Oct 7, 2022 at 4:35 AM Alex Bennée wrote: > > > Bin Meng writes: > > > In preparation to adding virtio-9p support on Windows, this series > > enables running qtest on Windows, so that we can run the virtio-9p > > tests on Windows to make sure it does not break accidently. > > I'm happy

Re: [RFC PATCH 2/4] acpi: fadt: support revision 6.0 of the ACPI specification

2022-10-06 Thread Ani Sinha
On Thu, 6 Oct 2022, Miguel Luis wrote: > Update the Fixed ACPI Description Table (FADT) to revision 6.0 of the ACPI > specification adding the field "Hypervisor Vendor Identity" that was missing. > > This field's description states the following: "64-bit identifier of > hypervisor > vendor.

Re: [RFC PATCH 3/4] acpi: arm/virt: madt: bump to revision 4 accordingly to ACPI 6.0 Errata A

2022-10-06 Thread Ani Sinha
On Thu, 6 Oct 2022, Miguel Luis wrote: > MADT has been updated with the GIC Structures from ACPI 6.0 Errata A > and so MADT revision and GICC Structure must be updated also. > > Fixes: 37f33084ed2e ("acpi: arm/virt: madt: use build_append_int_noprefix() > API to compose MADT table") > >

[PATCH RESEND] cirrus_vga: fix potential memory overflow

2022-10-06 Thread luzhipeng
From: lu zhipeng Signed-off-by: lu zhipeng --- hw/display/cirrus_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 3bb6a58698..2577005d03 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -834,7

[PATCH RESEND] elf2dmp: free memory in failure

2022-10-06 Thread luzhipeng
From: lu zhipeng The 'kdgb' is allocating memory in get_kdbg(), but it is not freed in error path. So fix that. Signed-off-by: lu zhipeng --- contrib/elf2dmp/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index b9fc6d230c..d77b8f98f7

Re: [PATCH] linux-user: mprotect() should returns 0 when len is 0.

2022-10-06 Thread Richard Henderson
On 10/6/22 08:38, Soichiro Isshiki wrote: From: sisshiki1969 For now, qemu-x86_64 returns ENOMEM when mprotect() was called with an argument len is 0 from a guest process. This behavior is incompatible with the current Linux implementation, which mprotect() with len = 0 does nothing and

Re: [PATCH] gitmodules: recurse by default

2022-10-06 Thread Michael S. Tsirkin
On Thu, Oct 06, 2022 at 07:54:52PM +0100, Daniel P. Berrangé wrote: > On Thu, Oct 06, 2022 at 07:39:07AM -0400, Michael S. Tsirkin wrote: > > The most commmon complaint about submodules is that > > they don't follow when one switches branches in the > > main repo. Enable recursing into submodules

[PATCH 2/2] hw/cxl: Allow CXL type-3 devices to be persistent or volatile

2022-10-06 Thread Gregory Price
This commit enables setting one memory region for a type-3 device, but that region may now be either a persistent region or volatile region. Future work may enable setting both regions simultaneously, as this is a possible configuration on a real type-3 device. The scaffolding was put in for

[PATCH 1/2] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-10-06 Thread Gregory Price
Current code sets to STORAGE_EXPRESS and then overrides it. Signed-off-by: Gregory Price --- hw/mem/cxl_type3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index ada2108fac..1837c1c83a 100644 --- a/hw/mem/cxl_type3.c +++

Re: [PATCH v10 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-10-06 Thread Damien Le Moal
On 10/7/22 00:17, Stefan Hajnoczi wrote: > On Tue, Oct 04, 2022 at 08:23:15AM +0900, Damien Le Moal wrote: >> On 2022/10/04 2:47, Stefan Hajnoczi wrote: >>> On Thu, Sep 29, 2022 at 04:36:27PM +0800, Sam Li wrote: Add a new zoned_host_device BlockDriver. The zoned_host_device option

[PATCH] hw/arm/aspeed: increase Bletchley memory size

2022-10-06 Thread Patrick Williams
For the PVT-class hardware we have increased the memory size of this device to 2 GiB. Adjust the device model accordingly. Signed-off-by: Patrick Williams --- hw/arm/aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index

Re: [PATCH v3 0/8] m25p80: Add SFDP support

2022-10-06 Thread Patrick Williams
On Fri, Jul 22, 2022 at 08:35:54AM +0200, Cédric Le Goater wrote: > > Cédric Le Goater (8): > m25p80: Add basic support for the SFDP command > m25p80: Add the n25q256a SFDP table > m25p80: Add the mx25l25635e SFPD table > m25p80: Add the mx25l25635f SFPD table > m25p80: Add the

[PATCH] m25p80: Add the w25q01jvq SFPD table

2022-10-06 Thread Patrick Williams
Generated from hardware using the following command and then padding with 0xff to fill out a power-of-2: hexdump -v -e '8/1 "0x%02x, " "\n"' sfdp` Signed-off-by: Patrick Williams --- hw/block/m25p80.c | 3 ++- hw/block/m25p80_sfdp.c | 36

Re: [PATCH] linux-user: mprotect() should returns 0 when len is 0.

2022-10-06 Thread 一色聡一郎
Thank you for your response. Yes, we can also modify guest_range_valid_untagged() like this: static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len) { -return len - 1 <= GUEST_ADDR_MAX && start <= GUEST_ADDR_MAX - len + 1; + return !len || len - 1 <= GUEST_ADDR_MAX

[PATCH v6 13/13] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-10-06 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 ---

[PATCH v6 12/13] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-10-06 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()

[PATCH v6 09/13] block: add BlockRAMRegistrar

2022-10-06 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.

[PATCH v6 10/13] exec/cpu-common: add qemu_ram_get_fd()

2022-10-06 Thread Stefan Hajnoczi
Add a function to get the file descriptor for a RAMBlock. Device emulation code typically uses the MemoryRegion APIs but vhost-style code may use RAMBlock directly for sharing guest memory with another process. This new API will be used by the libblkio block driver so it can share guest memory

[PATCH v6 11/13] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd()

2022-10-06 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 RAMBlock 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

[PATCH v6 08/13] numa: use QLIST_FOREACH_SAFE() for RAM block notifiers

2022-10-06 Thread Stefan Hajnoczi
Make list traversal work when a callback removes a notifier mid-traversal. This is a cleanup to prevent bugs in the future. Signed-off-by: Stefan Hajnoczi --- hw/core/numa.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index

[PATCH v6 07/13] block: return errors from bdrv_register_buf()

2022-10-06 Thread Stefan Hajnoczi
Registering an I/O buffer is only a performance optimization hint but it is still necessary to return errors when it fails. Later patches will need to detect errors when registering buffers but an immediate advantage is that error_report() calls are no longer needed in block driver

[PATCH v6 05/13] block: use BdrvRequestFlags type for supported flag fields

2022-10-06 Thread Stefan Hajnoczi
Use the enum type so GDB displays the enum members instead of printing a numeric constant. Signed-off-by: Stefan Hajnoczi --- include/block/block_int-common.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/block/block_int-common.h

[PATCH v6 04/13] block: pass size to bdrv_unregister_buf()

2022-10-06 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

[PATCH v6 06/13] block: add BDRV_REQ_REGISTERED_BUF request flag

2022-10-06 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

[PATCH v6 02/13] blkio: add libblkio block driver

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

[PATCH v6 03/13] numa: call ->ram_block_removed() in ram_block_notifer_remove()

2022-10-06 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

[PATCH v6 01/13] coroutine: add flag to re-queue at front of CoQueue

2022-10-06 Thread Stefan Hajnoczi
When a coroutine wakes up it may determine that it must re-queue. Normally coroutines are pushed onto the back of the CoQueue, but for fairness it may be necessary to push it onto the front of the CoQueue. Add a flag to specify that the coroutine should be pushed onto the front of the CoQueue. A

[PATCH v6 00/13] blkio: add libblkio BlockDriver

2022-10-06 Thread Stefan Hajnoczi
v6: - Add untested nvme-io_uring driver. Please test in your nested NVMe environment, Alberto. [Alberto] - Map blkio mem regions only when necessary to reduce conflicts with RAM discard [Alberto] - Reduce duplication by having a single blkio_virtio_blk_common_open() function [Alberto] - Avoid

Re: [PATCH v3] win32: set threads name

2022-10-06 Thread Richard Henderson
On 10/6/22 05:51, Marc-André Lureau wrote: Hi Richard On Mon, Oct 3, 2022 at 11:39 AM Marc-André Lureau > wrote: Hi On Fri, Sep 30, 2022 at 6:10 PM Richard Henderson mailto:richard.hender...@linaro.org>> wrote: > > On 9/30/22 07:03,

Re: [PATCH v3 01/42] target/arm: Split s2walk_secure from ipa_secure in get_phys_addr

2022-10-06 Thread Richard Henderson
On 10/6/22 11:55, Peter Maydell wrote: On Thu, 6 Oct 2022 at 19:20, Richard Henderson wrote: On 10/6/22 08:22, Peter Maydell wrote: Yeah, cleared-at-start is fine. But here we're also relying on the stage 2 call to get_phys_addr_lpae() not setting it to 1, because we pass that the same

Re: [PATCH v5 00/18] tests/qtest: Enable running qtest on Windows

2022-10-06 Thread Alex Bennée
Bin Meng writes: > In preparation to adding virtio-9p support on Windows, this series > enables running qtest on Windows, so that we can run the virtio-9p > tests on Windows to make sure it does not break accidently. I'm happy to take this whole series through my testing/next however I don't

Re: [PATCH 06/14] migration: Use atomic ops properly for page accountings

2022-10-06 Thread Peter Xu
On Wed, Oct 05, 2022 at 09:53:57AM -0400, Peter Xu wrote: > On Wed, Oct 05, 2022 at 12:38:05PM +0100, Dr. David Alan Gilbert wrote: > > * Peter Xu (pet...@redhat.com) wrote: > > > On Tue, Oct 04, 2022 at 05:59:36PM +0100, Dr. David Alan Gilbert wrote: > > > > * Peter Xu (pet...@redhat.com) wrote:

Re: [PULL 28/54] configure: build ROMs with container-based cross compilers

2022-10-06 Thread Stefan Hajnoczi
On Tue, Oct 04, 2022 at 02:01:12PM +0100, Alex Bennée wrote: > From: Paolo Bonzini > > s390-ccw remains a bit more complex, because the -march=z900 test is done > only for the native cross compiler. Otherwise, all that is needed is > to pass the (now mandatory) target argument to

Re: [PULL 26/54] configure: unify creation of cross-compilation Makefiles

2022-10-06 Thread Stefan Hajnoczi
On Tue, Oct 04, 2022 at 02:01:10PM +0100, Alex Bennée wrote: > From: Paolo Bonzini > > Let write_target_makefile handle both host and container cross compilers. > > Signed-off-by: Paolo Bonzini > Signed-off-by: Alex Bennée > Message-Id: <20220929114231.583801-27-alex.ben...@linaro.org> I

[PATCH 3/6] target/ppc: fix REQUIRE_HV macro definition

2022-10-06 Thread Matheus Ferst
The macro is missing a '{' after the if condition. Any use of REQUIRE_HV would cause a compilation error. Fixes: fc34e81acd51 ("target/ppc: add macros to check privilege level") Signed-off-by: Matheus Ferst --- target/ppc/translate.c | 12 ++-- 1 file changed, 6 insertions(+), 6

[PATCH 6/6] target/ppc: move msgsync to decodetree

2022-10-06 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/insn32.decode | 1 + target/ppc/translate.c | 14 -- target/ppc/translate/processor-ctrl-impl.c.inc | 9 + 3 files changed, 10 insertions(+), 14 deletions(-) diff --git

[PATCH 5/6] target/ppc: move msgclrp/msgsndp to decodetree

2022-10-06 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/insn32.decode | 2 ++ target/ppc/translate.c| 26 --- .../ppc/translate/processor-ctrl-impl.c.inc | 24 + 3 files changed, 26 insertions(+), 26 deletions(-) diff --git

[PATCH 2/6] target/ppc: fix msgsync insns flags

2022-10-06 Thread Matheus Ferst
This instruction was added by Power ISA 3.0, using PPC2_PRCNTL makes it available for older processors, like de e5500 and e6500. Fixes: 7af1e7b02264 ("target/ppc: add support for hypervisor doorbells on book3s CPUs") Signed-off-by: Matheus Ferst --- target/ppc/translate.c | 2 +- 1 file

[PATCH 4/6] target/ppc: move msgclr/msgsnd to decodetree

2022-10-06 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/insn32.decode | 5 ++ target/ppc/translate.c| 34 + .../ppc/translate/processor-ctrl-impl.c.inc | 70 +++ 3 files changed, 77 insertions(+), 32 deletions(-) create mode 100644

[PATCH 1/6] target/ppc: fix msgclr/msgsnd insns flags

2022-10-06 Thread Matheus Ferst
On Power ISA v2.07, the category for these instructions became "Embedded.Processor Control" or "Book S". Signed-off-by: Matheus Ferst --- target/ppc/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index

[PATCH 0/6] Enable doorbell instruction for POWER8 CPUs

2022-10-06 Thread Matheus Ferst
Reviewing the interrupt rework patch series, Fabiano noted[1] that the POWER8 User's Manual lists the Directed Hypervisor Doorbell interrupt, even without implementing the "Embedded.Processor Control" category. The manual also lists the msgclr and msgsnd instructions, but the decode legacy code

[PATCH v4] virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events.

2022-10-06 Thread Venu Busireddy
Section 5.6.6.3 of VirtIO specification states, "Events will also be reported via sense codes..." However, no sense data is sent when VIRTIO_SCSI_EVT_RESET_RESCAN or VIRTIO_SCSI_EVT_RESET_REMOVED events are reported (when disk hotplug/hotunplug events occur). SCSI layer on Solaris depends on this

Re: [PATCH v3] virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events.

2022-10-06 Thread Venu Busireddy
On 2022-10-05 23:37:33 +0200, Paolo Bonzini wrote: > On 10/4/22 01:13, Venu Busireddy wrote: > > > script? Something must be putting the SCSI command in the queue. > > > Perhaps the driver is doing so when it sees an event? And if it is > > > bypassing the normal submission mechanism, the REPORT

Re: [PATCH v3 25/42] target/arm: Move ARMMMUIdx_Stage2 to a real tlb mmu_idx

2022-10-06 Thread Richard Henderson
On 10/6/22 08:46, Peter Maydell wrote: Side note, looks like we didn't update vttbr_write() to know about the EL2&0 MMU indexes ? EL2&0 is a single-stage regime, unaffected by VTTBR. r~

Re: [PATCH v5 02/12] blkio: add libblkio block driver

2022-10-06 Thread Stefan Hajnoczi
On Thu, Oct 06, 2022 at 05:41:39PM +0100, Alberto Faria wrote: > On Tue, Sep 27, 2022 at 8:34 PM Stefan Hajnoczi wrote: > > +static int blkio_virtio_blk_vhost_user_open(BlockDriverState *bs, > > +QDict *options, int flags, Error **errp) > > +{ > > +const char *path =

Re: [PATCH] gitmodules: recurse by default

2022-10-06 Thread Daniel P . Berrangé
On Thu, Oct 06, 2022 at 07:39:07AM -0400, Michael S. Tsirkin wrote: > The most commmon complaint about submodules is that > they don't follow when one switches branches in the > main repo. Enable recursing into submodules by default > to address that. > > Signed-off-by: Michael S. Tsirkin > ---

Re: [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-10-06 Thread Alberto Faria
On Thu, Oct 6, 2022 at 7:46 PM Stefan Hajnoczi wrote: > > Regardless, I'd say we want to map memory regions even if we don't > > strictly need to (in cases where we can do so at no additional cost), > > since that may improve performance for some drivers. > > The downside is that when

Re: [PATCH v3 23/42] target/arm: Use probe_access_full for BTI

2022-10-06 Thread Richard Henderson
On 10/6/22 07:57, Peter Maydell wrote: On Sat, 1 Oct 2022 at 17:38, Richard Henderson wrote: Add a field to TARGET_PAGE_ENTRY_EXTRA to hold the guarded bit. In is_guarded_page, use probe_access_full instead of just guessing that the tlb entry is still present. Also handles the FIXME about

Re: [PATCH v3 01/42] target/arm: Split s2walk_secure from ipa_secure in get_phys_addr

2022-10-06 Thread Peter Maydell
On Thu, 6 Oct 2022 at 19:20, Richard Henderson wrote: > > On 10/6/22 08:22, Peter Maydell wrote: > > Yeah, cleared-at-start is fine. But here we're also relying on > > the stage 2 call to get_phys_addr_lpae() not setting it to 1, > > because we pass that the same 'result' pointer, not a fresh

Re: [PATCH 11/14] migration: Move last_sent_block into PageSearchStatus

2022-10-06 Thread Peter Xu
On Thu, Oct 06, 2022 at 05:59:51PM +0100, Dr. David Alan Gilbert wrote: > > @@ -2999,8 +3010,8 @@ void ram_postcopy_send_discard_bitmap(MigrationState > > *ms) > > migration_bitmap_sync(rs); > > > > /* Easiest way to make sure we don't resume in the middle of a > > host-page */ > > +

Re: [PATCH] linux-user: mprotect() should returns 0 when len is 0.

2022-10-06 Thread Richard Henderson
On 10/6/22 11:13, Peter Maydell wrote: On Thu, 6 Oct 2022 at 19:05, Soichiro Isshiki wrote: From: sisshiki1969 For now, qemu-x86_64 returns ENOMEM when mprotect() was called with an argument len is 0 from a guest process. This behavior is incompatible with the current Linux implementation,

Re: [PATCH] linux-user,bsd-user: re-exec with G_SLICE=always-malloc

2022-10-06 Thread Kyle Evans
On Thu, Oct 6, 2022 at 11:29 AM Richard Henderson wrote: > > On 10/6/22 11:12, Daniel P. Berrangé wrote: > > The only possible silver linining is that in static linked builds, > > it appears that a QEMU constructor with priority 101, will pre-empt > > the constructor from any library. This is

Re: [PATCH] linux-user,bsd-user: re-exec with G_SLICE=always-malloc

2022-10-06 Thread Richard Henderson
On 10/6/22 11:12, Daniel P. Berrangé wrote: On Tue, Oct 04, 2022 at 07:59:18AM -0700, Richard Henderson wrote: On 10/4/22 05:00, Daniel P. Berrangé wrote: g_slice uses a one-time initializer to check the G_SLICE env variable making it hard for QEMU to set the env before any GLib API call has

Re: [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-10-06 Thread Stefan Hajnoczi
On Thu, Oct 06, 2022 at 07:09:36PM +0100, Alberto Faria wrote: > On Thu, Oct 6, 2022 at 7:00 PM Stefan Hajnoczi wrote: > > s->needs_mem_regions determines if we'll use libblkio memory regions at > > all. When it's false we skip blkio_map_mem_region() and therefore it's > > safe to set

Re: [PATCH 11/14] migration: Move last_sent_block into PageSearchStatus

2022-10-06 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > On Thu, Oct 06, 2022 at 05:59:51PM +0100, Dr. David Alan Gilbert wrote: > > > @@ -2999,8 +3010,8 @@ void > > > ram_postcopy_send_discard_bitmap(MigrationState *ms) > > > migration_bitmap_sync(rs); > > > > > > /* Easiest way to make sure we don't

Re: ublk-qcow2: ublk-qcow2 is available

2022-10-06 Thread Stefan Hajnoczi
On Thu, Oct 06, 2022 at 11:09:48PM +0800, Ming Lei wrote: > On Thu, Oct 06, 2022 at 09:59:40AM -0400, Stefan Hajnoczi wrote: > > On Thu, Oct 06, 2022 at 06:26:15PM +0800, Ming Lei wrote: > > > On Wed, Oct 05, 2022 at 11:11:32AM -0400, Stefan Hajnoczi wrote: > > > > On Tue, Oct 04, 2022 at

Re: [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-10-06 Thread Alberto Faria
On Thu, Oct 6, 2022 at 7:00 PM Stefan Hajnoczi wrote: > s->needs_mem_regions determines if we'll use libblkio memory regions at > all. When it's false we skip blkio_map_mem_region() and therefore it's > safe to set s->mem_regions_pinned to false. blkio_register_buf() calls

Re: [PATCH] linux-user: mprotect() should returns 0 when len is 0.

2022-10-06 Thread Peter Maydell
On Thu, 6 Oct 2022 at 19:05, Soichiro Isshiki wrote: > > From: sisshiki1969 > > For now, qemu-x86_64 returns ENOMEM when mprotect() was called with an > argument > len is 0 from a guest process. > This behavior is incompatible with the current Linux implementation, > which mprotect() with len =

Re: [PATCH v3 01/42] target/arm: Split s2walk_secure from ipa_secure in get_phys_addr

2022-10-06 Thread Richard Henderson
On 10/6/22 08:22, Peter Maydell wrote: Yeah, cleared-at-start is fine. But here we're also relying on the stage 2 call to get_phys_addr_lpae() not setting it to 1, because we pass that the same 'result' pointer, not a fresh one. I clear it first: that patch is already merged:

Re: [PATCH] tests/qtest: npcm7xx-emc-test: Skip checking MAC

2022-10-06 Thread Patrick Venture
On Thu, Oct 6, 2022 at 10:58 AM Patrick Venture wrote: > > > On Tue, Sep 20, 2022 at 12:00 AM Thomas Huth wrote: > >> On 20/09/2022 00.37, Patrick Venture wrote: >> > >> > >> > On Mon, Sep 19, 2022 at 5:44 AM Thomas Huth > > > wrote: >> > >> > On 06/09/2022 18.31,

Re: [PATCH] linux-user,bsd-user: re-exec with G_SLICE=always-malloc

2022-10-06 Thread Daniel P . Berrangé
On Tue, Oct 04, 2022 at 07:59:18AM -0700, Richard Henderson wrote: > On 10/4/22 05:00, Daniel P. Berrangé wrote: > > g_slice uses a one-time initializer to check the G_SLICE env variable > > making it hard for QEMU to set the env before any GLib API call has > > triggered the initializer. Even

Re: [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-10-06 Thread Stefan Hajnoczi
On Wed, Sep 28, 2022 at 09:12:36PM +0100, Alberto Campinho Faria wrote: > On Wed, Sep 28, 2022 at 8:21 PM Stefan Hajnoczi wrote: > > On Tue, Sep 27, 2022 at 03:34:30PM -0400, Stefan Hajnoczi wrote: > > > +ret = blkio_get_bool(s->blkio, > > > + "mem-regions-pinned", > >

Re: [PATCH 13/14] migration: Remove old preempt code around state maintainance

2022-10-06 Thread Dr. David Alan Gilbert
For the set of 3: Reviewed-by: Dr. David Alan Gilbert * Peter Xu (pet...@redhat.com) wrote: > On Tue, Sep 20, 2022 at 08:47:20PM -0400, Peter Xu wrote: > > On Tue, Sep 20, 2022 at 06:52:27PM -0400, Peter Xu wrote: > > > With the new code to send pages in rp-return thread, there's little help

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-06 Thread Gregory Price
On Thu, Oct 06, 2022 at 05:42:14PM +0100, Jonathan Cameron wrote: > > > > 1) The PCI device type is set prior to realize/attributes, and is > > currently still set to PCI_CLASS_STORAGE_EXPRESS. Should this instead > > be PCI_CLASS_MEMORY_CXL when presenting as a simple memory expander? > > We

Re: [PATCH 14/14] migration: Drop rs->f

2022-10-06 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Now with rs->pss we can already cache channels in pss->pss_channels. That > pss_channel contains more infromation than rs->f because it's per-channel. > So rs->f could be replaced by rss->pss[RAM_CHANNEL_PRECOPY].pss_channel, > while rs->f itself is a bit

Re: [PATCH] tests/qtest: npcm7xx-emc-test: Skip checking MAC

2022-10-06 Thread Patrick Venture
On Tue, Sep 20, 2022 at 12:00 AM Thomas Huth wrote: > On 20/09/2022 00.37, Patrick Venture wrote: > > > > > > On Mon, Sep 19, 2022 at 5:44 AM Thomas Huth > > wrote: > > > > On 06/09/2022 18.31, Patrick Venture wrote: > > > The register tests walks all the

Re: [PATCH v12 00/21] job: replace AioContext lock with job_mutex

2022-10-06 Thread Kevin Wolf
Am 26.09.2022 um 11:31 hat Emanuele Giuseppe Esposito geschrieben: > In this series, we want to remove the AioContext lock and instead > use the already existent job_mutex to protect the job structures > and list. This is part of the work to get rid of AioContext lock > usage in favour of smaller

Re: [PATCH 12/14] migration: Send requested page directly in rp-return thread

2022-10-06 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > With all the facilities ready, send the requested page directly in the > rp-return thread rather than queuing it in the request queue, if and only > if postcopy preempt is enabled. It can achieve so because it uses separate > channel for sending urgent

Re: [PATCH v12 16/21] blockjob: protect iostatus field in BlockJob struct

2022-10-06 Thread Kevin Wolf
Am 26.09.2022 um 11:32 hat Emanuele Giuseppe Esposito geschrieben: > iostatus is the only field (together with .job) that needs > protection using the job mutex. > > It is set in the main loop (GLOBAL_STATE functions) but read > in I/O code (block_job_error_action). > > In order to protect it,

Re: [PATCH v5 00/12] blkio: add libblkio BlockDriver

2022-10-06 Thread Stefan Hajnoczi
On Thu, Oct 06, 2022 at 02:18:35PM +0200, Stefano Garzarella wrote: > Hi Stefan, > I tested this series with the vDPA block simulator in Linux v6.0. > It worked well, but I had a segfault when blkio_map_mem_region() fails. > > In my case, it failed because I forgot to increase the `memlock` limit

[PATCH] linux-user: mprotect() should returns 0 when len is 0.

2022-10-06 Thread Soichiro Isshiki
From: sisshiki1969 For now, qemu-x86_64 returns ENOMEM when mprotect() was called with an argument len is 0 from a guest process. This behavior is incompatible with the current Linux implementation, which mprotect() with len = 0 does nothing and returns 0, although it does not appear to be

[PATCH] linux-user: mprotect() should returns 0 when len is 0.

2022-10-06 Thread Soichiro Isshiki
From: sisshiki1969 Signed-off-by: sisshiki1969 --- linux-user/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 28f3bc85ed..1ed79459ea 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -130,12 +130,12 @@ int

[RFC PATCH 4/4] Step 6 & 7 of the bios-tables-test.c documented procedure.

2022-10-06 Thread Miguel Luis
Differences between disassembled ASL files for MADT: @@ -11,9 +11,9 @@ */ [000h 4]Signature : "APIC"[Multiple APIC Description Table (MADT)] -[004h 0004 4] Table Length : 00A8 -[008h 0008 1] Revision : 03 -[009h 0009

Re: [PATCH v10 4/5] target/riscv: smstateen check for fcsr

2022-10-06 Thread mchitale
On Tue, 2022-10-04 at 21:23 +0800, weiwei wrote: > > > > > On 2022/10/4 14:51, > mchit...@ventanamicro.com wrote: > > > > > > On Mon, 2022-10-03 at 21:02 +0800, weiwei wrote: > > > > > On 2022/10/3 19:47, Mayuresh Chitale wrote: > > >

[RFC PATCH 3/4] acpi: arm/virt: madt: bump to revision 4 accordingly to ACPI 6.0 Errata A

2022-10-06 Thread Miguel Luis
MADT has been updated with the GIC Structures from ACPI 6.0 Errata A and so MADT revision and GICC Structure must be updated also. Fixes: 37f33084ed2e ("acpi: arm/virt: madt: use build_append_int_noprefix() API to compose MADT table") Signed-off-by: Miguel Luis --- hw/arm/virt-acpi-build.c |

Re: [PATCH 11/14] migration: Move last_sent_block into PageSearchStatus

2022-10-06 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Since we use PageSearchStatus to represent a channel, it makes perfect > sense to keep last_sent_block (aka, leverage RAM_SAVE_FLAG_CONTINUE) to be > per-channel rather than global because each channel can be sending > different pages on ramblocks. > >

Re: [PATCH v5 02/12] blkio: add libblkio block driver

2022-10-06 Thread Alberto Faria
On Tue, Sep 27, 2022 at 8:34 PM Stefan Hajnoczi wrote: > +static int blkio_virtio_blk_vhost_user_open(BlockDriverState *bs, > +QDict *options, int flags, Error **errp) > +{ > +const char *path = qdict_get_try_str(options, "path"); > +BDRVBlkioState *s = bs->opaque; > +int ret;

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-06 Thread Gregory Price
On Thu, Oct 06, 2022 at 09:50:07AM +0100, Jonathan Cameron wrote: > On Thu, 6 Oct 2022 09:45:57 +0100 > Jonathan Cameron wrote: > > > Great to see this. > > > > Missing Signed-off by so we can't apply this (no developer certificate of > > origin) Probably want your from address to match that

Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory

2022-10-06 Thread Jonathan Cameron via
On Thu, 6 Oct 2022 11:52:06 -0400 Gregory Price wrote: > On Thu, Oct 06, 2022 at 09:50:07AM +0100, Jonathan Cameron wrote: > > On Thu, 6 Oct 2022 09:45:57 +0100 > > Jonathan Cameron wrote: > > > > > Great to see this. > > > > > > Missing Signed-off by so we can't apply this (no developer

[RFC PATCH 0/4] ACPI MADT and FADT update according to the ACPI 6.0 spec

2022-10-06 Thread Miguel Luis
The MADT table structure has been updated in commit 37f33084ed2e ("acpi: arm/virt: madt: use build_append_int_noprefix() API to compose MADT table") to include the 5.2.12.18 GIC ITS Structure and so table's revision also needs to be updated. MADT and the FADT tables from the same spec need to be

Re: [PATCH v3 25/42] target/arm: Move ARMMMUIdx_Stage2 to a real tlb mmu_idx

2022-10-06 Thread Peter Maydell
On Sat, 1 Oct 2022 at 17:39, Richard Henderson wrote: > > We had been marking this ARM_MMU_IDX_NOTLB, move it to a real tlb. > Flush the tlb when invalidating stage 1+2 translations. > > Signed-off-by: Richard Henderson > @@ -2977,15 +2987,6 @@ typedef enum ARMMMUIdx { >

Re: [PATCH v3 28/42] target/arm: Split out get_phys_addr_twostage

2022-10-06 Thread Peter Maydell
On Sat, 1 Oct 2022 at 17:39, Richard Henderson wrote: > > Signed-off-by: Richard Henderson > --- > target/arm/ptw.c | 196 +-- > 1 file changed, 106 insertions(+), 90 deletions(-) Reviewed-by: Peter Maydell thanks -- PMM

[RFC PATCH 2/4] acpi: fadt: support revision 6.0 of the ACPI specification

2022-10-06 Thread Miguel Luis
Update the Fixed ACPI Description Table (FADT) to revision 6.0 of the ACPI specification adding the field "Hypervisor Vendor Identity" that was missing. This field's description states the following: "64-bit identifier of hypervisor vendor. All bytes in this field are considered part of the

[PULL 09/10] dump: simplify a bit kdump get_next_page()

2022-10-06 Thread marcandre . lureau
From: Marc-André Lureau This should be functionally equivalent, but slightly easier to read, with simplified paths and checks at the end of the function. The following patch is a major rewrite to get rid of the assert(). Signed-off-by: Marc-André Lureau Reviewed-by: David Hildenbrand ---

Re: [PATCH v3 29/42] target/arm: Use bool consistently for get_phys_addr subroutines

2022-10-06 Thread Peter Maydell
On Sat, 1 Oct 2022 at 17:41, Richard Henderson wrote: > > The return type of the functions is already bool, but in a few > instances we used an integer type with the return statement. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

[PULL 10/10] dump: fix kdump to work over non-aligned blocks

2022-10-06 Thread marcandre . lureau
From: Marc-André Lureau Rewrite get_next_page() to work over non-aligned blocks. When it encounters non aligned addresses, it will try to fill a page provided by the caller. This solves a kdump crash with "tpm-crb-cmd" RAM memory region, qemu-kvm: ../dump/dump.c:1162: _Bool

[RFC PATCH 1/4] tests/acpi: virt: allow acpi MADT and FADT changes

2022-10-06 Thread Miguel Luis
Step 3 from bios-tables-test.c documented procedure. Signed-off-by: Miguel Luis --- tests/qtest/bios-tables-test-allowed-diff.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index

Re: [PATCH v6] 9pfs: use GHashTable for fid table

2022-10-06 Thread Christian Schoenebeck
On Mittwoch, 5. Oktober 2022 11:38:39 CEST Christian Schoenebeck wrote: > On Dienstag, 4. Oktober 2022 14:54:16 CEST Christian Schoenebeck wrote: > > On Dienstag, 4. Oktober 2022 12:41:21 CEST Linus Heckemann wrote: > > > The previous implementation would iterate over the fid table for > > >

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-06 Thread Sean Christopherson
On Thu, Oct 06, 2022, Jarkko Sakkinen wrote: > On Thu, Oct 06, 2022 at 05:58:03PM +0300, Jarkko Sakkinen wrote: > > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > > This new extension, indicated by the new flag KVM_MEM_PRIVATE, adds two > > > additional KVM memslot fields

Re: [PATCH v3 26/42] target/arm: Plumb debug into S1_ptw_translate

2022-10-06 Thread Peter Maydell
On Sat, 1 Oct 2022 at 17:50, Richard Henderson wrote: > > Before using softmmu page tables for the ptw, plumb down > a debug parameter so that we can query page table entries > from gdbstub without modifying cpu state. > > Signed-off-by: Richard Henderson > --- > +static bool

[PULL 07/10] dump: Split elf header functions into prepare and write

2022-10-06 Thread marcandre . lureau
From: Janosch Frank Let's split the write from the modification of the elf header so we can consolidate the write of the data in one function. Signed-off-by: Janosch Frank Reviewed-by: Janis Schoetterl-Glausch Reviewed-by: Marc-André Lureau Message-Id:

[PULL 06/10] dump: Rework dump_calculate_size function

2022-10-06 Thread marcandre . lureau
From: Janosch Frank dump_calculate_size() sums up all the sizes of the guest memory blocks. Since we already have a function that calculates the size of a single memory block (dump_get_memblock_size()) we can simply iterate over the blocks and use the function instead of calculating the size

[PULL 03/10] dump: Refactor dump_iterate and introduce dump_filter_memblock_*()

2022-10-06 Thread marcandre . lureau
From: Janosch Frank The iteration over the memblocks in dump_iterate() is hard to understand so it's about time to clean it up. Instead of manually grabbing the next memblock we can use QTAILQ_FOREACH to iterate over all memblocks. Additionally we move the calculation of the offset and length

[PULL 08/10] dump: Rename write_elf*_phdr_note to prepare_elf*_phdr_note

2022-10-06 Thread marcandre . lureau
From: Janosch Frank The functions in question do not actually write to the file descriptor they set up a buffer which is later written to the fd. Signed-off-by: Janosch Frank Reviewed-by: Janis Schoetterl-Glausch Reviewed-by: Marc-André Lureau Message-Id:

[PULL 05/10] dump: Rework filter area variables

2022-10-06 Thread marcandre . lureau
From: Janosch Frank While the DumpState begin and length variables directly mirror the API variable names they are not very descriptive. So let's add a "filter_area_" prefix and make has_filter a function checking length > 0. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau

[PULL 01/10] dump: Replace opaque DumpState pointer with a typed one

2022-10-06 Thread marcandre . lureau
From: Janosch Frank It's always better to convey the type of a pointer if at all possible. So let's add the DumpState typedef to typedefs.h and move the dump note functions from the opaque pointers to DumpState pointers. Signed-off-by: Janosch Frank CC: Peter Maydell CC: Cédric Le Goater CC:

[PULL 00/10] Dump patches

2022-10-06 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit f1d33f55c47dfdaf8daacd618588ad3ae4c452d1: Merge tag 'pull-testing-gdbstub-plugins-gitdm-061022-3' of https://github.com/stsquad/qemu into staging (2022-10-06 07:11:56 -0400) are available in the Git repository at:

[PULL 02/10] dump: Rename write_elf_loads to write_elf_phdr_loads

2022-10-06 Thread marcandre . lureau
From: Janosch Frank Let's make it a bit clearer that we write the program headers of the PT_LOAD type. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau Reviewed-by: Janis Schoetterl-Glausch Reviewed-by: Steffen Eiden Message-Id: <2022081112.9878-3-fran...@linux.ibm.com> ---

[PATCH v5 15/18] io/channel-watch: Drop the unnecessary cast

2022-10-06 Thread Bin Meng
From: Bin Meng There is no need to do a type cast on ssource->socket as it is already declared as a SOCKET. Suggested-by: Marc-André Lureau Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - new patch: "io/channel-watch: Drop the unnecessary

[PULL 04/10] dump: Rework get_start_block

2022-10-06 Thread marcandre . lureau
From: Janosch Frank get_start_block() returns the start address of the first memory block or -1. With the GuestPhysBlock iterator conversion we don't need to set the start address and can therefore remove that code and the "start" DumpState struct member. The only functionality left is the

  1   2   3   >