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

[PATCH V1 0/8] x86/nestedvmx: Fix nested VMX bugs


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: chunjie.zhu@xxxxxxxxxx
  • Date: Mon, 26 Oct 2026 15:17:46 +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=MZ4b6/zSvCbyu9Tayf7mShTmi92eHn/QkrGHSZfCc2U=; b=pKowiQFYZYbwm7WD+Jra9eJCdRejY28qJ4AjhmyVvrNvX+G2JFgOsLQZe7EX4v4qFe5LKLHcEY0/fVDwfR0FD8PfzjkU4cqc05d1An6PbXcCepTAtR8Uhkhf9uoFB4TEFiUkinNfFDgZKaEClzd+f+PVFg8R2b0Q+ufLmr8KL4PAUfvmvIfh8UTajP+8sT4vPrhrX5ASc95NqcMLOnXfAfYj9+0b3aYCO88iHipeoqPLyH5vspc48QleIB1rCHG1QDQwoXL87dfa2ay8QbOj3yDeTWmlT/T+8WX9SNyvB35zuJpdwmtb1WMo14Ch5WrX8SK0dWYDcu2cthl5awdLEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uAuW0GF914EbcsHOHm6rlG78zhlxOaEd9hTww3QEOWCJmFvL3gvTmkZ1gZd7vbvU1Qic7V78LY+4dNnGn1O6HuzYwNxDu6LgqXQOEHaK8PtNsbZpCWPjulf1ikUtzi56D26Co8BudLRVnTP5ON++KhqdiDGzflr1qh5UV2pI7Ff81bbvP1q4DUNCC9vYj1/vEopQ0lY4ZM9eVXzQN/Y7wc7U5tLwF27Wna0bZU5zoch1szJ4kTxaBd9fJaQcoyADCsmm58/4yrqzvvMUxJZtM7iMdR0vK5O7qfCkae1e6Shfhd1FVhNkuYHpdex0vIS5CVmW3y2wyy3oS2FddbDfeQ==
  • 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, Chunjie Zhu <chunjie.zhu@xxxxxxxxxx>
  • Delivery-date: Mon, 26 Oct 2026 07:18:30 +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: implement the missing nhvm_hap_walk_L1_p2m2 hook on VMX; the
   NULL hook causes a #UD and host panic when L0 emulates an L2 access.
 - Patch 3: emulate L2 accesses that hit the APIC-access dummy page
   against L1's vLAPIC instead of mapping the page directly.
 - Patch 4: reflect EPT holes hit during L2 emulation to L1 as EPT
   violations rather than injecting a bogus #PF into L2.
 - Patch 5: 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 6: invalidate EPT caches after flushing a nested p2m, to avoid
   L2 walking stale paging-structure caches into freed pages.
 - Patch 7: retry a nested page fault if the np2m changes while L1/L0
   p2m are being walked without the np2m lock held.
 - Patch 8: fix several nested VPID problems.

Chunjie Zhu (8):
  x86/nestedvmx: Preserve hardware access bits in reflected EPT
    violations
  x86/nestedvmx: Implement nhvm_hap_walk_L1_p2m2
  x86/nestedvmx: Emulate L2 accesses to L1's LAPIC page
  x86/nestedvmx: Reflect EPT holes hit during L2 emulation to L1
  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              |   5 +-
 xen/arch/x86/hvm/vmx/vvmx.c             | 110 ++++++++++++++++++++++--
 xen/arch/x86/include/asm/hvm/vmx/vvmx.h |  11 ++-
 xen/arch/x86/mm/hap/nested_ept.c        |  19 ++--
 xen/arch/x86/mm/hap/nested_hap.c        |  52 ++++++++++-
 xen/arch/x86/mm/p2m.c                   |  17 +++-
 7 files changed, 200 insertions(+), 20 deletions(-)

-- 
2.34.1




 


Rackspace

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