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

Re: [Xen-devel] [PATCH 20/22] arch/x86: use XSM hooks for get_pg_owner access checks



>>> On 13.09.12 at 15:55, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:
> On 09/13/2012 04:13 AM, Jan Beulich wrote:
>>>>> On 12.09.12 at 17:59, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:
>>> @@ -3353,9 +3357,14 @@ long do_mmu_update(
>>>              mfn = req.ptr >> PAGE_SHIFT;
>>>              gpfn = req.val;
>>>  
>>> -            rc = xsm_mmu_machphys_update(d, pg_owner, mfn);
>>> -            if ( rc )
>>> -                break;
>>> +            xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
>>> +            if ( xsm_needed != xsm_checked )
>>> +            {
>>> +                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
>> 
>> If you're already updating it this way, it would seem appropriate
>> to remove the over-checking here: pt_owner is meaningless for
>> this operation (there are no page tables involved), and hence
>> you could/should pass d instead.
> 
> While this is safe, it makes thinking about the arguments to the XSM hook
> harder: the second argument would be defined as "pt_owner if called with
> XSM_MMU_NORMAL_UPDATE set and either XSM_MMU_MACHPHYS_UPDATE unset or
> XSM_MMU_MACHPHYS_UPDATE set in the previous call; otherwise, d." I would
> prefer the simpler method of passing pt_owner every time, and only checking
> it if XSM_MMU_NORMAL_UPDATE is set (which I now notice that the default
> XSM hook does not do, although the FLASK hook does; I'll fix that).

If that's a concern, then rather pass NULL here (and deal with it
in the XSM code), indicating that there are no page tables being
updated.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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