Re: [PATCH v6 4/5] ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd

2025-06-04 Thread Alexey Kardashevskiy
On 4/6/25 21:04, Alexey Kardashevskiy wrote: On 30/5/25 18:32, Chenyi Qiang wrote: Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") highlighted that subsystems like VFIO may disable RAM block discard. However, guest_memfd relies on discard operation

Re: [PATCH v6 2/5] memory: Change memory_region_set_ram_discard_manager() to return the result

2025-06-04 Thread Alexey Kardashevskiy
at present. Suggested-by: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Chenyi Qiang Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy --- Changes in v6: - Add Reviewed-by from David. Changes in v5: - Nit in commit message (return false

Re: [PATCH v6 4/5] ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd

2025-06-04 Thread Alexey Kardashevskiy
yRegion in RamBlockAttributes. (David) - Squash the state_change() helper introduction in this commit as well as the mixture conversion case handling. (David) - Change the block_size type from int to size_t and some cleanup in validation check. (Alexey) - Add a tracepoint to track

Re: [PATCH v6 5/5] physmem: Support coordinated discarding of RAM with guest_memfd

2025-06-04 Thread Alexey Kardashevskiy
r and get notifications when the state_change() helper invokes. As coordinate discarding of RAM with guest_memfd is now supported, only block uncoordinated discard. Signed-off-by: Chenyi Qiang Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy --- Changes in v6: - Squas

Re: [PATCH v5 05/10] ram-block-attribute: Introduce a helper to notify shared/private state changes

2025-05-27 Thread Alexey Kardashevskiy
On 27/5/25 19:06, Chenyi Qiang wrote: On 5/27/2025 3:35 PM, Alexey Kardashevskiy wrote: On 20/5/25 20:28, Chenyi Qiang wrote: A new state_change() helper is introduced for RamBlockAttribute to efficiently notify all registered RamDiscardListeners, including VFIO listeners, about memory

Re: [PATCH v5 10/10] ram-block-attribute: Add more error handling during state changes

2025-05-27 Thread Alexey Kardashevskiy
, nbits); +ret = ram_block_attribute_notify_to_populated(attr, offset, size); +if (ret) { +bitmap_clear(attr->bitmap, first_bit, nbits); +} +} } return ret; -- Alexey

Re: [PATCH v5 09/10] KVM: Introduce RamDiscardListener for attribute changes during memory conversions

2025-05-27 Thread Alexey Kardashevskiy
/target/i386/sev.c index adf787797e..f1b9c35fc3 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -2430,6 +2430,7 @@ sev_snp_guest_instance_init(Object *obj) SevSnpGuestState *sev_snp_guest = SEV_SNP_GUEST(obj); cgs->require_guest_memfd = true; +QLIST_INIT(&cgs->cgs_rdl_list); /* default init/start/finish params for kvm */ sev_snp_guest->kvm_start_conf.policy = DEFAULT_SEV_SNP_POLICY; -- Alexey

Re: [PATCH v5 07/10] RAMBlock: Make guest_memfd require coordinate discard

2025-05-27 Thread Alexey Kardashevskiy
removed. And 06/10 (especially after removing LiveMigration checks) and 07/10 are too small and too related to separate. Thanks, Can we instead add some commit message in previous one? like: "Using guest_memfd with vfio is still blocked via ram_block_discard_disable()/ram_block_discard_require()." -- Alexey

Re: [PATCH v5 05/10] ram-block-attribute: Introduce a helper to notify shared/private state changes

