From nobody Sat Oct 4 23:47:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1759170978; cv=none; d=zohomail.com; s=zohoarc; b=mUMy9HS6lpXr8QMGgGYJOhSjNH8iOTsa4nWG9ZSQn2o7QaK1W5yvBN3e13jNvBIj4yw8bIHovXN2n80KIW0f9VNvIYYB7h6Qq78MS5s8uYghj/HrCSUfO6joHZDzSldsuYz86N/sUElvhCnVtyci36vUcf1GsyA16p2EtwNtQxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759170978; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MBpejQiq0e/vydo49FSQoIaJ0P/BjZpeA7dR40L/9NI=; b=NgS2EiswAbid4N58adL98imxKV87Bjhegq0oCUuYwDqL0cJxW6fuZQgXISRLbut8622C+6euKNKNo04EEcEv9kakCWDaNfusS+F0ZCG2UJNrg+fgC7PqXT2MoSS/N4cULzp0sWtv/bj3Hxokbr49la6KXSqb5jX1O5jXFTOKaKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1759170978306880.6782475171944; Mon, 29 Sep 2025 11:36:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1133176.1471360 (Exim 4.92) (envelope-from ) id 1v3IjE-00055S-Qq; Mon, 29 Sep 2025 18:36:04 +0000 Received: by outflank-mailman (output) from mailman id 1133176.1471360; Mon, 29 Sep 2025 18:36:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3IjE-00054c-O0; Mon, 29 Sep 2025 18:36:04 +0000 Received: by outflank-mailman (input) for mailman id 1133176; Mon, 29 Sep 2025 18:36:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3IhU-0000iD-Ck for xen-devel@lists.xenproject.org; Mon, 29 Sep 2025 18:34:16 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e62002a6-9d62-11f0-9809-7dc792cee155; Mon, 29 Sep 2025 20:34:14 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3ee1381b835so4178802f8f.1 for ; Mon, 29 Sep 2025 11:34:14 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e2a7c8531sm237281965e9.0.2025.09.29.11.34.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Sep 2025 11:34:13 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e62002a6-9d62-11f0-9809-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1759170854; x=1759775654; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MBpejQiq0e/vydo49FSQoIaJ0P/BjZpeA7dR40L/9NI=; b=BliYw8ObxLx0c2q/rLWRW/7rj/rwztZlcklyFoN5poh9KkHSmpLhlQtuvdVdg/9Fru wdXAAKD5LEr84Y+U8jlGNoPUaSVesTvfgB2mED8CpmHX7zMl6tIjEUPDmEc0wwbtiung lNts7nCgL/PNjEnMygd/6hvlHimwsX+5/6XepUIo0JWGDj0kDXGRAEzDPf5sPU9weGXk JfYbO4mcuDoIYQLPIPSjpwaf/amNKGwmpWwl2352veYY01CPevanVjYdrDAoEVaC294K DJwZeymUgIIIyAjOfN+ChrCCYy8vKfp30BC8wHTGGIRwAgQklQXOoNbWW7jlogoo8+a8 Bjgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759170854; x=1759775654; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MBpejQiq0e/vydo49FSQoIaJ0P/BjZpeA7dR40L/9NI=; b=nLlghcP4GXq9wyDS5oNMpkfMJSteDpBuxPbWhoq+ORGfOzziVfwR/wc9wvZRKiSGgF 4QWocVs431IWYSqlfj6QcwDbXeeZvU2vTequuTsVsGbJ24nRa0QCOuV+IIxt72Bnf6px dj4EMaCQTSlV7oCRMINOALso1QM+duUAlJXcUqtc0n4S6MA2ef5U48WOgS8Fzo356Vbe PQktNcpIjqI9izHTu6gct9i7fyEOIV1EtcFVRTaxmg1IcGqN5mTKpMjey4H/C28ojr6D FaerTMt2izDWvLKUEYWzbioFMCCnoYAPlxvoXSToYAQFNDKENdtTgnferfmi3esaA9eZ JSjw== X-Forwarded-Encrypted: i=1; AJvYcCXxkQrXI9fpn+CdzqVDCQq526Ut+lLBpGFS1CQ6fQ+b/WV1p4DEElbWHSmFUob+Hw8JmoX4sVUMzGM=@lists.xenproject.org X-Gm-Message-State: AOJu0YzJqDiwGrPPWSxn2Gb0rGP5ACbbWOG6qo9LAA23fMueOi3Fe8WG 6laUtis7z7EYZQ0QnR+GXMCnoLezrwJ4pg/2fTLU551A0V/IN7ikxbxZ3dVhcg+BpUQ= X-Gm-Gg: ASbGnctv7vpJZs0R78gVEvqSno2uKxMA9TqCsa5S6Gs38ifR04Rln2Wcwl4mUOTXjn9 QWjAYaquJHbG6vMZxF0XCshCZbUXsc1E1eMOz/AxtIWQFrszk9nVEO4WAKMdzm0qTYTzvN3DQIS GQQmzMDDi1qsrJnJNWOVIe3e1IAJAluPdJA2f/lYtEZKVqwywIr9wDch+/0oT15VfvzGBymGwzz JZmokCGXtY2CGbv41KccjnQd+1PK7Jb8i4+p89h72TeI7UoB5tFN1PjUrAoL/MwISxBLpgLgljd 8gThzzmVy2PhBggBr6jb/C1F/K40Dj60Alke4zqwBkGBHpJieuLI/9jxEujF00EVwMsIicpvPEu CwABIRNde3nOzyhxno0hGVtGME+Duw/yZlBSi/BQz3VWNt0LzHL6LjY8Jfeq+GjaS0cS238WSFx Eo/gm7GRE= X-Google-Smtp-Source: AGHT+IGDdDVnNCTQHNmf7VOOiV8zymTG0ZaCom+HQXr9Sc1CkJ/8s/f399s7GfQrqulF9pKPADkmMg== X-Received: by 2002:a05:6000:22c5:b0:3ec:d78d:8fde with SMTP id ffacd0b85a97d-40e4ce4bademr17302303f8f.44.1759170853668; Mon, 29 Sep 2025 11:34:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Cc: Stefano Stabellini , Richard Henderson , Stefano Garzarella , Reinoud Zandijk , David Hildenbrand , Paolo Bonzini , Ilya Leoshkevich , Sunil Muthuswamy , "Michael S. Tsirkin" , David Woodhouse , kvm@vger.kernel.org, Eric Farman , Zhao Liu , xen-devel@lists.xenproject.org, Paul Durrant , Christian Borntraeger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Halil Pasic , Jason Herne , Marcelo Tosatti , Thomas Huth , Anthony PERARD , qemu-s390x@nongnu.org, "Edgar E. Iglesias" , Peter Xu , Matthew Rosato Subject: [PATCH 14/15] hw/virtio/vhost: Replace legacy cpu_physical_memory_*map() calls Date: Mon, 29 Sep 2025 20:32:53 +0200 Message-ID: <20250929183254.85478-15-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250929183254.85478-1-philmd@linaro.org> References: <20250929183254.85478-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1759170979425116600 Use VirtIODevice::dma_as address space to convert the legacy cpu_physical_memory_[un]map() calls to address_space_[un]map(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/vhost.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 6557c58d12a..890d2bac585 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -27,6 +27,7 @@ #include "migration/blocker.h" #include "migration/qemu-file-types.h" #include "system/dma.h" +#include "system/memory.h" #include "trace.h" =20 /* enabled until disconnected backend stabilizes */ @@ -455,7 +456,8 @@ static void *vhost_memory_map(struct vhost_dev *dev, hw= addr addr, hwaddr *plen, bool is_write) { if (!vhost_dev_has_iommu(dev)) { - return cpu_physical_memory_map(addr, plen, is_write); + return address_space_map(vdev->dma_as, addr, plen, is_write, + MEMTXATTRS_UNSPECIFIED); } else { return (void *)(uintptr_t)addr; } @@ -466,7 +468,7 @@ static void vhost_memory_unmap(struct vhost_dev *dev, v= oid *buffer, hwaddr access_len) { if (!vhost_dev_has_iommu(dev)) { - cpu_physical_memory_unmap(buffer, len, is_write, access_len); + address_space_unmap(vdev->dma_as, buffer, len, is_write, access_le= n); } } =20 --=20 2.51.0