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

Re: [PATCH] nestedsvm: Ignore attempts to clear EFER.SVME from L2


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Wed, 18 Nov 2026 11:33:47 +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=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=xSUAzgLSzifco2aLwCNpcKKxW9Zn1+5wKPWDUhL9JRo=; b=FoIPOPWr2jtZjWeEQM4eAZ7R81bvHyrfPc1hs/e4lT0yq/ziU3qCMsAHjzXEmyfLaHBMy8UhyrGxtnNLy+qhPbxXAQAduC/aK8H2d+VnZz1Cpq0NASNmrk4SQTeq8U/R0M7E4qAC5SJsTyfSyBz1i/ZjC5ADTIL4vqobgLir/rPtv85q3bvHBSeMJdJUiW6KJ4HUWqSYM9KdhUOxxEiB8VFLZetONF3jbdY6/U9MleVPaoA7RdH1KoT3sPC3hDSKJpV32U4Dh15NeKLv418Wd3fcWjwSiaNEBZ39W9l0Qus5HZlkVo/SGHIQcLJtQPtGV9OoCBvI1tW77ZZPKbkUJw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ICtDAQOsmy7v2tRoBgI6rrk0oh6bdthjiaDGblT+n61lctGRUmn+RIIQ6Qj90usBSnQpk8eyBQoVbdL19b5QDi975yD0kc7Y6t3T89R9ZK3dwuQI9OywDiK+B6cy2yv5tTRxUAeS4384z4oyfSgwSWpbxVpa2wvwXwVqhZIwfj903OEaGd6eS4+b3ehKC9PwIzA3MaTdMxTZZhbJfkNijoNPBVtFKraRw5MbElMRjoYnscpCl23tH8D7ZREWsLgylbTAaTz54doBj6H+YIcxvPSeNSqZXSW1d8rluW8YSV4RfsBZwAyKWcEKCwMHBzQaLd9EEG4O5BrGoJ5lyFMm4A==
  • 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: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 Nov 2026 11:34:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/16/26 11:34 AM, Jan Beulich wrote:
On 13.11.2026 17:02, Ross Lagerwall wrote:
The APM leaves it undefined what happens when the VMM doesn't intercept
writes to EFER and EFER.SVME is cleared. The current implementation in
Xen resets the nested state without doing a VMEXIT which is unexpected
and may potentially hit a BUG or assertion failure.

Therefore, implement the same behaviour as the APM documents for SEV-ES
guests; ignore the attempt to clear it.

Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>


Thanks

---

Another option here could be to fail VMRUN if L1 does not intercept
writes to EFER. However, this wouldn't match the behaviour of real
processors and may cause incomplete toy hypervisors to unexpectedly
fail.

+1

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2156,9 +2156,15 @@ int hvm_set_efer(uint64_t value)
         ((value & EFER_SVME) == 0 ) &&
         ((value ^ v->arch.hvm.guest_efer) & EFER_SVME) )

Unrelated to your change, but: What is this? When we have checked that
SVME is clear in value, why would value need XORing with what's currently
in effect to figure whether a 1->0 transition is occurring?


I agree that it is unnecessary. Looks like it has been that way since the code
was added.

Ross



 


Rackspace

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