Daniel De Graaf
2010-Dec-01 22:48 UTC
[Xen-devel] gnttab_setup_table attempting copy_from_guest in atomic context
do_grant_table_op takes domain_lock(d), and then calls gnttab_setup_table with the lock held. Since changeset 22402:7d2fdc083c9c, this will cause the copy to fail with a rather misleading message: (XEN) grant_table.c:1315:d1 Fault while reading gnttab_query_size_t. This causes grants between HVM guests to fail.>From looking at the code, it appears that at least some of the functionswithin do_grant_table_op do not need to hold domain_lock. Is there a reason to hold domain_lock when manipulating the grant table? Most of the critical operations already appear to be protected by the grant table lock, so it may be safe to completely remove the lock_domain calls in this function. -- Daniel De Graaf National Security Agency _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2010-Dec-02 07:41 UTC
Re: [Xen-devel] gnttab_setup_table attempting copy_from_guest in atomic context
On 01/12/2010 22:48, "Daniel De Graaf" <dgdegra@tycho.nsa.gov> wrote:> do_grant_table_op takes domain_lock(d), and then calls gnttab_setup_table > with the lock held. Since changeset 22402:7d2fdc083c9c, this will cause the > copy to fail with a rather misleading message: > > (XEN) grant_table.c:1315:d1 Fault while reading gnttab_query_size_t. > > This causes grants between HVM guests to fail. > >> From looking at the code, it appears that at least some of the functions > within do_grant_table_op do not need to hold domain_lock. Is there a reason > to hold domain_lock when manipulating the grant table? Most of the critical > operations already appear to be protected by the grant table lock, so it may > be safe to completely remove the lock_domain calls in this function.Yes, the grant locking will need reworking. Xenpaging is going to require the ability to sleep in __hvm_copy(), and this means that all callers -- direct or indirect -- must hold no locks. Will have to take a look. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel