[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC] tools/libxc, xen/x86: Added xc_set_mem_access_sparse()
On 08/29/2016 03:11 PM, Razvan Cojocaru wrote: > On 08/26/2016 10:18 AM, Jan Beulich wrote: >>>>> On 26.08.16 at 08:11, <rcojocaru@xxxxxxxxxxxxxxx> wrote: >>> + rc = p2m_set_mem_access(d, _gfn(mao.pfn), arr, mao.nr, start_iter, >>> + MEMOP_CMD_MASK, mao.access, 0); >> >> Please don't pass mao.pfn here when it's meant to be ignore by >> the caller. Use GFN_INVALID instead. And for future extensibility >> please check that the caller put some pre-defined pattern here >> (not sure whether zero is appropriate in this case). > > GFN_INVALID has it's own semantics in p2m_set_mem_access(): > > /* If request to set default access. */ > if ( gfn_eq(gfn, INVALID_GFN) ) > { > p2m->default_access = a; > return 0; > } > > I'll replace the condition with "if ( !arr && gfn_eq(gfn, INVALID_GFN) > )" and use GFN_INVALID in the XENMEM_access_op_set_access_multi (renamed > from XENMEM_access_op_set_access_sparse), as recommended. Sorry for the reversals, it obviously should say "INVALID_GFN" everywhere. :) Thanks, Razvan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |