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

Re: [Minios-devel] [UNIKRAFT PATCH 6/6] plat/xen: Add grant table support for Xen (x86_64)



Wei Liu <wei.liu2@xxxxxxxxxx> writes:

> On Wed, Jun 27, 2018 at 03:49:21PM +0200, Yuri Volchkov wrote:
>> > +grant_ref_t gnttab_grant_access(domid_t domid, unsigned long pfn,
>> > +          int readonly)
>> Is it supposed to be a mfn, not pfn?
>> 
>> > +{
>> > +  grant_ref_t gref;
>> > +
>> > +  gref = get_free_entry();
>> > +  gnttab.table[gref].frame = pfn;
>> > +  gnttab.table[gref].domid = domid;
>> > +  wmb();
>> Why the barrier is here not after setting the readonly flag? MiniOS and
>> Linux are doing the same, so I assume that is the right way. Maybe you
>> could enlighten me? :)
>> 
>
> Because the purpose is to make sure the write to the flags field happens
> *after* the write to frame and domid fields. I.e. the change of the flag
> will be visible only after the changes to the other fields are visible.
>
> There are probably some paring rmb() in the code, but I haven't
> looked...
>
> Wei.
That makes sense. Thank you!

-- 
Yuri Volchkov
Software Specialist

NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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