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

[PATCH v1] nestedsvm: Fix multi-byte IO port intercept check


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Thu, 10 Sep 2026 17:39:55 +0100
  • 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=EN+seTtA71auXJ8SVZ2qyGkvZ0DPlUOwnVfxlApHbf0=; b=IqXURYwR2WyxWtQKZQOZy13lKDYPNeZV0ZbfibmfJtPZwl7jQZsZwK8RFbNAX3SdUqEuFu0owNBEgPVSgMF38XPrvdvKTltH33tOdQ2MPWL/3qaOJLo2LUnaDgRmKV/dXFpW4oal9TMoKuGY4qpcSYLEYTTvD+YD9DZzFeHGfXmp8yJ2xyUQ0Pu3NptCsYAr+Y64tcdm7WyMXBZpr5OmXoRNdcBos79O4Ifs8FrzviU/NuBlvrYcmiXxyErrTtk3e3vIWoKOEBojkNcL2WQ9fLP/gkl4gbS4takn9oM7tAackZ2YsAUdrTdWT/nh4zaj/Jb050+YkCJLrwfIrUHvIQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W3aes8S04P1I6EKgXB/du7fQHg2nOCfPrtdlVWHmLysZgdG0oOPc7Oyd8+vh6yhQIo9Al+oKEeTusnQnk5XYBMw6aHLfR1lQN9n+AFZLv9r+2WKyovgcK7Hs9pQiDxnvO45YfusKlBHz9SLdqirrCOJAiA4pTrnjwJOLqoJuqO9BOs1/1F1YJccvh0kHtgIZCodILqkGvt/W2SHOg2R7ZqtbxTGynl/aixn0z3n6O45EsFr1fcYnMZGLel63VlmpwCuKBBSESeE5+Pza9gQv1Js4g5ea9MzOs6lEkzwxpRDMLDqhPxC6c7lP3XqqXV3hS4c5Kum66GsJcuHOVPBboA==
  • 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 <ross.lagerwall@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Thu, 10 Sep 2026 16:40:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

For multi-byte IO port accesses, the APM says that SVM should intercept
if any of the corresponding permission bits are set. However, the code
has this backwards and only intercepts if all the permission bits are
set.

This affects Hyper-V since it does not generally set all the permission
bits of the multi-byte ports it allows its root partition to access.
This results in an L2 root partition that cannot do PCI config space
accesses and therefore cannot access its NVMe disk to continue booting.

Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 5adb1bd72c4d..249fde43b5be 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -852,7 +852,7 @@ nsvm_vmcb_guest_intercepts_ioio(paddr_t iopm_pa, uint64_t 
exitinfo1)
     for ( io_bitmap = hvm_map_guest_frame_ro(gfn, 0); ; )
     {
         enabled = io_bitmap && test_bit(port, io_bitmap);
-        if ( !enabled || !--size )
+        if ( enabled || !--size )
             break;
         if ( unlikely(++port == 8 * PAGE_SIZE) )
         {
-- 
2.53.0




 


Rackspace

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