2025-05-27 Thread Alexey Kardashevskiy
+if (to_private) { +bitmap_clear(attr->bitmap, first_bit, nbits); +ram_block_attribute_notify_to_discard(attr, offset, size); +} else { +bitmap_set(attr->bitmap, first_bit, nbits); +ret = ram_block_attribute_notify_to_populated(attr, offset, size); +} and a successful tracepoint here may be? + +return ret; +} + RamBlockAttribute *ram_block_attribute_create(MemoryRegion *mr) { uint64_t bitmap_size; -- Alexey

Re: [PATCH v5 03/10] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-05-26 Thread Alexey Kardashevskiy
VirtIOMEMReplayData, which makes it cleaner. Signed-off-by: Chenyi Qiang Reviewed-by: Alexey Kardashevskiy --- Changes in v5: - Rename ReplayRamStateChange to ReplayRamDiscardState (David) - return data->fn(s, data->opaque) instead of 0 in virtio_mem_rdm_replay_discar

Re: [PATCH v5 02/10] memory: Change memory_region_set_ram_discard_manager() to return the result

2025-05-26 Thread Alexey Kardashevskiy
at present. Suggested-by: David Hildenbrand Signed-off-by: Chenyi Qiang --- Changes in v5: - Nit in commit message (return false -> -EBUSY) - Add set_ram_discard_manager(NULL) when ram_block_discard_range() fails. Reviewed-by: Alexey Kardashevskiy Changes in v4: -

Re: [PATCH v5 04/10] ram-block-attribute: Introduce RamBlockAttribute to manage RAMBlock with guest_memfd

2025-05-26 Thread Alexey Kardashevskiy
On 27/5/25 13:14, Chenyi Qiang wrote: On 5/27/2025 9:20 AM, Alexey Kardashevskiy wrote: On 27/5/25 11:15, Chenyi Qiang wrote: On 5/26/2025 7:16 PM, Alexey Kardashevskiy wrote: On 26/5/25 19:28, Chenyi Qiang wrote: On 5/26/2025 5:01 PM, David Hildenbrand wrote: On 20.05.25 12:28

Re: [PATCH v5 04/10] ram-block-attribute: Introduce RamBlockAttribute to manage RAMBlock with guest_memfd

2025-05-26 Thread Alexey Kardashevskiy
On 27/5/25 11:15, Chenyi Qiang wrote: On 5/26/2025 7:16 PM, Alexey Kardashevskiy wrote: On 26/5/25 19:28, Chenyi Qiang wrote: On 5/26/2025 5:01 PM, David Hildenbrand wrote: On 20.05.25 12:28, Chenyi Qiang wrote: Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordi

Re: [PATCH v5 04/10] ram-block-attribute: Introduce RamBlockAttribute to manage RAMBlock with guest_memfd

2025-05-26 Thread Alexey Kardashevskiy
n in later patch. - Move the introduction of RamBlockAttribute field to this patch and    rename it to ram_shared. (Alexey) - call the exit() when register/unregister failed. (Zhao) - Add the ram-block-attribute.c to Memory API related part in    MAINTAINERS. Cha

Re: [PATCH v3] ppc/vof: Make nextprop behave more like Open Firmware

2025-05-15 Thread Alexey Kardashevskiy
On Tue, 13 May 2025, at 22:00, BALATON Zoltan wrote: > On Tue, 13 May 2025, Alexey Kardashevskiy wrote: > > On Wed, 30 Apr 2025, at 21:21, BALATON Zoltan wrote: > >> On Wed, 23 Apr 2025, BALATON Zoltan wrote: > >>> The FDT does not normally store name properties

Re: [PATCH v3] ppc/vof: Make nextprop behave more like Open Firmware

2025-05-13 Thread Alexey Kardashevskiy
On Wed, 30 Apr 2025, at 21:21, BALATON Zoltan wrote: > On Wed, 23 Apr 2025, BALATON Zoltan wrote: > > The FDT does not normally store name properties but reconstructs it > > from path but Open Firmware specification says each node should at > > least have this property. This is correctly handled

[PATCH QEMU] x86/headers: Replace __ASSEMBLY__ with __ASSEMBLER__ in UAPI headers

2025-04-28 Thread Alexey Kardashevskiy
The recent kernel update 8a141be3233af7d broke the headers update, fix it in the script. Cc: Thomas Huth Signed-off-by: Alexey Kardashevskiy --- Or we want both __ASSEMBLY__ and __ASSEMBLER__? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7d

Re: [PATCH v4 04/13] memory: Introduce generic state change parent class for RamDiscardManager

2025-04-17 Thread Alexey Kardashevskiy
On 16/4/25 13:32, Chenyi Qiang wrote: On 4/10/2025 9:44 AM, Chenyi Qiang wrote: On 4/10/2025 8:11 AM, Alexey Kardashevskiy wrote: On 9/4/25 22:57, Chenyi Qiang wrote: On 4/9/2025 5:56 PM, Alexey Kardashevskiy wrote: On 7/4/25 17:49, Chenyi Qiang wrote: RamDiscardManager is an

Re: [PATCH v2] ppc/vof: Make nextprop behave more like Open Firmware

2025-04-10 Thread Alexey Kardashevskiy
On Sat, 5 Apr 2025, at 11:09, BALATON Zoltan wrote: > On Fri, 4 Apr 2025, Alexey Kardashevskiy wrote: > > On Tue, 1 Apr 2025, at 01:26, BALATON Zoltan wrote: > >> The FDT does not normally store name properties but reconstructs it > >> from path but each node in Op

Re: [PATCH v4 02/13] memory: Change memory_region_set_ram_discard_manager() to return the result

2025-04-10 Thread Alexey Kardashevskiy
s no way to trigger -EBUSY? Thanks, } uint64_t ram_discard_manager_get_min_granularity(const RamDiscardManager *rdm, -- Alexey

Re: [PATCH v4 04/13] memory: Introduce generic state change parent class for RamDiscardManager

2025-04-09 Thread Alexey Kardashevskiy
On 9/4/25 22:57, Chenyi Qiang wrote: On 4/9/2025 5:56 PM, Alexey Kardashevskiy wrote: On 7/4/25 17:49, Chenyi Qiang wrote: RamDiscardManager is an interface used by virtio-mem to adjust VFIO mappings in relation to VM page assignment. It manages the state of populated and discard for

Re: [PATCH v4 07/13] ram-block-attribute: Introduce RamBlockAttribute to manage RAMBLock with guest_memfd

2025-04-09 Thread Alexey Kardashevskiy
AM_BLOCK_ATTRIBUTE(obj); + +QLIST_INIT(&attr->psl_list); +} + +static void ram_block_attribute_finalize(Object *obj) +{ +} + +static void ram_block_attribute_class_init(ObjectClass *oc, void *data) +{ +GenericStateManagerClass *gsmc = GENERIC_STATE_MANAGER_CLASS(oc); + +gsmc->get_min_granularity = ram_block_attribute_psm_get_min_granularity; +gsmc->register_listener = ram_block_attribute_psm_register_listener; +gsmc->unregister_listener = ram_block_attribute_psm_unregister_listener; +gsmc->is_state_set = ram_block_attribute_psm_is_shared; +gsmc->replay_on_state_set = ram_block_attribute_psm_replay_on_shared; +gsmc->replay_on_state_clear = ram_block_attribute_psm_replay_on_private; +} -- Alexey

