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

Re: [PATCH] tools/libs/guest: fix save and restore of pv domains after 32-bit de-support


  • To: Juergen Gross <jgross@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 7 Jun 2021 12:01:51 +0100
  • 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=ksN3+G7bltMaVrUG7fsa6caqJWLsAeChIaYRABmDk8M=; b=F4yKkzNPXWuu7vr0MdsuFJidnSUuSemhs0g7WTakf59Zi+wGEmBCr484LrHzxKGp3pR4Oc3qgemGjJWuUB4wkLysPvwrD2EpHn8Qi9D4O8Uqbx9Mg0sZQP16DkOBafOX6ZHvUpdOQq7lkoolXN6gtyLVSt5LSd5/pLLM4ajgdYggXnqAZUOemcHy5VHLoa+qLZ5uUr69ACf558e+xgnKJadzuplUZKcRe9utZV9c1OZdw6aEX8DZBvi2i/ze2G6x31dXZMzauVRwDfVn69bjoKWQFY1zaveln/07RgHBlnRB0iGFV3D6femdpek+BgtDcTTsx8VfDFmpscNage3KcA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NR59DpeaHrH7qazNbVThGpVMkOub7m0BcWERUucNxF37SRWkldr9KWNvJJ2TuTWgFEeh3NNAivgzKyCPBz40qv1pC9J9inz5nuSC1F/tv6E2m4bEuYcj0esdyuKrFP6Go0ms4gqqt67NqguRnK1Q2LUDc8+fu5Iu3ByMS9gWI+Au/ibEXR4pIb9paaOBkKumEdRjcO2gJ5F0XZeZVPpE1ZZVznJimT4jrdDt1zulwlaU6la0E3GJ6Tl94ewVGEzgJu8JN2TqaLDbX1Iw5eIPH7Phgoq0YO3tdtcwOo4vBgvuJ/0VKih8zvv4ua/O4LC6LL038kOx7Fc+v6h1E2U1hQ==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 07 Jun 2021 11:02:18 +0000
  • Ironport-hdrordr: A9a23:MlZoKq19NbtAmhUpHt2A7QqjBbVyeYIsimQD101hICG9Lfb3qy n+ppsmPEHP5Ar5OEtBpTiBUJPwJk80hqQFn7X5Wo3SIzUO2VHYUL2KiLGC/9SOIVyEygcw79 YYT0E6MqyMMbEYt7eJ3ODbKadZ/DDvysnB7o2yvhQdL3AfV0gj1XYeNu/yKDwEeOAsP+tdKH Pz3Lsim9PtQwVsUiztbUN1L9Qr6ue7264PDnU9dlAawTjLqQntxK/xEhCe0BtbeShI260e/W /MlBG8zrm/stmgoyWslFP73tBzop/M29FDDMuDhow+MTP3kDulY4xnRvmroC01muey81wn+e O84yvIB/4Drk85Q1vF5ScEg2LboXETAj7ZuB6laELY0I7ErGlQMbsGuWoxGSGpnnbJv7lHoe h2NiyixsNq5Cj77VLADu7zJlpXf3qP0A0feNEo/jViuKslGfJsRN8kjQ9o+KlpJlOz1GlxKp geMCib3ocPTW+n
  • Ironport-sdr: 7hCIVds1qMwOfdG7i2WITS8Ym/W2KT8XEYRKKHSQfqO/g0N6ohcewtw+sn9Sq6V3loMqmvhd0K bU6x3Sy1DLvCH/S0KiBWoH2ZSKPVpLKInVoNIez8rPsSPdIpC71V66VqvhjqeptIFhwwX3+a+A AXpwJKcOJUi3J3rnJiI+IHwsJRTVQecCr1wFE4o283nERTBqXqX4KkkPNHHNajsZ+rvOIsslGb 1HtuH27to1WB/S26BFk41Uoy97WThx8kmb/AbVXeOpcALbmsImRm9Q4ZeicAziUof/t4QntDcW Gy4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07/06/2021 10:04, Juergen Gross wrote:
> After 32-bit PV-guests have been security de-supported when not running
> under PV-shim, the hypervisor will no longer be configured to support
> those domains per default when not being built as PV-shim.
>
> Unfortunately libxenguest will fail saving or restoring a PV domain
> due to this restriction, as it is trying to get the compat MFN list
> even for 64 bit guests.
>
> Fix that by obtaining the compat MFN list only for 32-bit PV guests.
>
> Fixes: 1a0f2fe2297d122a08fe ("SUPPORT.md: Un-shimmed 32-bit PV guests are no 
> longer supported")
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
>  tools/libs/guest/xg_sr_common_x86_pv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/libs/guest/xg_sr_common_x86_pv.c 
> b/tools/libs/guest/xg_sr_common_x86_pv.c
> index cd33406aab..ad20461e2e 100644
> --- a/tools/libs/guest/xg_sr_common_x86_pv.c
> +++ b/tools/libs/guest/xg_sr_common_x86_pv.c
> @@ -154,6 +154,7 @@ int x86_pv_map_m2p(struct xc_sr_context *ctx)
>      ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
>  #else
>      /* 64 bit toolstacks need to ask Xen specially for it */
> +    if ( ctx->x86.pv.levels == 3 )
>      {
>          struct xen_machphys_mfn_list xmml = {
>              .max_extents = 1,

This wants to encompass the whole ifdef block, to avoid having differing
behaviour between compile widths.

Also the comment next to compat_m2p_mfn0 wants adjusting to say "only
set for 32bit PV guests".

~Andrew



 


Rackspace

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