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

[PATCH v2 0/7] x86/nestedvmx: Fix nested VMX bugs


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: chunjie.zhu@xxxxxxxxxx
  • Date: Thu, 29 Oct 2026 14:26:52 +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=+CSoyYs+mwsdjQFZS5TYqlnxP6kA83rRcuAJN8c2R+0=; b=TFoue+//Ij56+valcIS10vujRWCrtxy9jpF5Yv4Q/dIsHK3JE0LXvkrCgZHsq+69uGSn7dhRfNox1TnKDcQTFGSKJuRF98hB1fm3UthtqG+TnbKXsvGp1NYv9A31YPGeKSj32y7vSjMU1QXUk3VuQgIlGMdsj4Hmz7GAZco3h/FuWA++bBS9wvRdiMUYV6ZoeATEvOQ/8Pe7LR4G+W5UH+FYZuk4wW8LiiJ+npG8cMjI3F14ziQToFfLOIw0esfrKtYlUJ3IquVE/EwfqThLBXbmHPKnYJrEFWGr2yFEfcWRsEwlIvUpF/IpnjApu9a6eqkbJpozLGuzhwkiHfkcLA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LY93Dc2he36qzBE6ehMri22kyi1HoC6E9MDwSfw4+rV7D4OV/eZx4X2cHomBqZQLCXBEv1rzLArWVdZhAoNmm2UINPXtrb+WjkNu58BSm8W3t7OkTrD7hOEbtNmDMiGYxtczcpLdlZs7o8PP4nVHT4VnfbPr9aRQkH0ABtKNXE4ZnDlIBsvr6IgPMIleyE+YAz+OR89Q7R994Sr+8OnJ1x8tCxbgLIRxzJXyj+w2k3qVauHjNBH/SSl/avmiD1tY/tP+6NDv1jiQ+KRcwnvir6z9tesue70PfDc1KyQQjYKJHYqdXrP/fPdYYf6iih4opu/FqLM4Oorka2nWsmx9Vg==
  • 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.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, michal.orzel@xxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, roger@xxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, dpsmith@xxxxxxxxxxxxxxxxxxxx, Stephen.Cheng@xxxxxxxxxx, Chunjie Zhu <chunjie.zhu@xxxxxxxxxx>
  • Delivery-date: Thu, 29 Oct 2026 06:27:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Chunjie Zhu <chunjie.zhu@xxxxxxxxxx>

This series fixes several bugs found while running nested VMX guests
(L1 Xen running an L2 guest) on top of Xen:

 - Patch 1: stop leaking L0's widened access bits into the EPT violation
   exit qualification reflected to L1.
 - Patch 2: emulate L2 accesses that hit the APIC-access dummy page
   against L1's vLAPIC instead of mapping the page directly.
 - Patch 3: reflect EPT holes hit during L2 emulation to L1 as EPT
   violations rather than injecting a bogus #PF into L2.
 - Patch 4: load L2's EFER on VM entry and restore L1's on VM exit, so
   L2 neither sees L0's LME nor fails VM entry with invalid guest state.
 - Patch 5: invalidate EPT caches after flushing a nested p2m, to avoid
   L2 walking stale paging-structure caches into freed pages.
 - Patch 6: retry a nested page fault if the np2m changes while L1/L0
   p2m are being walked without the np2m lock held.
 - Patch 7: fix several nested VPID problems.

Changes in v2:
 - Drop V1 patch 2 (Implement nhvm_hap_walk_L1_p2m2), a temporary change.
 - Rebased onto current master.

Chunjie Zhu (7):
  x86/nestedvmx: Preserve hardware access bits in reflected EPT
    violations
  x86/nestedvmx: Emulate L2 accesses to L1's LAPIC page
  x86/nestedvmx: Reflect EPT holes hit during L2 emulation
  x86/nestedvmx: Load L2's EFER on VM entry and restore L1's on VM exit
  x86/p2m: invalidate EPT caches after flushing a nested p2m
  x86/nestedhap: Retry nested page fault if the np2m changes during walk
  x86/vmx: Fix nested VPID handling

 xen/arch/x86/hvm/hvm.c                  |  6 +++
 xen/arch/x86/hvm/vmx/vmx.c              |  4 +-
 xen/arch/x86/hvm/vmx/vvmx.c             | 71 ++++++++++++++++++++++---
 xen/arch/x86/include/asm/hvm/vmx/vvmx.h |  4 ++
 xen/arch/x86/mm/hap/nested_ept.c        |  9 +++-
 xen/arch/x86/mm/hap/nested_hap.c        | 52 +++++++++++++++++-
 xen/arch/x86/mm/p2m.c                   | 19 ++++++-
 7 files changed, 152 insertions(+), 13 deletions(-)

-- 
2.34.1




 


Rackspace

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