All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] nestedsvm: Fix multi-byte IO port intercept check
@ 2026-09-10 16:39 Ross Lagerwall
  2026-09-11 10:06 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Ross Lagerwall @ 2026-09-10 16:39 UTC (permalink / raw)
  To: xen-devel
  Cc: Ross Lagerwall, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Jason Andryuk, Teddy Astie

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@citrix.com>
---
 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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-11 11:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 16:39 [PATCH v1] nestedsvm: Fix multi-byte IO port intercept check Ross Lagerwall
2026-09-11 10:06 ` Andrew Cooper
2026-09-11 11:13   ` Ross Lagerwall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.