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

Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt


  • To: teddy.astie@xxxxxxxxxx
  • From: Stephen Cheng <stephen.cheng@xxxxxxxxxx>
  • Date: Tue, 28 Jul 2026 15:16:41 +0800
  • 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=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rgfj3omKwaaiAUxGLqJajfCkz5k3NrUUzXsfzvFpM9M=; b=sdz1FN2MG+Fz664k8rb5FZiwZ3ulh8Y+7ytCyuSLsKqkslrG1GO/3lAPaJjokkPoCduVA2FXHef4JRQgrMm7ik4HAEScO4nJpHVXgoc4mDQz68yt53rmiRg9F1gaxliYmNCCquUWf3NeJY2Cj9xKDLyO7hKk/Qpk2mVZFxmCgG6yKFFq++xI3V8MDi8jeAzEW6RcXNu+xkTHLpULzYskGIoZxmS791oX6/5G0cG18tiLNsirYoLvyqWyQKW9cjWXj7YJXHnOcezJOHkj4v8OPtNhtBEbVcHlPpNagI0XP2ndapA/T6ZMvJmRU7zqQ1wCzbX7Ooo/NZ0iUjB4ho9sfA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=otoBDz4JbFB2f8jWf4rMJR68u0f18i6Z2nMRKyd916LZZ7mGzqvR1D4FjvnTk9PXErJJo53TdAkcXcJrAv5a2h5fVA6hMbu7wzeKtygOGsemM7X3ZF+Z3VGEU10K02uJaoXYtJvIMVqJt/xsitQ5MgkGuZvK9aaW5AdhbDD7EQXifad3DdWNYA0XI2NPX5AinXvfZlONAiVELPXa/lGHDppfeBG/GlRB5ZPxnxthtd2Gtunu1fal+PljX3svLcFdzkY+AYRAB8FNSCHaC/ZBQKkeFRdMnp23D8TxCg42vNIFFfb+XSWeYr790Culldc70XlqYtBtyD5VphGmlU8uFQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: ross.lagerwall@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jason.andryuk@xxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger@xxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 28 Jul 2026 07:16:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/07/2026 11:48, Teddy Astie wrote:
> I'm not convinced making "VMSAVEvirt" mandatory is a good idea, in
> particular, there is a errata (1454 - Processor May Log Unexpected LS
> MCE Error When Executing Virtualized VMLOAD or Virtualized VMSAVE) on
> Family 19h regarding this feature.

Thank you, I hadn't looked at 1454.  Quoting it here for anyone else
following along:

  Description
  Under a highly specific and detailed set of internal timing
  conditions, when a virtualized VMLOAD or virtualized VMSAVE
  instruction is executed the processor may log an uncorrectable LS
  MCE error of the type "HWA" with:
   MCA::LS::MCA_STATUS_LS[ErrorCodeExt] = 0x16 and
   MCA::LS::MCA_SYND_LS[ErrorInformation] = 0x00094.

  Potential Effect on System
  System may log a fatal error and reset.

  Suggested Workaround
  System software may contain the workaround for this erratum.

  Fix Planned
  No fix planned

I don't think this patch changes the exposure, though.  A part affected
by 1454 has the feature by definition, and on such a part staging
already enables it for every nested guest -- see the existing
cpu_has_svm_vloadsave path in svm_nested_features_on_efer_update().
What this patch removes is the emulation fallback used on hosts which
lack the feature, and those hosts cannot hit 1454 in the first place.
The set of machines exposed to the erratum is therefore the same before
and after.

That doesn't make 1454 a non-issue -- "may log a fatal error and reset"
with "no fix planned" is worth understanding.  But it's an existing
question about Xen's use of virtual VMLOAD/VMSAVE rather than something
this patch introduces, and answering it means deliberately not enabling
a feature Xen enables today.  I'd rather do that knowingly, once we
know what the workaround is: "system software may contain the
workaround" doesn't say whether that means firmware, microcode or the
hypervisor.

> Had you considered improving the current implementation of virtualized
> VMLOAD/VMSAVE ? AIUI, the way Xen currently implements this instruction
> (by mapping the L1 VMCB then calling vmload/vmsave on it) is more of a
> implementation choice than a requirement.
>
> A better (at least, likely safer) way to emulate such instructions (and
> not relying on VMSAVEvirt) would be to copy parts of L1 VMCB from/to L0
> VMCB and let Xen perform the appropriate vmload/vmsave on its own VMCBs
> as usual.

You're right that it's an implementation choice rather than a hardware
requirement.  On whether it's worth building, I'll defer to Ross's
reply: given how limited our resources for nested virt are, and that
AMD nested virt doesn't work today, dropping support for older parts
isn't a functional regression.

Thanks for the review and the feedback.

Stephen



 


Rackspace

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