[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1153852204.5665.10.camel@basalt.austin.ibm.com>
Date: Tue, 25 Jul 2006 13:30:04 -0500
From: Hollis Blanchard <hollisb@...ibm.com>
To: Chris Wright <chrisw@...s-sol.org>
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...l.org>,
virtualization@...ts.osdl.org,
Jeremy Fitzhardinge <jeremy@...p.org>,
xen-devel@...ts.xensource.com, Ian Pratt <ian.pratt@...source.com>,
xen-ppc-devel <xen-ppc-devel@...ts.xensource.com>
Subject: Re: [RFC PATCH 28/33] Add Xen grant table support
On Tue, 2006-07-18 at 00:00 -0700, Chris Wright wrote:
> +int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly)
> +{
> + u16 flags, nflags;
> +
> + nflags = shared[ref].flags;
> + do {
> + if ((flags = nflags) & (GTF_reading|GTF_writing)) {
> + printk(KERN_ALERT "WARNING: g.e. still in use!\n");
> + return 0;
> + }
> + } while ((nflags = synch_cmpxchg(&shared[ref].flags, flags, 0)) !=
> + flags);
> +
> + return 1;
> +}
>>From patch 06/33:
+/*
+ * A grant table comprises a packed array of grant entries in one or
more
+ * page frames shared between Xen and a guest.
+ * [XEN]: This field is written by Xen and read by the sharing guest.
+ * [GST]: This field is written by the guest and read by Xen.
+ */
+struct grant_entry {
+ /* GTF_xxx: various type and flag information. [XEN,GST] */
+ uint16_t flags;
+ /* The domain being granted foreign privileges. [GST] */
+ domid_t domid;
+ /*
+ * GTF_permit_access: Frame that @domid is allowed to map and
access. [GST]
+ * GTF_accept_transfer: Frame whose ownership transferred by
@domid. [XEN]
+ */
+ uint32_t frame;
+};
I object to these uses of (synch_)cmpxchg on a uint16_t in common code.
Many architectures, including PowerPC, do not support 2-byte atomic
operations, but this code is common to all Xen architectures.
--
Hollis Blanchard
IBM Linux Technology Center
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists