File 68a2e7c8-x86-HVM-ioreq-inverted-condition.patch of Package xen
# Commit 282ed258a59195698a81ab4408a17336eb6ea7ed
# Date 2025-08-18 10:43:52 +0200
# Author Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
# Committer Jan Beulich <jbeulich@suse.com>
x86/hvm/ioreq: Fix condition in hvm_alloc_legacy_ioreq_gfn()
Fix the incorrect condition that causes hvm_alloc_legacy_ioreq_gfn()
to return INVALID_GFN even if the HVM param was installed properly by
the toolstack.
Fixes: 3486f398a3dd (' x86/hvm/ioreq: allow ioreq servers to use HVM_PARAM_[BUF]IOREQ_PFN')
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -63,7 +63,7 @@ static gfn_t hvm_alloc_legacy_ioreq_gfn(
for ( i = HVM_PARAM_IOREQ_PFN; i <= HVM_PARAM_BUFIOREQ_PFN; i++ )
{
- if ( !test_and_clear_bit(i, &d->arch.hvm.ioreq_gfn.legacy_mask) )
+ if ( test_and_clear_bit(i, &d->arch.hvm.ioreq_gfn.legacy_mask) )
return _gfn(d->arch.hvm.params[i]);
}