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

Re: [PATCH 2/3] gnttab: consolidate pin-to-status syncing


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 15 Jan 2021 13:25:23 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4Dtku8nyGceGUaZICcWQCXlOBSr8iuIjAmWR0GN3LmE=; b=aA1dWSUJutEj1WFG/6nxDibCGfO6GekFNSLqICOFMpJBj66MKV5LWz1WoNMxgqB1VP7/yB5YkUTgtxRd/DEjfe2W98CN3DXh+Jekcza3kexIevW8qAZGkHXWkrA9c7BBjyiS9dT8HHz/b8x79QnkCNFR/3qk7Frzcp85n9Hyjb3w4avJsJf3bUtGARThoSqJKcLznIzeozdZpAoZ1yy26GmegHrLCsOMzpSTAt+R2r55EDQ0GWvvr7VrgekkuY/x5beiFsh5FMsDXLlsYW8VbJSOgNqsDa9+ZRHOi7kxvgqv/wA91QuVrtZkU4Y9gvXAYc+oXxIqMg0RnavvlOP26g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZDvd4HUgx6BRBdjPPwIgtxCBy6cnf7qJvyur7rAHBgd3GGd2u0OW/Q6FZjoz3prceJp8/RAsejOM4KBq2/2SWi287wMIjJHzXSRQC2rC4BEDuAkR/tS6AzIX6ZJjd75YMojDcHnStH7+9maA4LcgD82PtEk63uDxt4vma/LYoMv80dwd+TBr7ftDGv+IxsD2X8uFH/nyBvmhl+b5adzswnEH+aSoIP4emvcQfxZwBRkU21uf/5QxUdp+a5jAqBepYaHJHZtaKmTG2wdil9xq6YClFK7x2v4JWzodSq8D7j9/Eyh2D07dCWGrzlJDPzK3PcdkFPIjCE4rUxC+MaRh7g==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 15 Jan 2021 13:25:44 +0000
  • Ironport-sdr: 9lxNbR7EKl1czjOoKlKza0svA19QSB6S1FPNxDg8/vOxd1101nywSiSurz6pbQu5/PFiL4W+Gp Xfu/E/ndp6ecgC0EjXT5bBN2H58Yu3gbSz+bjuGH2KQ9KP/68ck9FtwAylpehHHESGCNXzZYlj SY3+xldbFwkHOQ1KxYNp97xfP5S9RdQFsQ/BJnzd/ps+IQxlldIMkieljIGOhANdas+sHJSc3u Xly+iPmUglL0C/tPPFzIvdrPrtiGIXnHTpaOgvtKAb2BinDowMB+IkhnI9BPMRhXJlgSLjisZb Cig=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14/01/2021 15:23, Jan Beulich wrote:
> Forever since the fix for XSA-230 the 2nd of the comments ahead of
> fixup_status_for_copy_pin() has been stale - there's nothing specific to
> transitive grants there anymore.
>
> Move the function up, drop the "copy" part from its name again, add a
> "readonly" parameter, and use it also on other paths having decremented
> one (or not having got to increment any) of the pin counts.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -908,6 +908,25 @@ static int _set_status(const grant_entry
>          return _set_status_v2(shah, status, rd, act, readonly, mapflag, 
> ldomid);
>  }
>  
> +/*
> + * The status for a grant may indicate that we're taking more access than
> + * the pin requires.  Fix up the status to match the pin.

This sentence isn't correct.  It will only clear status flags to match a
reduction in the pinned references.  IOW it cannot be used in the case
that a grant goes from unpinned to pinned.

How about renaming to clear_status_for_pin() to make this clearer?  I
don't think it is worth trying to make the operation more generic.

If so (and with a suitable adjustment to the comment), Reviewed-by:
Andrew Cooper <andrew.cooper3@xxxxxxxxxx>



 


Rackspace

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