[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 09/12] memory: Drop mapping check from memory_region_get_ram_d
From: |
David Hildenbrand |
Subject: |
[PATCH v1 09/12] memory: Drop mapping check from memory_region_get_ram_discard_manager() |
Date: |
Wed, 27 Oct 2021 14:45:28 +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 d8a584ca80..2496bff729 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -2045,7 +2045,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
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, (continued)
[PATCH v1 05/12] memory-device: Move memory_device_check_addable() directly into memory_device_pre_plug(), David Hildenbrand, 2021/10/27
[PATCH v1 06/12] memory-device: Generalize memory_device_used_region_size(), David Hildenbrand, 2021/10/27
[PATCH v1 08/12] vhost: Respect reserved memslots for memory devices when realizing a vhost device, David Hildenbrand, 2021/10/27
[PATCH v1 07/12] memory-device: Support memory devices that dynamically consume multiple memslots, David Hildenbrand, 2021/10/27
[PATCH v1 10/12] virtio-mem: Fix typo in virito_mem_intersect_memory_section() function name, David Hildenbrand, 2021/10/27
[PATCH v1 11/12] virtio-mem: Set the RamDiscardManager for the RAM memory region earlier, David Hildenbrand, 2021/10/27
[PATCH v1 12/12] virtio-mem: Expose device memory via multiple memslots, David Hildenbrand, 2021/10/27
[PATCH v1 09/12] memory: Drop mapping check from memory_region_get_ram_discard_manager(),
David Hildenbrand <=