From nobody Fri Dec 19 18:53:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1601573165; cv=none; d=zohomail.com; s=zohoarc; b=hFdB+1d0lmTdqvZh4gfz6CcM+lb0oWXqo/GrEnEafUDbixHkTxcQou7hINNP0CmF9/xJ8kn2Wm4z9cdTo6Tqbo9WQCmIKa6g+TzEdz5XnRpMxr4auZBjH4zjgb97bQ+KhwJM2JGyeuzlmQeocVBatpXghZJE4A6VorByxLAk1uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601573165; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Td0iuQpd/0gjq4nbB5FibsTRyGIsuc4AdlendQEjyys=; b=eEwl5zqjEeW0UQ6BbvAIFVy0vora995VlYT2/c+Bq4omXlzDuF9v3pyKYo6Ykq8zyfO190ijPil+GsXBlDcGVktxpsVxiyRCB5IFwZN2nq0Ia/za1qYjYHPv81JyFC8DXNxb57+XmUCxJILJbrrfGp4eeBImu9IvXxnAogOPRGE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601573165186326.43564691702215; Thu, 1 Oct 2020 10:26:05 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-568-YbSR3hHPPCG_IF-FQOSS6A-1; Thu, 01 Oct 2020 13:26:02 -0400 Received: by mail-wr1-f71.google.com with SMTP id v5so2298675wrs.17 for ; Thu, 01 Oct 2020 10:26:02 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id 63sm10732704wrh.71.2020.10.01.10.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 10:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601573164; 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=Td0iuQpd/0gjq4nbB5FibsTRyGIsuc4AdlendQEjyys=; b=ADqR7LsbKgpqxjBiJwjsLXuU3UOm3hhtlodrMrQJLUOZrzeyVr0DoAVsg0wkP8WSy1kpYl GLHpKczKtiru1HMWQLNz47EjHIgl7kw6ojYZBSOSmy6FETP9jslvL6kg/MqWfWPjibQR3x 0REwJCZhUCva8bhucjscrLRdNCB0vqo= X-MC-Unique: YbSR3hHPPCG_IF-FQOSS6A-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=Td0iuQpd/0gjq4nbB5FibsTRyGIsuc4AdlendQEjyys=; b=hMkFNgzHWyrVCxd13AntzWlty0UKOltj5InHl7UYt5N58oLasziZMBrOiO0Fzlf6Rx YV/tYCoUDkyxI38og4zOyaWUkbmv/ObeBZNakeaXALJpJr7bAKq42wGXhx4TndNKFZBw aHGd5XhvcDhKd5JxCV1RmPMShLr5yU7ga+LtRLokdZi5HGB2lJinY2r8g7vKghkUuZNM tLdHFpofEbgbGH0KfKR6Y7PXN4eUc1X5oU54A6npaXfpjOsB24KEznCqHNMt1aDdzHWe 60p7CHtSuc0yuAqyMxcRaqMP7ag2WuQs3u97ttINUBcgp0e3Cbafp7U73A3XdADZoJ+P t0Jg== X-Gm-Message-State: AOAM530cVBG4WyF3HyNOQ/Uv1LD9udhbgSgQXaDCtAOduDUj9W7UkuFT FqhpYwMG4zoI538Qg1igcTxdh9k8sc/h221clNM+sl3ldXzhyy/DLhXoyKEyInGvR4bKpzUi6+w 1AgR8FIbYP3WYaQ== X-Received: by 2002:a5d:468f:: with SMTP id u15mr10078893wrq.336.1601573161125; Thu, 01 Oct 2020 10:26:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtrJe/UEvJEzIc8E+jwu+aTsJnp16PrGtTb5Rmwt9+xxJDYQBadebLBBdxSGR1JCjVpjzDjQ== X-Received: by 2002:a5d:468f:: with SMTP id u15mr10078878wrq.336.1601573160917; Thu, 01 Oct 2020 10:26:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PATCH RESEND v2 08/16] dma: Let dma_memory_valid() take MemTxAttrs argument Date: Thu, 1 Oct 2020 19:25:11 +0200 Message-Id: <20201001172519.1620782-9-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001172519.1620782-1-philmd@redhat.com> References: <20201001172519.1620782-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) Let devices specify transaction attributes when calling dma_memory_valid(). Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/ppc/spapr_vio.h | 2 +- include/sysemu/dma.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index 356751e2d7..ed28db6604 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -91,7 +91,7 @@ static inline void spapr_vio_irq_pulse(SpaprVioDevice *de= v) static inline bool spapr_vio_dma_valid(SpaprVioDevice *dev, uint64_t taddr, uint32_t size, DMADirection dir) { - return dma_memory_valid(&dev->as, taddr, size, dir); + return dma_memory_valid(&dev->as, taddr, size, dir, MEMTXATTRS_UNSPECI= FIED); } =20 static inline int spapr_vio_dma_read(SpaprVioDevice *dev, uint64_t taddr, diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index a052f7bca3..a5cd7a98ff 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -73,11 +73,11 @@ static inline void dma_barrier(AddressSpace *as, DMADir= ection dir) * dma_memory_{read,write}() and check for errors */ static inline bool dma_memory_valid(AddressSpace *as, dma_addr_t addr, dma_addr_t len, - DMADirection dir) + DMADirection dir, MemTxAttrs attrs) { return address_space_access_valid(as, addr, len, dir =3D=3D DMA_DIRECTION_FROM_DEVICE, - MEMTXATTRS_UNSPECIFIED); + attrs); } =20 static inline MemTxResult dma_memory_rw_relaxed(AddressSpace *as, --=20 2.26.2