From: Arianna Avanzini <avanzini.arianna@gmail.com>
To: xen-devel@lists.xen.org
Cc: Ian.Campbell@eu.citrix.com, paolo.valente@unimore.it,
keir@xen.org, stefano.stabellini@eu.citrix.com,
Ian.Jackson@eu.citrix.com, dario.faggioli@citrix.com,
tim@xen.org, julien.grall@citrix.com, etrudeau@broadcom.com,
andrew.cooper3@citrix.com, JBeulich@suse.com,
avanzini.arianna@gmail.com, viktor.kleinik@globallogic.com
Subject: [PATCH v8 08/14] xen/common: move memory_type_changed() function to common code
Date: Sun, 25 May 2014 12:51:49 +0200 [thread overview]
Message-ID: <1401015115-7610-9-git-send-email-avanzini.arianna@gmail.com> (raw)
In-Reply-To: <1401015115-7610-1-git-send-email-avanzini.arianna@gmail.com>
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@gmail.com>
Cc: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Paolo Valente <paolo.valente@unimore.it>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Julien Grall <julien.grall@citrix.com>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Eric Trudeau <etrudeau@broadcom.com>
Cc: Viktor Kleinik <viktor.kleinik@globallogic.com>
---
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
next prev parent reply other threads:[~2014-05-25 10:51 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-25 10:51 [PATCH v8 00/14] Implement the XEN_DOMCTL_memory_mapping hypercall for ARM Arianna Avanzini
2014-05-25 10:51 ` [PATCH v8 01/14] arch/arm: domain build: let dom0 access I/O memory of mapped devices Arianna Avanzini
2014-06-10 15:04 ` Ian Campbell
2014-05-25 10:51 ` [PATCH v8 02/14] arch/arm: add consistency check to REMOVE p2m changes Arianna Avanzini
2014-05-25 15:50 ` Julien Grall
2014-06-05 13:45 ` Ian Campbell
2014-06-05 13:50 ` Ian Campbell
2014-05-25 10:51 ` [PATCH v8 03/14] arch/arm: let map_mmio_regions() take pfn as parameters Arianna Avanzini
2014-05-25 10:51 ` [PATCH v8 04/14] arch/arm: let map_mmio_regions() use start and count Arianna Avanzini
2014-05-25 15:56 ` Julien Grall
2014-06-05 13:53 ` Ian Campbell
2014-05-25 10:51 ` [PATCH v8 05/14] arch/arm: unmap partially-mapped I/O-memory regions Arianna Avanzini
2014-05-25 16:04 ` Julien Grall
2014-06-05 14:03 ` Ian Campbell
2014-06-05 14:09 ` Julien Grall
2014-05-25 10:51 ` [PATCH v8 06/14] arch/x86: warn if to-be-removed mapping does not exist Arianna Avanzini
2014-06-05 14:06 ` Ian Campbell
2014-05-25 10:51 ` [PATCH v8 07/14] arch/x86: cleanup memory_mapping DOMCTL Arianna Avanzini
2014-05-26 9:57 ` Jan Beulich
2014-05-25 10:51 ` Arianna Avanzini [this message]
2014-05-25 16:15 ` [PATCH v8 08/14] xen/common: move memory_type_changed() function to common code Julien Grall
2014-05-26 9:58 ` Jan Beulich
2014-06-05 14:08 ` Ian Campbell
2014-05-25 10:51 ` [PATCH v8 09/14] xen/x86: factor out map and unmap from the memory_mapping DOMCTL Arianna Avanzini
2014-05-26 10:04 ` Jan Beulich
2014-05-25 10:51 ` [PATCH v8 10/14] xen/common: move the memory_mapping DOMCTL hypercall to common code Arianna Avanzini
2014-05-25 16:42 ` Julien Grall
2014-05-26 10:07 ` Jan Beulich
2014-05-26 11:03 ` Julien Grall
2014-06-05 14:21 ` Ian Campbell
2014-06-05 14:33 ` Tim Deegan
2014-06-05 14:39 ` Ian Campbell
2014-05-26 10:06 ` Jan Beulich
2014-05-25 10:51 ` [PATCH v8 11/14] tools/libxl: parse optional start gfn from the iomem config option Arianna Avanzini
2014-05-25 10:51 ` [PATCH v8 12/14] tools/libxl: handle the iomem parameter with the memory_mapping hcall Arianna Avanzini
2014-05-25 17:04 ` Julien Grall
2014-06-05 14:27 ` Ian Campbell
2014-05-25 10:51 ` [PATCH v8 13/14] tools/libxl: explicitly grant access to needed I/O-memory ranges Arianna Avanzini
2014-05-25 17:08 ` Julien Grall
2014-05-26 10:11 ` Jan Beulich
2014-05-26 10:58 ` Julien Grall
2014-05-26 11:15 ` Jan Beulich
2014-06-05 14:31 ` Ian Campbell
2014-06-05 14:37 ` Ian Campbell
2014-06-05 14:54 ` Jan Beulich
2014-06-05 14:53 ` Jan Beulich
2014-05-26 10:10 ` Jan Beulich
2014-05-25 10:51 ` [PATCH v8 14/14] xen/common: do not implicitly permit access to mapped I/O memory Arianna Avanzini
2014-07-01 10:45 ` [PATCH v8 00/14] Implement the XEN_DOMCTL_memory_mapping hypercall for ARM Julien Grall
2014-07-01 10:55 ` Arianna Avanzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1401015115-7610-9-git-send-email-avanzini.arianna@gmail.com \
--to=avanzini.arianna@gmail.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=etrudeau@broadcom.com \
--cc=julien.grall@citrix.com \
--cc=keir@xen.org \
--cc=paolo.valente@unimore.it \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=viktor.kleinik@globallogic.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).