[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>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Jun 2021 11:12:09 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=nd7r8vCjVBhTQMZz/7WnPMW+Svvzm6ytLVcpqPiKHmY=; b=REbIull5AI/cEMc74PPbwXBUff/urlWsEgH5F1PeLzf3+3C4WMdSyBvP/7lrBJdKDA1EZYd7HG7nbw4iHkSlkV5Zf2IBP5clmig26Mu07k58BiKJp+IvMKJG2yYfBxUk18FSDeI+Gh1+6nL2FTZLJ5ATIaaNks7/RFHUZFG0E3AeHI2xBIgsYUTsPPg5UjTERO/7wQbB55Oe8SJZxJapRypMzhazMaTMsB5lAQlwsBsXp9ZpwbqfSalSeW9qIxKjOhbBrH7rkMt7Azll4eOKV7KlglFh8gV1+KycKSR6rEdZJhxMHQe2NXAJgqxrAwRsxyVxHBPaoq79X/bH+N3/iw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aaI9vRbrVG5Xb6cXMf+metaT8QomDrDZYPIANDkUTF24FwI0qK3pOcBgr3HULcuAh8LeZ8PpNQbYfvozin0HO9RMrh0yU/zb/IYLvVPBhNjjNoTuixOIuvDeLlDFB/PvZ/HQoXFVsSIkTF+kM0zmCdlACHIheeYbEFAO31gAno5np7VQ5FY5rFHtqTcQZ2pBLyOa/J4jND813sIR73fqh6jgewpg7NtnjjcDhOqJvv4+d0ihgGVhh5pAJqYzawRWerw2Z35OrCPrHucokyS2AHW4D7br6rIncLESDNmSGhZKcuMdfBqiq4YU8nHpLK/AlhqZzVkMpLxm+dgO44lCNw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 07 Jun 2021 09:12:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.06.2021 11: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>

As this will do for the single present consumer of the field
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Nevertheless I wonder ...

> --- 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,

... whether the field wouldn't better get set to an always-invalid
value in all other cases (either by pre-setting or by adding an
"else" here), e.g. ~0.

Jan




 


Rackspace

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