[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 1/6] memory: add incoherent cache flag
From: |
Andrew Jones |
Subject: |
[Qemu-devel] [RFC PATCH 1/6] memory: add incoherent cache flag |
Date: |
Fri, 6 Mar 2015 13:53:33 -0500 |
Add an incoherent cache flag, which indicates the region
needs explicit cache maintenance.
Signed-off-by: Andrew Jones <address@hidden>
---
include/exec/memory.h | 23 +++++++++++++++++++++++
memory.c | 15 +++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 06ffa1d185b93..c947b88b87241 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -158,6 +158,7 @@ struct MemoryRegion {
bool rom_device;
bool warning_printed; /* For reservations */
bool flush_coalesced_mmio;
+ bool incoherent_cache;
MemoryRegion *alias;
hwaddr alias_offset;
int32_t priority;
@@ -778,6 +779,28 @@ void memory_region_set_flush_coalesced(MemoryRegion *mr);
void memory_region_clear_flush_coalesced(MemoryRegion *mr);
/**
+ * memory_region_set_incoherent_cache: Flag this memory region as needing
+ * explicit cache maintenance.
+ *
+ * @mr: the memory region to be updated.
+ */
+void memory_region_set_incoherent_cache(MemoryRegion *mr);
+
+/**
+ * memory_region_clear_incoherent_cache: Remove the incoherent cache flag.
+ *
+ * @mr: the memory region to be updated.
+ */
+void memory_region_clear_incoherent_cache(MemoryRegion *mr);
+
+/**
+ * memory_region_has_incoherent_cache: Return the incoherent cache flag.
+ *
+ * @mr: the memory region to check.
+ */
+bool memory_region_has_incoherent_cache(MemoryRegion *mr);
+
+/**
* memory_region_add_eventfd: Request an eventfd to be triggered when a word
* is written to a location.
*
diff --git a/memory.c b/memory.c
index 20f6d9eeac737..fa74bcb8c1e4c 100644
--- a/memory.c
+++ b/memory.c
@@ -1549,6 +1549,21 @@ void memory_region_clear_flush_coalesced(MemoryRegion
*mr)
}
}
+void memory_region_set_incoherent_cache(MemoryRegion *mr)
+{
+ mr->incoherent_cache = true;
+}
+
+void memory_region_clear_incoherent_cache(MemoryRegion *mr)
+{
+ mr->incoherent_cache = false;
+}
+
+bool memory_region_has_incoherent_cache(MemoryRegion *mr)
+{
+ return mr->incoherent_cache;
+}
+
void memory_region_add_eventfd(MemoryRegion *mr,
hwaddr addr,
unsigned size,
--
1.8.3.1
- [Qemu-devel] [RFC PATCH 2/6] KVM: Introduce incoherent cache maintenance API, (continued)
- [Qemu-devel] [RFC PATCH 2/6] KVM: Introduce incoherent cache maintenance API, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 3/6] KVM: ARM: change __coherent_cache_guest_page interface, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 5/6] KVM: ARM: implement kvm_*_incoherent_memory_regions, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 4/6] KVM: ARM: extend __coherent_cache_guest_page, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 6/6] KVM: ARM: no need for kvm_arch_flush_incoherent, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 1/6] kvm: promote KVM_MEMSLOT_INCOHERENT to uapi, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 0/6] support KVM_MEM_INCOHERENT, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 2/6] HACK: linux header update, Andrew Jones, 2015/03/06
- [Qemu-devel] [PATCH 3/6] kvm-all: put kvm_mem_flags to more work, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 4/6] kvm-all: set KVM_MEM_INCOHERENT, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC PATCH 1/6] memory: add incoherent cache flag,
Andrew Jones <=
- [Qemu-devel] [RFC PATCH 5/6] vga: flag vram as incoherent, Andrew Jones, 2015/03/06
- [Qemu-devel] [RFC/WIP PATCH 6/6] memory: add clear_cache_to_poc, Andrew Jones, 2015/03/06
- Re: [Qemu-devel] the arm cache coherency cluster, Andrew Jones, 2015/03/18