[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-ia64-devel] [PATCH 2/3] [read-only mapping] GNTMAP_readonly support linux part
2 / 3
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Node ID 6c3d5f671d1760d6d301fe3160156375e8ac39c6
# Parent d4879708b89968cb860c324c27b69c9d3955fda5
add read only mapping support.
PATCHNAME: read_only_mapping_linux
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
diff -r d4879708b899 -r 6c3d5f671d17 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Tue May 16 13:25:43 2006 +0900
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Tue May 16 13:25:45 2006 +0900
@@ -313,12 +313,6 @@ gnttab_map_grant_ref_pre(struct gnttab_m
uint32_t flags;
flags = uop->flags;
- if (flags & GNTMAP_readonly) {
-#if 0
- xprintd("GNTMAP_readonly is not supported yet\n");
-#endif
- flags &= ~GNTMAP_readonly;
- }
if (flags & GNTMAP_host_map) {
if (flags & GNTMAP_application_map) {
@@ -400,8 +394,8 @@ xen_ia64_privcmd_entry_mmap(struct vm_ar
}
gpfn = page_to_pfn(page);
- error = HYPERVISOR_add_physmap(gpfn, mfn, 0/* prot:XXX */,
- domid);
+ error = HYPERVISOR_add_physmap(gpfn, mfn,
+ (pgprot_val(prot) == PROT_READ), domid);
if (error != 0) {
goto out;
}
diff -r d4879708b899 -r 6c3d5f671d17 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Tue May 16 13:25:43 2006 +0900
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Tue May 16 13:25:45 2006 +0900
@@ -476,21 +476,21 @@ HYPERVISOR_zap_physmap(unsigned long gpf
static inline unsigned long
__HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
- unsigned int flags, domid_t domid)
+ unsigned int readonly, domid_t domid)
{
return _hypercall_imm4(unsigned long, ia64_dom0vp_op,
- IA64_DOM0VP_add_physmap, gpfn, mfn, flags,
+ IA64_DOM0VP_add_physmap, gpfn, mfn, readonly,
domid);
}
static inline unsigned long
HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
- unsigned int flags, domid_t domid)
+ unsigned int readonly, domid_t domid)
{
unsigned long ret = 0;
BUG_ON(!running_on_xen);//XXX
if (running_on_xen) {
- ret = __HYPERVISOR_add_physmap(gpfn, mfn, flags, domid);
+ ret = __HYPERVISOR_add_physmap(gpfn, mfn, readonly, domid);
}
return ret;
}
@@ -503,6 +503,6 @@ HYPERVISOR_add_physmap(unsigned long gpf
#define HYPERVISOR_phystomach(gpfn) (gpfn)
#define HYPERVISOR_machtophys(mfn) (mfn)
#define HYPERVISOR_zap_physmap(gpfn, extent_order) (0)
-#define HYPERVISOR_add_physmap(gpfn, mfn, flags) (0)
+#define HYPERVISOR_add_physmap(gpfn, mfn, readonly) (0)
#endif
#endif /* __HYPERCALL_H__ */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
This mailing list archive is a service of Copilotco.