[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 01/15] memory: Drop mapping check from memory_region_get_ram_
From: |
David Hildenbrand |
Subject: |
[PATCH RFC 01/15] memory: Drop mapping check from memory_region_get_ram_discard_manager() |
Date: |
Wed, 13 Oct 2021 12:33:16 +0200 |
It's sufficient to check whether a memory region is RAM, the region
doesn't necessarily have to be mapped into another memory region.
For example, RAM memory regions mapped via an alias will never make
"memory_region_is_mapped()" succeed.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
softmmu/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 3bcfc3899b..8669f78395 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -2038,7 +2038,7 @@ int memory_region_iommu_num_indexes(IOMMUMemoryRegion
*iommu_mr)
RamDiscardManager *memory_region_get_ram_discard_manager(MemoryRegion *mr)
{
- if (!memory_region_is_mapped(mr) || !memory_region_is_ram(mr)) {
+ if (!memory_region_is_ram(mr)) {
return NULL;
}
return mr->rdm;
--
2.31.1
- [PATCH RFC 00/15] virtio-mem: Expose device memory via separate memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 01/15] memory: Drop mapping check from memory_region_get_ram_discard_manager(),
David Hildenbrand <=
- [PATCH RFC 02/15] kvm: Return number of free memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 03/15] vhost: Return number of free memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 04/15] memory: Allow for marking memory region aliases unmergeable, David Hildenbrand, 2021/10/13
- [PATCH RFC 05/15] vhost: Don't merge unmergeable memory sections, David Hildenbrand, 2021/10/13
- [PATCH RFC 06/15] memory-device: Move memory_device_check_addable() directly into memory_device_pre_plug(), David Hildenbrand, 2021/10/13
- [PATCH RFC 07/15] memory-device: Generalize memory_device_used_region_size(), David Hildenbrand, 2021/10/13
- [PATCH RFC 08/15] memory-device: Support memory devices that consume a variable number of memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 09/15] vhost: Respect reserved memslots for memory devices when realizing a vhost device, David Hildenbrand, 2021/10/13
- [PATCH RFC 10/15] virtio-mem: Set the RamDiscardManager for the RAM memory region earlier, David Hildenbrand, 2021/10/13
- [PATCH RFC 11/15] virtio-mem: Fix typo in virito_mem_intersect_memory_section() function name, David Hildenbrand, 2021/10/13