Re: [PATCH v4 06/13] vfio: Add the support for PrivateSharedManager Interface

2025-04-09 Thread Alexey Kardashevskiy
tener; +QLIST_ENTRY(VFIOPrivateSharedListener) next; +} VFIOPrivateSharedListener; + int vfio_container_dma_map(VFIOContainerBase *bcontainer, hwaddr iova, ram_addr_t size, void *vaddr, bool readonly); -- Alexey

Re: [PATCH v4 05/13] memory: Introduce PrivateSharedManager Interface as child of GenericStateManager

2025-04-09 Thread Alexey Kardashevskiy
type_register_static(&iommu_memory_region_info); type_register_static(&generic_state_manager_info); type_register_static(&ram_discard_manager_info); +type_register_static(&private_shared_manager_info); } type_init(memory_register_types) -- Alexey

Re: [PATCH v4 04/13] memory: Introduce generic state change parent class for RamDiscardManager

2025-04-09 Thread Alexey Kardashevskiy
On 7/4/25 17:49, Chenyi Qiang wrote: RamDiscardManager is an interface used by virtio-mem to adjust VFIO mappings in relation to VM page assignment. It manages the state of populated and discard for the RAM. To accommodate future scnarios for managing RAM states, such as private and shared sta

Re: [PATCH v4 01/13] memory: Export a helper to get intersection of a MemoryRegionSection with a given range

2025-04-09 Thread Alexey Kardashevskiy
On 9/4/25 16:26, Chenyi Qiang wrote: On 4/9/2025 10:47 AM, Alexey Kardashevskiy wrote: On 7/4/25 17:49, Chenyi Qiang wrote: Rename the helper to memory_region_section_intersect_range() to make it more generic. Meanwhile, define the @end as Int128 and replace the related operations with

