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

Re: [PATCH v3] x86+libxl: correct p2m (shadow) memory pool size calculation


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 27 Apr 2022 17:46:18 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Wed, 27 Apr 2022 16:46:52 +0000
  • Ironport-data: A9a23:T4kFsKrVInTTAmPZVTC5JaT+C0teBmIZZRIvgKrLsJaIsI4StFCzt garIBnUOauNZWene491Ot7l8kJXupTRn4NnGwJsqnsyRi0Q+ZuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrZRbrJA24DjWVvR4 4yq+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBBYbspssndT9kKB4vPaxPoIOEA0qFmJnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVIxDfFDfEgUNbbTr/D/9Nw1zYsnMFeW/3ZY qL1bBIxPUieOkYUaj/7Drpjg/+FjX3jeQQHuUmT/YQHwkiK6zd+he2F3N39JYXRGJQ9clyjj n3C13T0BFcdLtP34TiK6HW3ncfUgDj2HokVEdWQ9PRnnVmSzWw7EwANWB2wpvzRol6zXZdTJ lIZ/gIqrLMu7wq7Q9/lRRq6rXWY+BkGVLJt//YSsV/XjPCOukDAWzZCHmUphMEaWNEefhcK6 HCzufXVPgM+sLycEU7e1IWuhGbnUcQKFlMqaSgBRAoDxtDspoAvkx7CJupe/L6JYs7dQm+pn W3TxMQqr/BK1JNQif3nlbzSq2j0zqUlWDLZ8ek+soiNygpiLLCoaIWzgbQwxaYRdd3JJrVtU ZVtpiR/0AzsJczV/MBuaL9UdF1M2xpiGGeB6WOD57F7q1yQF4eLJOi8Gg1WKkZzKdojcjT0e kLVsg45zMYNYSP7NvMtO93qUJ5CIU3c+TPNDK68UzazSsIpKF/vEN9GOCZ8IFwBYGBzyPpia P93gO6nDGoACLQP8dZFb7x17FPf/QhnnTm7bcmil3yPiOPODFbIGeZtGAbfNYgRsfLbyDg5B v4CbqNmPT0EC7agCsQWmKZORW03wY8TWM6m9pQLJrLSSuekcUl4Y8LsLXoaU9QNt8xoei3gp BlRhmcwJILDuED6
  • Ironport-hdrordr: A9a23:QEiSM66Dnqmf4h8MLAPXwMjXdLJyesId70hD6qhwISY6TiW9rb HLoB17726QtN9/YhwdcLy7VJVoBEmskqKdgrNhX4tKPjOHhILAFugLhuHfKn/bak7DH4ZmpM FdmsNFaeEYY2IUsfrH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 27, 2022 at 12:57:17PM +0200, Jan Beulich wrote:
> The reference "to shadow the resident processes" is applicable to
> domains (potentially) running in shadow mode only. Adjust the
> calculations accordingly. This, however, requires further parameters.
> Since the original function is deprecated anyway, and since it can't be
> changed (for being part of a stable ABI), introduce a new (internal
> only) function, with the deprecated one simply becoming a wrapper.
> 
> In dom0_paging_pages() also take the opportunity and stop open-coding
> DIV_ROUND_UP().
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> v3: Refine expression in dom0_paging_pages(). Update comment there as
>     well.
> v2: Introduce libxl__get_required_paging_memory().
> 
> --- a/tools/libs/light/libxl_create.c
> +++ b/tools/libs/light/libxl_create.c
> @@ -1017,7 +1017,7 @@ static bool ok_to_default_memkb_in_creat
>       * The result is that the behaviour with old callers is the same
>       * as in 4.13: no additional memory is allocated for shadow and
>       * iommu (unless the caller set shadow_memkb, eg from a call to
> -     * libxl_get_required_shadow_memory).
> +     * libxl__get_required_paging_memory).

I think in this comment, the "caller" is an application using libxl,
which might set shadow_memkb with a value from
libxl_get_required_shadow_memory(). So I don't think there's a need to
change the comment.


Otherwise, the patch looks good.
So with this chunk removed: Reviewed-by: Anthony PERARD 
<anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

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