From nobody Mon Feb 9 11:06:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629393356; cv=none; d=zohomail.com; s=zohoarc; b=m04H6NWT7uLrg/c+QAU0emO/p2eBFNWOeH5d+hH/7Pd9eRTzu0UbfaiJ82vQoX1Msh15DGG1bvqPh8YuSITE64E2lzjML8O8SXVOX0V5I2iQpZhpWeNSFlN4xukQuWcgCnj86gsKnRyt76gug3EpN02Z+izlRU82XB7lTCnUpkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629393356; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=iFdJgmZSFDi0T3tz5j4VdZ4mFoLbPu805prh7+ofjFQ=; b=XY36Qk+hwAJU+MW/QowSr2wDuLADc2pFLNOcZIV6gQUEcbmU5XJihWfOefB0pmuARap6rGiSg69mWkziKceCCPljk33jiVV+ioTLNNyliFs4yD0PfmNPmpSuzci4ThL3jhtGrapl5jXavlvv6AQifzvB+dpB80l8ZoNkKeqEMT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629393356896656.0483256507572; Thu, 19 Aug 2021 10:15:56 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-LC_6y8LvNRyvBbIa2xu7mA-1; Thu, 19 Aug 2021 13:15:54 -0400 Received: by mail-wr1-f72.google.com with SMTP id l1-20020adff481000000b00156e670a09dso1935282wro.1 for ; Thu, 19 Aug 2021 10:15:54 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id p8sm7846501wme.22.2021.08.19.10.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 10:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629393355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iFdJgmZSFDi0T3tz5j4VdZ4mFoLbPu805prh7+ofjFQ=; b=hgWRjEtEiLh2jSJTivTDKIss8zKPNaIxQBStao4198B2T2kC4dlbohPTeKsiwnDtHSsruB eaG7yIiYHBH+hrJNeUQTRb0BF5PpDavvTD8FvvH+iOtYRsPI8bGyIqL28/YC+24xRCgfOY cyRmCHLIPKryC8llvmRZuFHRpMeScKE= X-MC-Unique: LC_6y8LvNRyvBbIa2xu7mA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iFdJgmZSFDi0T3tz5j4VdZ4mFoLbPu805prh7+ofjFQ=; b=uCqhrbVpx359B7F+wh3F3kEV3wMnNeSvZ1kqicwvpL/DQkiazPL/kqhwxx+F+wNed6 p7KRqbnacOVnKDE+IawCI6RZSqKC7bnXGDxpAqC4Us7JuYa8VHVlRbcP2W0vAE9MUVO7 8vlAKhjrP0K91AKo9eq6Emp7rROHby+jmNSvDNSID31wxT7moOuW2nyNkueBarkqaYoR F0SPyWkCgtVf20VQzeyD8tEBlYnhPF4mGS/t7v8N5rJMFHva71VmfU9DkB+omD9cQpv/ KPSuXtZP+i3PNO7VDEvSslHmoOpK7bqE8TosLW0VgRBzBvQAcx+yMehowwMdhI8VTb5h tR+A== X-Gm-Message-State: AOAM530Q55d2Bu+8X1NCBsredBX4lpO8GINt9Gy2KLnXABCLp393bs3c omYwDgUSN/UhO0sENsxel2GA53h71LQAgDROuf+/cTlLHKZLWAB9RWmjM+/E8KOeDOH1psiyDK0 7pVavmulWWAYHTA== X-Received: by 2002:a5d:5228:: with SMTP id i8mr5170458wra.391.1629393353675; Thu, 19 Aug 2021 10:15:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw21UpmnBmnx5p6noRHd2CHy1aSY69OdHAmHOK2vmdBbgqOMTNSGSOdNTXiMW7C3A5HvLZ7eA== X-Received: by 2002:a5d:5228:: with SMTP id i8mr5170452wra.391.1629393353542; Thu, 19 Aug 2021 10:15:53 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Eduardo Habkost , Richard Henderson , Marcel Apfelbaum , Gerd Hoffmann , Paolo Bonzini , Sergio Lopez , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/3] hw/pci: Introduce pci_dma_memory_region() helper Date: Thu, 19 Aug 2021 19:15:45 +0200 Message-Id: <20210819171547.2879725-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210819171547.2879725-1-philmd@redhat.com> References: <20210819171547.2879725-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629393529773100003 pci_get_address_space() returns an AddressSpace. In some cases we want a MemoryRegion. Add the pci_dma_memory_region() equivalent helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/pci/pci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index d0f4266e372..5860f42e400 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -786,6 +786,11 @@ static inline AddressSpace *pci_get_address_space(PCID= evice *dev) return &dev->bus_master_as; } =20 +static inline MemoryRegion *pci_dma_memory_region(PCIDevice *dev) +{ + return &dev->bus_master_container_region; +} + /** * pci_dma_rw: Read from or write to an address space from PCI device. * --=20 2.31.1