[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v8 08/14] xen/common: move memory_type_changed() function to common code



Currently, MTRR-related code is not available for the ARM architecture.
Given that the memory_type_changed() function must be called also from
common code, its invocation is currently ifdef'd out to be only compiled
in on an x86 machine. This commit adds an empty stub for ARM, instead,
also moving the function's definition to common code.

Signed-off-by: Arianna Avanzini <avanzini.arianna@xxxxxxxxx>
Cc: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
Cc: Paolo Valente <paolo.valente@xxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Julien Grall <julien.grall@xxxxxxxxxx>
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Cc: Jan Beulich <JBeulich@xxxxxxxx>
Cc: Keir Fraser <keir@xxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Eric Trudeau <etrudeau@xxxxxxxxxxxx>
Cc: Viktor Kleinik <viktor.kleinik@xxxxxxxxxxxxxxx>
---
 xen/arch/arm/Makefile      | 1 +
 xen/arch/arm/mtrr.c        | 6 ++++++
 xen/common/domctl.c        | 3 +--
 xen/include/asm-arm/mtrr.h | 6 ++++++
 xen/include/asm-x86/mtrr.h | 2 +-
 xen/include/xen/mtrr.h     | 8 ++++++++
 6 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/arm/mtrr.c
 create mode 100644 xen/include/asm-arm/mtrr.h
 create mode 100644 xen/include/xen/mtrr.h

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 63e0460..5428ccc 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -16,6 +16,7 @@ obj-y += irq.o
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += p2m.o
+obj-y += mtrr.o
 obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += physdev.o
diff --git a/xen/arch/arm/mtrr.c b/xen/arch/arm/mtrr.c
new file mode 100644
index 0000000..e9d52f5
--- /dev/null
+++ b/xen/arch/arm/mtrr.c
@@ -0,0 +1,6 @@
+#include <xen/mtrr.h>
+
+/* XXX: to be implemented */
+void memory_type_changed(struct domain *d)
+{
+}
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 4774277..e666abf 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -24,6 +24,7 @@
 #include <xen/bitmap.h>
 #include <xen/paging.h>
 #include <xen/hypercall.h>
+#include <xen/mtrr.h>
 #include <asm/current.h>
 #include <asm/irq.h>
 #include <asm/page.h>
@@ -818,10 +819,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
u_domctl)
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-#ifdef CONFIG_X86
         if ( !ret )
             memory_type_changed(d);
-#endif
     }
     break;
 
diff --git a/xen/include/asm-arm/mtrr.h b/xen/include/asm-arm/mtrr.h
new file mode 100644
index 0000000..3928497
--- /dev/null
+++ b/xen/include/asm-arm/mtrr.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARM_MTRR_H__
+#define __ASM_ARM_MTRR_H__
+
+#include <xen/mtrr.h>
+
+#endif /* __ASM_ARM_MTRR_H__ */
diff --git a/xen/include/asm-x86/mtrr.h b/xen/include/asm-x86/mtrr.h
index 328ba04..c7d577e 100644
--- a/xen/include/asm-x86/mtrr.h
+++ b/xen/include/asm-x86/mtrr.h
@@ -2,6 +2,7 @@
 #define __ASM_X86_MTRR_H__
 
 #include <xen/config.h>
+#include <xen/mtrr.h>
 #include <asm/mm.h>
 
 /* These are the region types. They match the architectural specification. */
@@ -89,7 +90,6 @@ extern bool_t mtrr_fix_range_msr_set(struct domain *, struct 
mtrr_state *,
                                      uint32_t row, uint64_t msr_content);
 extern bool_t mtrr_def_type_msr_set(struct domain *, struct mtrr_state *,
                                     uint64_t msr_content);
-extern void memory_type_changed(struct domain *);
 extern bool_t pat_msr_set(uint64_t *pat, uint64_t msr);
 
 bool_t is_var_mtrr_overlapped(struct mtrr_state *m);
diff --git a/xen/include/xen/mtrr.h b/xen/include/xen/mtrr.h
new file mode 100644
index 0000000..9d3f908
--- /dev/null
+++ b/xen/include/xen/mtrr.h
@@ -0,0 +1,8 @@
+#ifndef __MTRR_H__
+#define __MTRR_H__
+
+struct domain;
+
+extern void memory_type_changed(struct domain *);
+
+#endif /* __MTRR_H__ */
-- 
1.9.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.