On 7/15/2025 11:31 AM, Xiaoyao Li wrote:
> From: Yan Zhao
>
> (This is just the POC code to use in-place conversion gmem.)
>
> Try to use in-place conversion gmem when it is supported.
>
> When in-place conversion is enabled, there is no need to discard memory
> since it still needs to be us
On 6/19/2025 10:29 PM, Peter Xu wrote:
> On Thu, Jun 19, 2025 at 11:06:46AM +0800, Chenyi Qiang wrote:
>> To fix the build error with --enable-docs configuration, Add the below fixup
>
> Thanks, this works for me.
>
> Though I just noticed it has more than the d
On 6/12/2025 4:27 PM, 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 operations for page
> conversion betw
On 6/19/2025 6:22 AM, Peter Xu wrote:
> On Thu, Jun 12, 2025 at 04:27:41PM +0800, Chenyi Qiang wrote:
>> This is the v7 series of the shared device assignment support.
>
> Building doc fails, see:
>
> https://gitlab.com/peterx/qemu/-/jobs/10396029551
>
> You
On 6/12/2025 4:27 PM, Chenyi Qiang wrote:
> Update ReplayRamDiscard() function to return the result and unify the
> ReplayRamPopulate() and ReplayRamDiscard() to ReplayRamDiscardState() at
> the same time due to their identical definitions. This unification
> simplifies related stru
.
Reviewed-by: David Hildenbrand
Reviewed-by: Pankaj Gupta
Reviewed-by: Xiaoyao Li
Signed-off-by: Chenyi Qiang
---
Changes in v7:
- Add Reviewed-by from Xiaoyao and Pankaj.
Changes in v6:
- Add Reviewed-by from David
- Add a documentation comment for the prototype change
Changes in v5
hange() helper
invokes.
As coordinate discarding of RAM with guest_memfd is now supported, only
block uncoordinated discard.
Tested-by: Alexey Kardashevskiy
Reviewed-by: Alexey Kardashevskiy
Acked-by: David Hildenbrand
Signed-off-by: Chenyi Qiang
---
Changes in v7:
- Add some document abou
by: Alexey Kardashevskiy
Reviewed-by: Alexey Kardashevskiy
Reviewed-by: Pankaj Gupta
Signed-off-by: Chenyi Qiang
---
Changes in v7:
- Unwrap the two helpers(is_range_populated() and is
is_range_discarded()). (Alexey)
- Use bit to do the iteration instead of offset without additional
va
Reviewed-by: Pankaj Gupta
Reviewed-by: David Hildenbrand
Reviewed-by: Zhao Liu
Reviewed-by: Xiaoyao Li
Signed-off-by: Chenyi Qiang
---
Changes in v7:
- Add Reivewed-by from Xiaoyao and Pankaj
Changes in v6:
- No change.
Changes in v5:
- Indent change for int128 ops to avoid the line
Hildenbrand
Reviewed-by: David Hildenbrand
Reviewed-by: Pankaj Gupta
Tested-by: Alexey Kardashevskiy
Reviewed-by: Alexey Kardashevskiy
Reviewed-by: Xiaoyao Li
Signed-off-by: Chenyi Qiang
---
Changes in v7:
- Add Reviewed-by from Pankaj, Alexey and Xiaoyao
Changes in v6:
- Add Reviewed-by from
inux-iommu/0-v2-5c26bde5c22d+58b-iommu_pt_...@nvidia.com/
[4]
https://lore.kernel.org/qemu-devel/d1a71e00-243b-4751-ab73-c05a4e090...@redhat.com/
[5]
https://lore.kernel.org/qemu-devel/013b36a9-9310-4073-b54c-9c511f23d...@linux.intel.com/
Chenyi Qiang (5):
memory: Export a helper to get interse
/2025 4:32 PM, Chenyi Qiang wrote:
> This is the v6 series of the shared device assignment support.
>
> Compared with the last version [1], this series retains the basic support
> and removes the additional complex error handling, which can be added
> back when necessary. Meanwhile, t
On 6/4/2025 7:04 PM, 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. H
On 6/5/2025 8:35 AM, Alexey Kardashevskiy wrote:
>
>
> 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") high
orresponding shared <-> private
> conversions in addition to VFIO discard <-> populate conversions.
> Since per RAMBlock bitmap set is disjoint for both the above cases,
> so can be reused for live migration use-case as well when deciding which
> page is private vs shared.
&g
On 6/3/2025 1:26 PM, Gupta, Pankaj wrote:
> On 6/3/2025 3:26 AM, Chenyi Qiang wrote:
>>
>>
>> On 6/1/2025 5:58 PM, Gupta, Pankaj wrote:
>>> On 5/30/2025 10:32 AM, Chenyi Qiang wrote:
>>>> Commit 852f0048f3 ("RAMBlock: make guest_memfd requir
On 6/3/2025 5:10 AM, David Hildenbrand wrote:
> On 30.05.25 10: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_mem
On 6/1/2025 5:58 PM, Gupta, Pankaj wrote:
> On 5/30/2025 10:32 AM, Chenyi Qiang wrote:
>> Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated
>> discard") highlighted that subsystems like VFIO may disable RAM block
>> discard. However, guest_mem
Hildenbrand
Reviewed-by: David Hildenbrand
Signed-off-by: Chenyi Qiang
---
Changes in v6:
- Add Reviewed-by from David.
Changes in v5:
- Nit in commit message (return false -> -EBUSY)
- Add set_ram_discard_manager(NULL) when ram_block_discard_range()
fails.
Changes in v3:
- M
ing out of the
picture as it is not required.
Signed-off-by: Chenyi Qiang
---
Changes in v6:
- Change the object type name from RamBlockAttribute to
RamBlockAttributes. (David)
- Save the associated RAMBlock instead MemoryRegion in
RamBlockAttributes. (David)
- Squash the st
.
Reviewed-by: David Hildenbrand
Signed-off-by: Chenyi Qiang
---
Changes in v6:
- Add Reviewed-by from David
- Add a documentation comment for the prototype change
Changes in v5:
- Rename ReplayRamStateChange to ReplayRamDiscardState (David)
- return data->fn(s, data->opaque) i
hange() helper
invokes.
As coordinate discarding of RAM with guest_memfd is now supported, only
block uncoordinated discard.
Signed-off-by: Chenyi Qiang
---
Changes in v6:
- Squash the unblocking of cooridnate discard into this commit.
- Remove the checks in migration path.
Changes
Reviewed-by: David Hildenbrand
Reviewed-by: Zhao Liu
Signed-off-by: Chenyi Qiang
---
Changes in v6:
- No change.
Changes in v5:
- Indent change for int128 ops to avoid the line over 80
- Add two Review-by from Alexey and Zhao
Changes in v4:
- No change.
---
hw/virtio/virtio-mem.c
l.org/qemu-devel/d1a71e00-243b-4751-ab73-c05a4e090...@redhat.com/
[5]
https://lore.kernel.org/qemu-devel/013b36a9-9310-4073-b54c-9c511f23d...@linux.intel.com/
Chenyi Qiang (5):
memory: Export a helper to get intersection of a MemoryRegionSection
with a given range
memo
On 5/27/2025 7:20 PM, David Hildenbrand wrote:
> On 27.05.25 07:47, Chenyi Qiang wrote:
>>
>>
>> On 5/26/2025 5:08 PM, David Hildenbrand wrote:
>>> On 20.05.25 12:28, Chenyi Qiang wrote:
>>>> As guest_memfd is now managed by RamBlockAttribu
On 5/27/2025 5:11 PM, Alexey Kardashevskiy wrote:
>
>
> On 20/5/25 20:28, Chenyi Qiang wrote:
>> The current error handling is simple with the following assumption:
>> - QEMU will quit instead of resuming the guest if kvm_convert_memory()
>> fails, thus no ne
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
On 5/27/2025 3:42 PM, Alexey Kardashevskiy wrote:
>
>
> On 27/5/25 15:47, Chenyi Qiang wrote:
>>
>>
>> On 5/26/2025 5:08 PM, David Hildenbrand wrote:
>>> On 20.05.25 12:28, Chenyi Qiang wrote:
>>>> As guest_memfd is now managed by RamBlockA
On 5/26/2025 5:08 PM, David Hildenbrand wrote:
> On 20.05.25 12:28, Chenyi Qiang wrote:
>> As guest_memfd is now managed by RamBlockAttribute with
>> RamDiscardManager, only block uncoordinated discard.
>>
>> Signed-off-by: Chenyi Qiang
>> ---
>>
On 5/26/2025 8:44 PM, Cédric Le Goater wrote:
> On 5/26/25 12:36, Cédric Le Goater wrote:
>> On 5/20/25 12:28, Chenyi Qiang wrote:
>>> So that the caller can check the result of NotifyRamDiscard() handler if
>>> the operation fails.
>>>
>>> Signed-of
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:
>>>>
>>>&g
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_m
On 5/26/2025 8:10 PM, David Hildenbrand wrote:
> On 26.05.25 12:19, Chenyi Qiang wrote:
>>
>>
>> On 5/26/2025 5:17 PM, David Hildenbrand wrote:
>>> On 20.05.25 12:28, Chenyi Qiang wrote:
>>>> The current error handling is simple with the following as
On 5/26/2025 7:37 PM, Cédric Le Goater wrote:
> On 5/20/25 12:28, Chenyi Qiang wrote:
>> This is the v5 series of the shared device assignment support.
>>
>> As discussed in the v4 series [1], the GenericStateManager parent class
>> and PrivateSharedManager child int
On 5/26/2025 5:06 PM, David Hildenbrand wrote:
> On 20.05.25 12:28, Chenyi Qiang wrote:
>> A new field, ram_shared, was introduced in RAMBlock to link to a
>> RamBlockAttribute object, which centralizes all guest_memfd state
>> information (such as fd and shared_bitm
On 5/26/2025 5:35 PM, Philippe Mathieu-Daudé wrote:
> Hi Chenyi Qiang,
>
> On 20/5/25 12:28, Chenyi Qiang wrote:
>> Update ReplayRamDiscard() function to return the result and unify the
>> ReplayRamPopulate() and ReplayRamDiscard() to ReplayRamDiscardState() at
>>
On 5/26/2025 5:17 PM, David Hildenbrand wrote:
> On 20.05.25 12:28, Chenyi Qiang wrote:
>> The current error handling is simple with the following assumption:
>> - QEMU will quit instead of resuming the guest if kvm_convert_memory()
>> fails, thus no need to do rollb
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 uncoordinated
>> discard") highlighted that subsystems like VFIO may disable RAM block
>> discard. However, guest_mem
As guest_memfd is now managed by RamBlockAttribute with
RamDiscardManager, only block uncoordinated discard.
Signed-off-by: Chenyi Qiang
---
Changes in v5:
- Revert to use RamDiscardManager.
Changes in v4:
- Modify commit message (RamDiscardManager->PrivateSharedManager).
Changes in
So that the caller can check the result of NotifyRamDiscard() handler if
the operation fails.
Signed-off-by: Chenyi Qiang
---
Changes in v5:
- Revert to use of NotifyRamDiscard()
Changes in v4:
- Newly added.
---
hw/vfio/listener.c | 6 --
include/system/memory.h | 4
to be
avoided since it is not supported yet in confidential VMs.
Additionally, use the ram_block_attribute_state_change() helper to
notify the registered RamDiscardListener of these changes.
Signed-off-by: Chenyi Qiang
---
Changes in v5:
- Revert to use RamDiscardManager interface.
- Mov
,
although it is currently unlikely to happen. With in-place conversion
guest_memfd in the future, it would be more likely to encounter errors
and require error handling. For now, simply return the result, and
kvm_convert_memory() will cause QEMU to quit if any issue arises.
Signed-off-by: Chenyi
.
Signed-off-by: Chenyi Qiang
---
system/ram-block-attribute.c | 116 +++
1 file changed, 90 insertions(+), 26 deletions(-)
diff --git a/system/ram-block-attribute.c b/system/ram-block-attribute.c
index 387501b569..0af3396aa4 100644
--- a/system/ram-block-attribute.c
callbacks, allowing
listeners to handle memory based on the latest status.
Signed-off-by: Chenyi Qiang
---
Change in v5:
- Move the state_change() back to a helper instead of a callback of
the class since there's no child for the RamBlockAttributeClass.
- Remove the error handling and
_mapping.c',
'memory.c',
'physmem.c',
diff --git a/system/ram-block-attribute.c b/system/ram-block-attribute.c
new file mode 100644
index 00..8d4a24738c
--- /dev/null
+++ b/system/ram-block-attribute.c
@@ -0,0 +1,311 @@
+/*
+ * QEMU ram block attribute
+ *
+ * Copyri
.
Signed-off-by: Chenyi Qiang
---
Changes in v5:
- Rename ReplayRamStateChange to ReplayRamDiscardState (David)
- return data->fn(s, data->opaque) instead of 0 in
virtio_mem_rdm_replay_discarded_cb(). (Alexey)
Changes in v4:
- Modify the commit message. We won't use Replay(
f8-8c9c30439...@redhat.com/
[4]
https://lore.kernel.org/qemu-devel/20240423150951.41600-54-pbonz...@redhat.com/
[5] https://lore.kernel.org/kvm/cover.1747264138.git.ackerley...@google.com/
[6]
https://lore.kernel.org/linux-iommu/0-v2-5c26bde5c22d+58b-iommu_pt_...@nvidia.com/
Chenyi Qiang (10):
Reviewed-by: David Hildenbrand
Reviewed-by: Zhao Liu
Signed-off-by: Chenyi Qiang
---
Changes in v5:
- Indent change for int128 ops to avoid the line over 80
- Add two Review-by from Alexey and Zhao
Changes in v4:
- No change.
Changes in v3:
- No change
Changes in v2:
- Make
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.
Changes in v4:
- No change.
Changes in v3:
- Move set_ram_discard_manager() up to avoid a g_f
On 5/13/2025 4:31 PM, Zhao Liu wrote:
diff --git a/include/exec/ramblock.h b/include/exec/ramblock.h
index 0babd105c0..b8b5469db9 100644
--- a/include/exec/ramblock.h
+++ b/include/exec/ramblock.h
@@ -23,6 +23,10 @@
#include "cpu-common.h"
#include "qemu/rcu.
Thanks Zhao for your review!
On 5/12/2025 4:07 PM, Zhao Liu wrote:
> [snip]
>
>> ---
>> include/exec/ramblock.h | 24 +++
>> system/meson.build | 1 +
>> system/ram-block-attribute.c | 282 +++
>> 3 files changed, 307 insertions(+)
>> create mod
On 5/9/2025 5:03 PM, Baolu Lu wrote:
> On 4/7/2025 3:49 PM, Chenyi Qiang wrote:
>> With the introduction of the RamBlockAttribute object to manage
>> RAMBlocks with guest_memfd and the implementation of
>> PrivateSharedManager interface to convey page conversion events, it
On 5/9/2025 4:18 PM, David Hildenbrand wrote:
>>>>
>>>> Signed-off-by: Chenyi Qiang
>>>
>>> <...>
>>>
>>>> +
>>>> +int ram_block_attribute_realize(RamBlockAttribute *attr, MemoryRegion
>&g
On 5/9/2025 4:22 PM, Baolu Lu wrote:
> On 4/27/2025 10:26 AM, Chenyi Qiang wrote:
>> Hi David,
>>
>> Any thought on patch 10-12, which is to move the change attribute into a
>> priority listener. A problem is how to handle the error handling of
>> private_
On 5/9/2025 5:23 PM, Baolu Lu wrote:
> On 4/7/2025 3:49 PM, Chenyi Qiang wrote:
>> In-place page conversion requires operations to follow a specific
>> sequence: unmap-before-conversion-to-private and
>> map-after-conversion-to-shared. Currently, both attribute changes and
On 5/9/2025 4:20 PM, David Hildenbrand wrote:
> On 09.05.25 04:38, Chao Gao wrote:
>> On Sun, Apr 27, 2025 at 10:26:52AM +0800, Chenyi Qiang wrote:
>>> Hi David,
>>>
>>> Any thought on patch 10-12, which is to move the change attribute into a
>>>
Thanks Baolu for your review!
On 5/9/2025 2:41 PM, Baolu Lu wrote:
> On 4/7/25 15:49, Chenyi Qiang wrote:
>> Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated
>> discard") highlighted that subsystems like VFIO may disable RAM block
>> discard.
set_attribute_private(). At present, I simply raise an assert instead of
adding any rollback work (see patch 11).
On 4/7/2025 3:49 PM, Chenyi Qiang wrote:
> So that the caller can check the result of NotifyStateClear() handler if
> the operation fails.
>
> Signed-off-by:
On 4/25/2025 8:42 PM, David Hildenbrand wrote:
> On 07.04.25 09:49, Chenyi Qiang wrote:
>> Update ReplayRamDiscard() function to return the result and unify the
>> ReplayRamPopulate() and ReplayRamDiscard() to ReplayStateChange() at
>> the same time due to their identi
On 4/25/2025 8:57 PM, David Hildenbrand wrote:
> On 07.04.25 09:49, Chenyi Qiang wrote:
>> To manage the private and shared RAM states in confidential VMs,
>> introduce a new class of PrivateShareManager as a child of
>> GenericStateManager, which inherits the six interf
Thanks David for your review!
On 4/25/2025 8:49 PM, David Hildenbrand wrote:
> On 09.04.25 11:56, Alexey Kardashevskiy wrote:
>>
>>
>> On 7/4/25 17:49, Chenyi Qiang wrote:
>>> RamDiscardManager is an interface used by virtio-mem to adjust VFIO
>>> mapping
On 4/18/2025 7:10 AM, Alexey Kardashevskiy wrote:
>
>
> 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 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:
>>>>
>>&g
On 4/9/2025 1:35 PM, Alexey Kardashevskiy wrote:
>
>
> On 7/4/25 17:49, Chenyi Qiang wrote:
>> Modify memory_region_set_ram_discard_manager() to return false if a
>> RamDiscardManager is already set in the MemoryRegion. The caller must
>> handle this failure, suc
On 4/9/2025 5:57 PM, Alexey Kardashevskiy wrote:
>
>
> On 7/4/25 17:49, Chenyi Qiang wrote:
>> Commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated
>> discard") highlighted that subsystems like VFIO may disable RAM block
>> discard. H
On 4/9/2025 5:58 PM, Alexey Kardashevskiy wrote:
>
>
> On 7/4/25 17:49, Chenyi Qiang wrote:
>> Subsystems like VFIO previously disabled ram block discard and only
>> allowed coordinated discarding via RamDiscardManager. However,
>> guest_memfd in confidential VMs r
On 4/9/2025 5:56 PM, Alexey Kardashevskiy wrote:
>
>
> On 7/4/25 17:49, Chenyi Qiang wrote:
>> To manage the private and shared RAM states in confidential VMs,
>> introduce a new class of PrivateShareManager as a child of
>
> missing "d" in
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
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 the
On 4/9/2025 2:45 PM, Alexey Kardashevskiy wrote:
>
>
> 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_regi
On 4/9/2025 1:43 PM, Alexey Kardashevskiy wrote:
>
>
> On 7/4/25 17:49, Chenyi Qiang wrote:
>> Update ReplayRamDiscard() function to return the result and unify the
>> ReplayRamPopulate() and ReplayRamDiscard() to ReplayStateChange() at
>> the same time due to
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 I
On 4/7/2025 5:53 PM, Xiaoyao Li wrote:
> On 4/7/2025 3:49 PM, Chenyi Qiang wrote:
>> Modify memory_region_set_ram_discard_manager() to return false if a
>> RamDiscardManager is already set in the MemoryRegion.
>
> It doesn't return false, but -EBUSY.
Nice catch! Fo
kernel.org/lkml/cover.1726009989.git.ackerley...@google.com/
[3]
https://lore.kernel.org/linux-iommu/7-v1-01fa10580981+1d-iommu_pt_...@nvidia.com/
Chenyi Qiang (13):
memory: Export a helper to get intersection of a MemoryRegionSection
with a given range
flexibility for addressing
specific requirements of confidential VMs in the future.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Newly added.
---
include/exec/memory.h | 44 +--
system/memory.c | 17 +
2 files changed, 59
maintainable.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Modify the commit message. We won't use Replay() operation when
doing the attribute change like v3.
Changes in v3:
- Newly added.
---
hw/virtio/virtio-mem.c | 20 ++--
include/exec/memory.h
/uninitialize
the RamBlockAttribute object. The object is registered/unregistered in
the target RAMBlock's MemoryRegion when creating guest_memfd.
Additionally, use the private_shared_manager_state_change() helper to
notify the registered PrivateSharedListener of these changes.
Signed-off-by: Chenyi
As guest_memfd is now managed by ram_block_attribute with
PrivateSharedManager, only block uncoordinated discard.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Modify commit message (RamDiscardManager->PrivateSharedManager).
Changes in v3:
- No change.
Changes in v2:
- Cha
lable, all operations are performed
with 4K granularity.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Change the name from memory-attribute-manager to
ram-block-attribute.
- Implement the newly-introduced PrivateSharedManager instead of
RamDiscardManager and change rela
and PrivateSharedListener, allowing
for extraction of common parts opportunisticlly.
Signed-off-by: Chenyi Qiang
---
Changes in v4
- Newly added.
---
hw/vfio/common.c | 104 +++---
hw/vfio/container-base.c | 1 +
include/hw/vfio/vfio
for the to_private case, an assert is used to prevent the
guest from continuing with a partially changed attribute state.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Newly added.
---
accel/kvm/kvm-all.c | 73 ++---
include/system/confidential-guest
RamDiscardManager (virtio-mem, migration, etc.) to
switch to use GenericStateChange helpers.
It can provide a more flexible and resuable framework for RAM state
management, facilitating future enhancements and use cases.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Newly added.
---
hw
the class.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Add the state_change() callback in PrivateSharedManagerClass
instead of the RamBlockAttribute.
Changes in v3:
- Move the bitmap update before notifier callbacks.
- Call the notifier callbacks directly in notify_discar
So that the caller can check the result of NotifyStateClear() handler if
the operation fails.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Newly added.
---
hw/vfio/common.c | 18 ++
include/exec/memory.h | 4 ++--
2 files changed, 12 insertions(+), 10 deletions
sequence, priority support is added to
PrivateSharedListener so that listeners are stored in a determined
order based on priority. A tail queue is used to store listeners,
allowing traversal in either direction.
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- Newly added.
---
accel/kvm/kvm-all.c
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- No change.
Changes in v3:
- Move set_ram_discard_manager() up to avoid a g_free()
- Clean up set_ram_discard_manager() definition
Changes in v2:
- newly added.
---
hw/virtio/virtio-mem.c | 29 -
include
Signed-off-by: Chenyi Qiang
---
Changes in v4:
- No change.
Changes in v3:
- No change
Changes in v2:
- Make memory_region_section_intersect_range() an inline function.
- Add Reviewed-by from David
- Define the @end as Int128 and use the related Int128_* ops as a wilder
API
On 3/14/2025 6:23 PM, Chenyi Qiang wrote:
>
>
> On 3/14/2025 5:50 PM, David Hildenbrand wrote:
>> On 14.03.25 10:30, Chenyi Qiang wrote:
>>>
>>>
>>> On 3/14/2025 5:00 PM, David Hildenbrand wrote:
>>>> On 14.03.25 09:21, Che
On 3/20/2025 11:15 AM, Chenyi Qiang wrote:
>
>
> On 3/19/2025 7:56 PM, Gupta, Pankaj wrote:
>> On 3/19/2025 12:23 PM, Chenyi Qiang wrote:
>>>
>>>
>>> On 3/19/2025 4:55 PM, Gupta, Pankaj wrote:
>>>>
>>>>&g
On 3/19/2025 7:56 PM, Gupta, Pankaj wrote:
> On 3/19/2025 12:23 PM, Chenyi Qiang wrote:
>>
>>
>> On 3/19/2025 4:55 PM, Gupta, Pankaj wrote:
>>>
>>>>>>>>> As the commit 852f0048f3 ("RAMBlock: make guest_memfd require
>>>&g
On 3/19/2025 4:55 PM, Gupta, Pankaj wrote:
>
>>> As the commit 852f0048f3 ("RAMBlock: make guest_memfd require
>>> uncoordinated discard") highlighted, some subsystems like VFIO may
>>> disable ram block discard. However, guest_memfd relies on the
>>> discard
>>> operation t
On 3/18/2025 1:01 AM, Gupta, Pankaj wrote:
> On 3/17/2025 11:36 AM, David Hildenbrand wrote:
>> On 17.03.25 03:54, Chenyi Qiang wrote:
>>>
>>>
>>> On 3/14/2025 8:11 PM, Gupta, Pankaj wrote:
>>>> On 3/10/2025 9:18 AM, Chenyi Qiang wrote:
On 3/17/2025 5:45 PM, Tony Lindgren wrote:
> On Mon, Mar 17, 2025 at 03:32:16PM +0800, Chenyi Qiang wrote:
>>
>>
>> On 3/17/2025 2:18 PM, Tony Lindgren wrote:
>>> Hi,
>>>
>>> On Mon, Mar 10, 2025 at 04:18:34PM +0800, Chenyi Qiang wrote:
>>
On 3/17/2025 2:18 PM, Tony Lindgren wrote:
> Hi,
>
> On Mon, Mar 10, 2025 at 04:18:34PM +0800, Chenyi Qiang wrote:
>> --- a/system/physmem.c
>> +++ b/system/physmem.c
>> @@ -1885,6 +1886,16 @@ static void ram_block_add(RAMBlock *
On 3/17/2025 11:00 AM, Kishen Maloor wrote:
> On 3/10/25 1:18 AM, Chenyi Qiang wrote:
>> ...
>> diff --git a/migration/ram.c b/migration/ram.c
>> index ce28328141..053730367b 100644
>> --- a/migration/ram.c
>> +++ b/migration/ram.c
>>
On 3/14/2025 8:11 PM, Gupta, Pankaj wrote:
> On 3/10/2025 9:18 AM, Chenyi Qiang wrote:
>> As the commit 852f0048f3 ("RAMBlock: make guest_memfd require
>> uncoordinated discard") highlighted, some subsystems like VFIO may
>> disable ram block discard. However, gu
10/2025 4:18 PM, Chenyi Qiang wrote:
> Introduce a new field, memory_attribute_manager, in RAMBlock to link to
> an MemoryAttributeManager object. This change centralizes all
> guest_memfd state information (like fd and shared_bitmap) within a
> RAMBlock, making it easier to manage.
On 3/14/2025 5:50 PM, David Hildenbrand wrote:
> On 14.03.25 10:30, Chenyi Qiang wrote:
>>
>>
>> On 3/14/2025 5:00 PM, David Hildenbrand wrote:
>>> On 14.03.25 09:21, Chenyi Qiang wrote:
>>>> Hi David & Alexey,
>>>
>>> Hi,
>&g
On 3/14/2025 5:00 PM, David Hildenbrand wrote:
> On 14.03.25 09:21, Chenyi Qiang wrote:
>> Hi David & Alexey,
>
> Hi,
>
>>
>> To keep the bitmap aligned, I add the undo operation for
>> set_memory_attributes() and use the bitmap + replay callback to
Signed-off-by: Chenyi Qiang
---
Changes in v3:
- No change
Changes in v2:
- Make memory_region_section_intersect_range() an inline function.
- Add Reviewed-by from David
- Define the @end as Int128 and use the related Int128_* ops as a wilder
API (Alexey)
---
hw/virtio/virtio
1 - 100 of 308 matches
Mail list logo