Re: [PATCH v4 03/13] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-04-08 Thread Alexey Kardashevskiy
void *opaque) { RamDiscardManagerClass *rdmc = RAM_DISCARD_MANAGER_GET_CLASS(rdm); g_assert(rdmc->replay_discarded); -rdmc->replay_discarded(rdm, section, replay_fn, opaque); +return rdmc->replay_discarded(rdm, section, replay_fn, opaque); } void ram_discard_manager_register_listener(RamDiscardManager *rdm, -- Alexey

Re: [PATCH v4 01/13] memory: Export a helper to get intersection of a MemoryRegionSection with a given range

2025-04-08 Thread Alexey Kardashevskiy
On 7/4/25 17:49, Chenyi Qiang wrote: Rename the helper to memory_region_section_intersect_range() to make it more generic. Meanwhile, define the @end as Int128 and replace the related operations with Int128_* format since the helper is exported as a wider API. Suggested-by: Alexey

Re: vof-nvram.bin: what it is and how it is used?

2025-04-05 Thread Alexey Kardashevskiy
On Thu, 20 Mar 2025, at 00:14, BALATON Zoltan wrote: > On Wed, 19 Mar 2025, Michael Tokarev wrote: > > Hi! > > > > Commit fc8c745d50150a63f6c "spapr: Implement Open Firmware client interface" > > in Jun-2021 added a new file, pc-bios/vof-nvram.bin, to qemu sources. > > > > But there's nothing in

Re: [PATCH v2] ppc/vof: Make nextprop behave more like Open Firmware

2025-04-03 Thread Alexey Kardashevskiy
On Tue, 1 Apr 2025, at 01:26, BALATON Zoltan wrote: > The FDT does not normally store name properties but reconstructs it > from path but each node in Open Firmware should at least have this > property. This is correctly handled in getprop but nextprop should > also return it even if not present

Re: [PATCH v2 3/6] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-02-19 Thread Alexey Kardashevskiy
On 19/2/25 17:33, Chenyi Qiang wrote: On 2/19/2025 11:49 AM, Alexey Kardashevskiy wrote: On 19/2/25 12:20, Chenyi Qiang wrote: On 2/18/2025 5:19 PM, Alexey Kardashevskiy wrote: [..] diff --git a/include/system/memory-attribute-manager.h b/include/ system/memory-attribute

Re: [PATCH v2 3/6] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-02-18 Thread Alexey Kardashevskiy
On 19/2/25 12:20, Chenyi Qiang wrote: On 2/18/2025 5:19 PM, Alexey Kardashevskiy wrote: [..] diff --git a/include/system/memory-attribute-manager.h b/include/ system/memory-attribute-manager.h new file mode 100644 index 00..72adc0028e --- /dev/null +++ b/include/system/memory

Re: [PATCH v2 2/6] memory: Change memory_region_set_ram_discard_manager() to return the result

2025-02-18 Thread Alexey Kardashevskiy
NULL". +return -1; -EBUSY? +} + +/* !rdm || !mr->rdm */ See, like here - no "!= NULL" :) (and the comment is useless). Thanks, mr->rdm = rdm; +return 0; } uint64_t ram_discard_manager_get_min_granularity(const RamDiscardManager *rdm, -- Alexey

Re: [PATCH v2 4/6] memory-attribute-manager: Introduce a callback to notify the shared/private state change

2025-02-18 Thread Alexey Kardashevskiy
nge = memory_attribute_state_change; + rdmc->get_min_granularity = memory_attribute_rdm_get_min_granularity; rdmc->register_listener = memory_attribute_rdm_register_listener; rdmc->unregister_listener = memory_attribute_rdm_unregister_listener; -- Alexey

Re: [PATCH v2 5/6] memory: Attach MemoryAttributeManager to guest_memfd-backed RAMBlocks

2025-02-18 Thread Alexey Kardashevskiy
otify the registered RamDiscardListener. Signed-off-by: Chenyi Qiang Reviewed-by: Alexey Kardashevskiy --- Changes in v2: - Introduce a new field memory_attribute_manager in RAMBlock. - Move the state_change() handling during page conversion in this patch. - Undo what we did

Re: [PATCH v2 3/6] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-02-18 Thread Alexey Kardashevskiy
listener; +rdmc->is_populated = memory_attribute_rdm_is_populated; +rdmc->replay_populated = memory_attribute_rdm_replay_populated; +rdmc->replay_discarded = memory_attribute_rdm_replay_discarded; +} diff --git a/system/meson.build b/system/meson.build index 4952f4b2c7..ab07ff1442 100644 --- a/system/meson.build +++ b/system/meson.build @@ -15,6 +15,7 @@ system_ss.add(files( 'dirtylimit.c', 'dma-helpers.c', 'globals.c', + 'memory-attribute-manager.c', 'memory_mapping.c', 'qdev-monitor.c', 'qtest.c', -- Alexey

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-23 Thread Alexey Kardashevskiy
On 24/1/25 14:09, Chenyi Qiang wrote: On 1/24/2025 8:15 AM, Alexey Kardashevskiy wrote: On 22/1/25 16:38, Xiaoyao Li wrote: On 1/22/2025 11:28 AM, Chenyi Qiang wrote: On 1/22/2025 12:35 AM, Peter Xu wrote: On Tue, Jan 21, 2025 at 09:35:26AM +0800, Chenyi Qiang wrote: On 1/21/2025

Re: [PATCH 5/7] memory: Register the RamDiscardManager instance upon guest_memfd creation

2025-01-23 Thread Alexey Kardashevskiy
On 21/1/25 00:06, David Hildenbrand wrote: On 10.01.25 06:13, Chenyi Qiang wrote: On 1/9/2025 5:32 PM, Alexey Kardashevskiy wrote: On 9/1/25 16:34, Chenyi Qiang wrote: On 1/8/2025 12:47 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: Introduce the realize

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-23 Thread Alexey Kardashevskiy
sallowing such conversion in QEMU? On AMD, a malicious HV can try converting at any time and if the guest did not ask for it, it will continue accessing those pages as private and trigger an RMP fault. But if the guest asked for conversion, then it should be no problem to convert to shared. What do I miss about TDX here? Thanks, Thanks, -- Alexey

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-21 Thread Alexey Kardashevskiy
On 22/1/25 02:18, Peter Xu wrote: On Tue, Jun 25, 2024 at 12:31:13AM +0800, Xu Yilun wrote: On Mon, Jan 20, 2025 at 03:46:15PM -0500, Peter Xu wrote: On Mon, Jan 20, 2025 at 09:22:50PM +1100, Alexey Kardashevskiy wrote: It is still uncertain how to implement the private MMIO. Our

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-14 Thread Alexey Kardashevskiy
On 13/1/25 21:54, David Hildenbrand wrote: On 08.01.25 11:56, Chenyi Qiang wrote: On 1/8/2025 12:48 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: As the commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") highlighted, some subsy

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-14 Thread Alexey Kardashevskiy
On 10/1/25 17:38, Chenyi Qiang wrote: On 1/10/2025 8:58 AM, Alexey Kardashevskiy wrote: On 9/1/25 15:29, Chenyi Qiang wrote: On 1/9/2025 10:55 AM, Alexey Kardashevskiy wrote: On 9/1/25 13:11, Chenyi Qiang wrote: On 1/8/2025 7:20 PM, Alexey Kardashevskiy wrote: On 8/1/25 21:56

Re: [PATCH 0/7] Enable shared device assignment

2025-01-14 Thread Alexey Kardashevskiy
eak it down to 4k for the iommu driver. Mapping 4k at a time through the uAPI would be outrageously inefficient. Jason -- Alexey

Re: [PATCH v2] target/riscv: Support Supm and Sspm as part of Zjpm v1.0

2025-01-13 Thread Alexey Baturo
>I removed the lines above, as we don't want to include the changelog or rebase notes in the commit message Sure, sorry for that Thank you Alistair and Daniel! вт, 14 янв. 2025 г. в 04:43, Alistair Francis : > On Tue, Jan 14, 2025 at 5:45 AM wrote: > > > > From: Alexey

[PATCH v2] target/riscv: Support Supm and Sspm as part of Zjpm v1.0

2025-01-13 Thread baturo . alexey
From: Alexey Baturo Rebased against alistair/riscv-to-apply.next [v1]: The Zjpm v1.0 spec states there should be Supm and Sspm extensions that are used in profile specification. Enabling Supm extension enables both Ssnpm and Smnpm, while Sspm enables only Smnpm. Signed-off-by: Alexey Baturo

[PATCH] target/riscv: Support Supm and Sspm as part of Zjpm v1.0

2025-01-11 Thread baturo . alexey
From: Alexey Baturo The Zjpm v1.0 spec states there should be Supm and Sspm extensions that are used in profile specification. Enabling Supm extension enables both Ssnpm and Smnpm, while Sspm enables only Smnpm. Signed-off-by: Alexey Baturo --- target/riscv/cpu.c | 23

Re: [PATCH 0/7] Enable shared device assignment

2025-01-09 Thread Alexey Kardashevskiy
On 9/1/25 19:49, Chenyi Qiang wrote: On 1/9/2025 4:18 PM, Alexey Kardashevskiy wrote: On 9/1/25 18:52, Chenyi Qiang wrote: On 1/8/2025 7:38 PM, Alexey Kardashevskiy wrote: On 8/1/25 17:28, Chenyi Qiang wrote: Thanks Alexey for your review! On 1/8/2025 12:47 PM, Alexey

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-09 Thread Alexey Kardashevskiy
On 9/1/25 15:29, Chenyi Qiang wrote: On 1/9/2025 10:55 AM, Alexey Kardashevskiy wrote: On 9/1/25 13:11, Chenyi Qiang wrote: On 1/8/2025 7:20 PM, Alexey Kardashevskiy wrote: On 8/1/25 21:56, Chenyi Qiang wrote: On 1/8/2025 12:48 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08

Re: [PATCH 5/7] memory: Register the RamDiscardManager instance upon guest_memfd creation

2025-01-09 Thread Alexey Kardashevskiy
On 9/1/25 16:34, Chenyi Qiang wrote: On 1/8/2025 12:47 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: Introduce the realize()/unrealize() callbacks to initialize/uninitialize the new guest_memfd_manager object and register/unregister it in the target MemoryRegion

Re: [PATCH 0/7] Enable shared device assignment

2025-01-09 Thread Alexey Kardashevskiy
On 9/1/25 18:52, Chenyi Qiang wrote: On 1/8/2025 7:38 PM, Alexey Kardashevskiy wrote: On 8/1/25 17:28, Chenyi Qiang wrote: Thanks Alexey for your review! On 1/8/2025 12:47 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: Commit 852f0048f3 ("RAMBlock:

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-08 Thread Alexey Kardashevskiy
On 9/1/25 13:11, Chenyi Qiang wrote: On 1/8/2025 7:20 PM, Alexey Kardashevskiy wrote: On 8/1/25 21:56, Chenyi Qiang wrote: On 1/8/2025 12:48 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: As the commit 852f0048f3 ("RAMBlock: make guest_memfd re

Re: [PATCH 0/7] Enable shared device assignment

2025-01-08 Thread Alexey Kardashevskiy
On 8/1/25 17:28, Chenyi Qiang wrote: Thanks Alexey for your review! On 1/8/2025 12:47 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") effectively disables device assignment

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-08 Thread Alexey Kardashevskiy
On 8/1/25 21:56, Chenyi Qiang wrote: On 1/8/2025 12:48 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: As the commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") highlighted, some subsystems like VFIO might disable ram blo

Re: [PATCH 0/7] Enable shared device assignment

2025-01-07 Thread Alexey Kardashevskiy
644 include/sysemu/guest-memfd-manager.h create mode 100644 system/guest-memfd-manager.c -- Alexey

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-07 Thread Alexey Kardashevskiy
ed = guest_memfd_rdm_replay_populated; +rdmc->replay_discarded = guest_memfd_rdm_replay_discarded; +} diff --git a/system/meson.build b/system/meson.build index 4952f4b2c7..ed4e1137bd 100644 --- a/system/meson.build +++ b/system/meson.build @@ -15,6 +15,7 @@ system_ss.add(files( 'dirtylimit.c', 'dma-helpers.c', 'globals.c', + 'guest-memfd-manager.c', 'memory_mapping.c', 'qdev-monitor.c', 'qtest.c', -- Alexey

Re: [PATCH 1/7] memory: Export a helper to get intersection of a MemoryRegionSection with a given range

2025-01-07 Thread Alexey Kardashevskiy
fset_within_region = start; +s->size = int128_make64(end - start); +return true; +} + bool memory_region_present(MemoryRegion *container, hwaddr addr) { MemoryRegion *mr; -- Alexey

Re: [PATCH 5/7] memory: Register the RamDiscardManager instance upon guest_memfd creation

2025-01-07 Thread Alexey Kardashevskiy
lize(gmm); +object_unref(OBJECT(gmm)); Likely don't matter but I'd do the cleanup before close() or do block->guest_memfd=-1 before the cleanup. Thanks, ram_block_discard_require(false); } -- Alexey

[PATCH v15 4/7] target/riscv: Add pointer masking tb flags

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei --- target/riscv/cpu.h| 3 +++ target/riscv/cpu_helper.c | 3 +++ target/riscv/translate.c | 5 + 3 files changed, 11 insertions(+) diff --git

Re: [PATCH v14 0/7] Pointer Masking update for Zjpm v1.0

2025-01-06 Thread Alexey Baturo
Hi Alistair, I rebased these patches against riscv-to-apply.next and resubmitted them. Thanks пн, 6 янв. 2025 г. в 06:36, Alistair Francis : > On Tue, Dec 17, 2024 at 6:57 PM wrote: > > > > From: Alexey Baturo > > > > Hi, > > > > Rebased and addr

[PATCH v15 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 1 + target/riscv/cpu_helper.c| 19 + target/riscv/internals.h | 54 target/riscv

[PATCH v15 7/7] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 99588e219e..d9eb2c04c3 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c

[PATCH v15 0/7] Pointer Masking update for Zjpm v1.0

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Hi, Rebased against Alistair's riscv-to-apply.next Thanks [v14]: Rebased and addressed Alistair's comments on code style. [v13]: Rebased and addressed Daniel's comments about the return type of the helper. Thanks [v12]: Rebased and addressed Richard&#

[PATCH v15 1/7] target/riscv: Remove obsolete pointer masking extension code.

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Zjpm extension is finally ratified. And it's much simplier compared to the experimental one. The newer version doesn't allow to specify custom mask or base for pointer masking. Instead it allows only certain options for masking top bits. Signed-off-by: Alexey Bat

[PATCH v15 5/7] target/riscv: Update address modify functions to take into account pointer masking

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translate.c | 22 -- target/riscv/vector_helper.c | 16 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v15 2/7] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v1.0

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 8 target/riscv/cpu_bits.h | 4 target/riscv/cpu_cfg.h | 3 +++ target/riscv/csr.c | 33

[PATCH v15 3/7] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2025-01-06 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.h| 5 +++ target/riscv/cpu_helper.c | 78 +++ 2 files changed, 83 insertions(+) diff --git a/target/riscv

Re: [PATCH v13 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2024-12-17 Thread Alexey Baturo
ir Francis : > On Mon, Dec 16, 2024 at 10:19 PM wrote: > > > > From: Alexey Baturo > > > > Signed-off-by: Alexey Baturo > > --- > > target/riscv/cpu.h | 1 + > > target/riscv/cpu_helper.c| 18 +++ > > target/riscv/internal

[PATCH v14 5/7] target/riscv: Update address modify functions to take into account pointer masking

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translate.c | 22 -- target/riscv/vector_helper.c | 16 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v14 3/7] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.h| 5 +++ target/riscv/cpu_helper.c | 78 +++ 2 files changed, 83 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index

[PATCH v14 2/7] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v1.0

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 8 target/riscv/cpu_bits.h | 4 target/riscv/cpu_cfg.h | 3 +++ target/riscv/csr.c | 31

[PATCH v14 4/7] target/riscv: Add pointer masking tb flags

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei --- target/riscv/cpu.h| 3 +++ target/riscv/cpu_helper.c | 3 +++ target/riscv/translate.c | 5 + 3 files changed, 11 insertions(+) diff --git

[PATCH v14 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 1 + target/riscv/cpu_helper.c| 19 + target/riscv/internals.h | 54 target/riscv

[PATCH v14 1/7] target/riscv: Remove obsolete pointer masking extension code.

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Zjpm extension is finally ratified. And it's much simplier compared to the experimental one. The newer version doesn't allow to specify custom mask or base for pointer masking. Instead it allows only certain options for masking top bits. Signed-off-by: Alexey Bat

[PATCH v14 0/7] Pointer Masking update for Zjpm v1.0

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Hi, Rebased and addressed Alistair's comments on code style. Thanks [v13]: Rebased and addressed Daniel's comments about the return type of the helper. Thanks [v12]: Rebased and addressed Richard's comments about proper masking virtualized accesses. Th

[PATCH v14 7/7] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2024-12-17 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 0a00be66f1..144ce822d5 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c

[PATCH v13 3/7] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h| 5 +++ target/riscv/cpu_helper.c | 73 +++ 2 files changed, 78 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 417ff45544..e7f346ff6b 100644 --- a

[PATCH v13 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h | 1 + target/riscv/cpu_helper.c| 18 +++ target/riscv/internals.h | 44 target/riscv/op_helper.c | 16 ++--- target/riscv/vector_helper.c

[PATCH v13 0/7] Pointer Masking update for Zjpm v1.0

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Hi, Rebased and addressed Daniel's comments about the return type of the helper. Thanks [v12]: Rebased and addressed Richard's comments about proper masking virtualized accesses. Thanks [v11]: As suggested on the mailing list by Daniel, I'm resubmitting

[PATCH v13 2/7] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v1.0

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 8 target/riscv/cpu_bits.h | 4 target/riscv/cpu_cfg.h | 3 +++ target/riscv/csr.c | 31 ++- target/riscv/pmp.c | 14

[PATCH v13 4/7] target/riscv: Add pointer masking tb flags

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei --- target/riscv/cpu.h| 3 +++ target/riscv/cpu_helper.c | 3 +++ target/riscv/translate.c | 5 + 3 files changed, 11 insertions(+) diff --git

[PATCH v13 5/7] target/riscv: Update address modify functions to take into account pointer masking

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translate.c | 22 -- target/riscv/vector_helper.c | 16 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v13 7/7] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8dea26e214..05184b9a6e 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c

[PATCH v13 1/7] target/riscv: Remove obsolete pointer masking extension code.

2024-12-16 Thread baturo . alexey
From: Alexey Baturo Zjpm extension is finally ratified. And it's much simplier compared to the experimental one. The newer version doesn't allow to specify custom mask or base for pointer masking. Instead it allows only certain options for masking top bits. Signed-off-by: Ale

Re: [PATCH v12 7/7] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2024-12-16 Thread Alexey Baturo
ro.com>: > > > On 12/5/24 8:23 AM, baturo.ale...@gmail.com wrote: > > From: Alexey Baturo > > > > Signed-off-by: Alexey Baturo > > > > Reviewed-by: Alistair Francis > > --- > > target/riscv/cpu.c | 6 ++ > > 1 file changed, 6 inse

Re: [PATCH v12 3/7] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2024-12-06 Thread Alexey Baturo
Thanks Daniel. Let's wait for about a week or so for other suggestions to the patches and then I'll send a new updated series. сб, 7 дек. 2024 г. в 00:08, Daniel Henrique Barboza < dbarb...@ventanamicro.com>: > > > On 12/5/24 8:23 AM, baturo.ale...@gmail.com wrote

[PATCH v12 7/7] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 4e80dcd2e6..fd3ea9ce76 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c

[PATCH v12 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h | 1 + target/riscv/cpu_helper.c| 18 +++ target/riscv/internals.h | 44 target/riscv/op_helper.c | 16 ++--- target/riscv/vector_helper.c

[PATCH v12 3/7] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h| 5 +++ target/riscv/cpu_helper.c | 74 +++ 2 files changed, 79 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 417ff45544..74d7076f5a 100644 --- a

[PATCH v12 4/7] target/riscv: Add pointer masking tb flags

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei --- target/riscv/cpu.h| 3 +++ target/riscv/cpu_helper.c | 3 +++ target/riscv/translate.c | 5 + 3 files changed, 11 insertions(+) diff --git

[PATCH v12 5/7] target/riscv: Update address modify functions to take into account pointer masking

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translate.c | 22 -- target/riscv/vector_helper.c | 16 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v12 2/7] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v1.0

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h | 8 target/riscv/cpu_bits.h | 4 target/riscv/cpu_cfg.h | 3 +++ target/riscv/csr.c | 31 ++- target/riscv/pmp.c | 14 +++--- target/riscv/pmp.h

[PATCH v12 0/7] Pointer Masking update for Zjpm v1.0

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Hi, Rebased and addressed Richard's comments about proper masking virtualized accesses. Thanks [v11]: As suggested on the mailing list by Daniel, I'm resubmitting this series and keeping the original versioning number. So that makes this one v11 and previous -

[PATCH v12 1/7] target/riscv: Remove obsolete pointer masking extension code.

2024-12-05 Thread baturo . alexey
From: Alexey Baturo Zjpm extension is finally ratified. And it's much simplier compared to the experimental one. The newer version doesn't allow to specify custom mask or base for pointer masking. Instead it allows only certain options for masking top bits. Signed-off-by: Ale

Re: [PATCH v11 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2024-11-28 Thread Alexey Baturo
Hi Richard, Thanks for the suggestions. I'll wait for a week or for extra comments on this series and would send a new fixed one. Thanks again! ср, 27 нояб. 2024 г. в 19:08, Richard Henderson < richard.hender...@linaro.org>: > On 11/26/24 23:35, baturo.ale...@gmail.com wrote: &g

Re: [PATCH v2 1/7] target/riscv: Remove obsolete pointer masking extension code.

2024-11-26 Thread Alexey Baturo
07:01, Alistair Francis : > On Thu, Nov 21, 2024 at 4:13 PM wrote: > > > > From: Alexey Baturo > > > > Zjpm extension is finally ratified. And it's much simplier compared to > the experimental one. > > The newer version doesn't allow to specify custom

Re: [PATCH v2 0/7] Pointer Masking update for Zjpm v1.0

2024-11-26 Thread Alexey Baturo
Hi Daniel, Thanks for the suggestion. I've resubmitted it with the v11 tag and put some reviewed-bys. Thanks пн, 25 нояб. 2024 г. в 16:37, Daniel Henrique Barboza < dbarb...@ventanamicro.com>: > Hi Alexey, > > > I believe this is not the second version of this work. W

[PATCH v11 5/7] target/riscv: Update address modify functions to take into account pointer masking

2024-11-26 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translate.c | 22 -- target/riscv/vector_helper.c | 16 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a

[PATCH v11 3/7] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2024-11-26 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h| 5 +++ target/riscv/cpu_helper.c | 74 +++ 2 files changed, 79 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 417ff45544..74d7076f5a 100644 --- a

[PATCH v11 1/7] target/riscv: Remove obsolete pointer masking extension code.

2024-11-26 Thread baturo . alexey
From: Alexey Baturo Zjpm extension is finally ratified. And it's much simplier compared to the experimental one. The newer version doesn't allow to specify custom mask or base for pointer masking. Instead it allows only certain options for masking top bits. Signed-off-by: Ale

[PATCH v11 7/7] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2024-11-26 Thread baturo . alexey
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 4e80dcd2e6..fd3ea9ce76 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c

  1   2   3   4   5   6   7   8   9   10   >