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

[Xen-changelog] [IA64] GNTMAP_readonly support linux part



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 5674e4fe8f0225eece0770b5af334795ba1924e0
# Parent  40959bc0a269ee71ba2378e7ffbff31c187a78d2
[IA64] GNTMAP_readonly support linux part

add read only mapping support.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   |   14 ++++++--------
 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h |    4 ++--
 2 files changed, 8 insertions(+), 10 deletions(-)

diff -r 40959bc0a269 -r 5674e4fe8f02 
linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Wed May 24 10:56:47 
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Wed May 24 10:59:28 
2006 -0600
@@ -314,12 +314,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) {
@@ -517,6 +511,7 @@ xen_ia64_privcmd_entry_mmap(struct vm_ar
        int error = 0;
        struct xen_ia64_privcmd_entry* entry = &privcmd_range->entries[i];
        unsigned long gpfn;
+       unsigned long flags;
 
        BUG_ON((addr & ~PAGE_MASK) != 0);
        BUG_ON(mfn == INVALID_MFN);
@@ -527,8 +522,11 @@ xen_ia64_privcmd_entry_mmap(struct vm_ar
        }
        gpfn = (privcmd_range->res->start >> PAGE_SHIFT) + i;
 
-       error = HYPERVISOR_add_physmap(gpfn, mfn, 0/* prot:XXX */,
-                                      domid);
+       flags = ASSIGN_writable;
+       if (pgprot_val(prot) == PROT_READ) {
+               flags = ASSIGN_readonly;
+       }
+       error = HYPERVISOR_add_physmap(gpfn, mfn, flags, domid);
        if (error != 0) {
                goto out;
        }
diff -r 40959bc0a269 -r 5674e4fe8f02 
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Wed May 24 10:56:47 
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Wed May 24 10:59:28 
2006 -0600
@@ -494,7 +494,7 @@ 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 long flags, domid_t domid)
 {
        return _hypercall_imm4(unsigned long, ia64_dom0vp_op,
                               IA64_DOM0VP_add_physmap, gpfn, mfn, flags,
@@ -503,7 +503,7 @@ __HYPERVISOR_add_physmap(unsigned long g
 
 static inline unsigned long
 HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
-                      unsigned int flags, domid_t domid)
+                      unsigned long flags, domid_t domid)
 {
        unsigned long ret = 0;
        BUG_ON(!running_on_xen);//XXX

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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