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

[Xen-devel] changing attributes of a page!



Hi,

I am trying to change attributes of a page from Dom0. The reason is
that I want to make a kernel module completely read-only to other
parts of kernel. I will update it from hypervisor itself. I have tried
to do this by this code:

// I have the mfn of the page in Dom0's address space.
void hamed_set_entry(struct p2m_domain *p2m, mfn_t mfn) {
    unsigned long gfn = mfn_to_gfn(p2m->domain,mfn);
    p2m_type_t p2mt;
    p2m_access_t p2ma;
    p2m_lock(p2m);
    p2m->get_entry(p2m, gfn, &p2mt, &p2ma, p2m_query);
    p2m->set_entry(p2m, gfn, mfn, 0, p2mt, p2m_access_rwx);
    p2m_unlock(p2m);
}

But whenever it runs Dom0 restarts. I am not even sure this is the
right way to do this. I am grateful for any help!

Best Regards
Mohamad Rezaei
-------------------
ICT Research Center
Amirkabir University of Technology

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


 


Rackspace

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