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

[PATCH] x86/hvm/ioreq: Fix condition in hvm_alloc_legacy_ioreq_gfn()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Fri, 15 Aug 2025 10:19:47 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=7xewDOK4jXNrNHpQ075L7aH9M6LJMV17EtRmkCrE2YA=; b=JUtych8JE/iYHI/7n2jIpeuvH3+MbaATfqZluDbjQrPJoFUs7g+KTNuSoFgjlpeqRNs263kf1ACHZfZfdAet1Ewdcw3cnaoxBOhGDz+UfRfMAOWh6Q7iPNTHVJ0nS14+z2b6rZpuZ87hqsDSacpA0d+xhhb6+66Z5YWPAyom1N3y+kCESbL34GP16A/iq/agNfiUIOpUfh66gFn8da/lPVyv8sucVzOzzUp2p07pc6MPqLVCHZyBHWPIdpxsz5vSlCrgtAQKYDsB3O51JqLC8xV5b9NaVIe/rPZOi19ihhrtJ+yFsKatp+6ry+5kNs/nowdz86gNFtEgut7+EFuKlg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o2ii5JCgBUw+PIPn7A87xRzgqgAflzzzzxtiko2VZqgI4F1gyIGAzvGLExd/8K+8xIIDDqNs5xYT8iALGHnfQm6Pz0jDIZlAwx0WYe93cslvtHXmpZr9Dv359V77VnbFI9/CSqz/pQD7DREjaWTt+s1B9Spp0Xb2UjOXiL80vNGNr9Hx7/1Cm1riw2W1Q0yZel1AjcpuDl6EHGQsG8Uiuo1pJTBjPI/g4tazfWJT11fEWzYGHj5x6a1XTjAJoVz0fr9lJ3HJcNtB83M2o0409kJ70BguQnbl5ppsWB4JduoluMzPYTf4oCcbxkX9K+TGAaiINbp9qz9Eqh40MCHjlg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 15 Aug 2025 10:19:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcDc4g80PGAKCUYEOWQIOrbWg9cg==
  • Thread-topic: [PATCH] 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@xxxxxxxx>
---
When playing with the XEN_DMOP_get_ioreq_server_info sub-op, I noticed weird
behavior where the hypercall returned success only the second time.
---
---
 xen/arch/x86/hvm/ioreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index ec709e5f47..4d30f2d730 100644
--- 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(struct ioreq_server 
*s)
 
     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]);
     }
 
-- 
2.34.1



 


Rackspace

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