[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4EDF41C5.1030105@oracle.com>
Date: Wed, 07 Dec 2011 18:36:53 +0800
From: ANNIE LI <annie.li@...cle.com>
To: jeremy@...p.org, paul.durrant@...rix.com, Ian.Campbell@...rix.com
CC: annie.li@...cle.com, xen-devel@...ts.xensource.com,
linux-kernel@...r.kernel.org, konrad.wilk@...cle.com,
kurt.hackel@...cle.com
Subject: Re: [PATCH 1/2] xen/granttable: Support sub-page grants
> +void gnttab_grant_foreign_access_ref_subpage_v2(grant_ref_t ref, domid_t domid,
> + unsigned long frame, int flags,
> + unsigned page_off,
> + unsigned length)
> +{
> + BUG_ON(flags& (GTF_accept_transfer | GTF_reading |
> + GTF_writing | GTF_transitive));
This is slightly changed from the initial code, welcome your suggestions.
Initial condition is:
BUG_ON(flags & (GTF_accept_transfer | GTF_reading | GTF_writing |
GTF_sub_page | GTF_permit_access));
GTF_sub_page | GTF_permit_access will be set later in this function, so
it is necessary to verify this flag here.
GTF_transitive and GTF_sub_page can not be enabled at same time, so
GTF_transitive is checked here to avoid those two flags are both enabled.
Same code was changed in corresponding transitive function.
Thanks
Annie
> + BUG_ON(grant_table_version == 1);
> + gnttab_shared.v2[ref].sub_page.frame = frame;
> + gnttab_shared.v2[ref].sub_page.page_off = page_off;
> + gnttab_shared.v2[ref].sub_page.length = length;
> + gnttab_shared.v2[ref].hdr.domid = domid;
> + wmb();
> + gnttab_shared.v2[ref].hdr.flags =
> + GTF_permit_access | GTF_sub_page | flags;
> +}
>
--
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