Message ID | 20240826071641.2691374-3-manojvishy@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B425C54731 for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Aug 2024 07:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BRShtYLZmJBPJSHqgx4PDt4rvJ58jLkk96vd1/jbIvg=; b=z+MdJbXhe8Zs6eUDlegb7lyRS9 u88EmFXbMagzGVZJ/BD4l94cWwzSLUCmKrnOXhd1QoZhnXqbTGzV7BxA1ylMVsw2dLD23tmA8Ih7u sjBo5RWnYpI1VLt8W/6oPSM4wyCDSjO5YzmsdY8MQsdAWdjF39hD1T+HpxndBw/lQgomNQxi+rW+Y D2V2meoiDPRxj8Q6qtpLiqfGrcKioBk9u94NuLZfNDZCWIdWRAeckm/MUs+JvyvDlKT/L2slv00/X c5X7Po1LLc9W3nJLCCw3fNkSi3CHUwoEmBgZokTG8giyldslNGgCl9PYUOvIVRrzcTm6BGWPX9JGg 96GWk/xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siU4d-00000006FFN-31Wv; Mon, 26 Aug 2024 07:23:35 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siTyH-00000006EI3-4BY7 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 07:17:03 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-6b1adbdbec9so78512757b3.0 for <linux-arm-kernel@lists.infradead.org>; Mon, 26 Aug 2024 00:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724656620; x=1725261420; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=BRShtYLZmJBPJSHqgx4PDt4rvJ58jLkk96vd1/jbIvg=; b=QSqUQihMtt0zdjwjdpSvsr+zCZrwtR/mYvv5k0wEmoBWzmkAwD/4hf5iRJEzQVGrx4 ZwSksXI1j5xMt4Zx8i/ymHErLUDR6WGkCcOk9fq7OPoegpX9nfYnlsVqxfu/vWUCBI6J vmQl5gbBCqwe9VPVWfEjIlFhSgI0q57NSYnDSUiWRAhEa/wJj8Di4FCxcfVTeUq2rTMi BUGhoPRh9YekhhDflwjT3q7UTsfwORMhNkxrBypwMqtMZ1exG/Md2imB64t38XJ+bc8P r8Xr3sQ8IaFPqUyAVR7uHhH0U/8i+qbp4drrlUPDnpYJmDdxdZZGiMts+AQ/MOr8qDf9 Qq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724656620; x=1725261420; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BRShtYLZmJBPJSHqgx4PDt4rvJ58jLkk96vd1/jbIvg=; b=VJ1C83iwvod+l+UvkVOJ7Gqrno9m0Tys2/ItEpwB03tzK55jakdfg801cx6jmj0cO6 iyffczcy7WzovbPnuRd4cZOYQpP7zPHLA+NBpOYJP55nVx8Q8Nkv+BX4IzRaHbYyNzYc 8ziobm04RvBpuQ18NL2b5jiIysQaaSoZAmX78glfla+e81zIV4GjcJ2S7+QOrho4/GTD owcF1EP+xaWwsuvCow+W4GEZk/cWuOw4X3gcpOtxFz00apjchRXZj0mhXB1EIxLcaWqU k94sCrTvd7jr8a0dp3Wd11/fHJyj/TWcvKXShLZDS2rA6sgXK7YTTZz4hfzz6jn8m/Ge i4wQ== X-Forwarded-Encrypted: i=1; AJvYcCVUbjHoa7dtezunhzsUJt5E3hQGirfxXtaZAQtsiY7CTxP/W7GufEGCQt0paXQUmBxjbdnu5Mo3aHBX4LDK+UbH@lists.infradead.org X-Gm-Message-State: AOJu0YyNDW+FwcdpeF3iX+c4ggrM88dPIsdlYQQvh/HITgBcyhGACl5i U8RwM2KUMjAIt15NUoJhR9VMBgn6XKrnsoqvX2+8LvFBKl7cApExkLBs3v7SgUxK7Gs8xG102hd Qy0nqTxGeSv+fZBw0AQ== X-Google-Smtp-Source: AGHT+IFvc8OHSGEhjIEIYer2jfp9QrAbi6exBOTouXCSVWGbyUY3HkgdonvtEDMyxk52fnOPsWuReZ1tNXp20tcu X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a05:690c:2b8c:b0:69a:536:afde with SMTP id 00721157ae682-6c627d07c73mr623137b3.5.1724656619604; Mon, 26 Aug 2024 00:16:59 -0700 (PDT) Date: Mon, 26 Aug 2024 07:16:39 +0000 In-Reply-To: <20240826071641.2691374-1-manojvishy@google.com> Mime-Version: 1.0 References: <20240826071641.2691374-1-manojvishy@google.com> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog Message-ID: <20240826071641.2691374-3-manojvishy@google.com> Subject: [PATCH v1 2/4] iommu/io-pgtable-arm: Force outer cache for page-level MAIR via user flag From: Manoj Vishwanathan <manojvishy@google.com> To: Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Joerg Roedel <joro@8bytes.org>, Alex Williamson <alex.williamson@redhat.com>, linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, David Dillow <dillow@google.com>, Manoj Vishwanathan <manojvishy@google.com> Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_001702_060571_D4483124 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
vfio/iommu: Flag to allow userspace to set DMA buffers system cacheable
|
expand
|
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index f5d9fd1f45bf..31dd6203db96 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -471,6 +471,9 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, else if (prot & IOMMU_CACHE) pte |= (ARM_LPAE_MAIR_ATTR_IDX_CACHE << ARM_LPAE_PTE_ATTRINDX_SHIFT); + else if (prot & IOMMU_SYS_CACHE) + pte |= (ARM_LPAE_MAIR_ATTR_IDX_INC_OCACHE + << ARM_LPAE_PTE_ATTRINDX_SHIFT); } /*
This change introduces a user-accessible flag that allows controlling the system-level outer cache behavior for mapped buffers. By setting this flag, the page-level MAIR attribute will be forced to use the outer cache, potentially improving performance for frequently accessed data. Signed-off-by: Manoj Vishwanathan <manojvishy@google.com> --- drivers/iommu/io-pgtable-arm.c | 3 +++ 1 file changed, 3 insertions(+)