Thread (87 messages) 87 messages, 12 authors, 2007-02-22

Re: [patch 18/21] Xen-paravirt: Add Xen grant table support

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-02-16 06:53:37
Also in: lkml, xen-devel

On Thu, 15 Feb 2007 18:25:07 -0800 Jeremy Fitzhardinge [off-list ref] wrote:
+int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
+				int readonly)
+{
+	int ref;
+
+	if (unlikely((ref = get_free_entry()) == -1))
+		return -ENOSPC;
+
+	shared[ref].frame = frame;
+	shared[ref].domid = domid;
+	wmb();
+	shared[ref].flags = GTF_permit_access | (readonly ? GTF_readonly : 0);
+
+	return ref;
+}
+EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);
We have lots of open-coded mysteriously unexplained barriers in here.

I assume they're not smp_wmb() because this could be a !SMP guest talking
to an SMP host?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help