From patchwork Mon Aug 26 07:16:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Vishwanathan X-Patchwork-Id: 13777334 Return-Path: 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 1EDBFC5472F for ; Mon, 26 Aug 2024 07:23:50 +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=UlAkpThGXQLvVPx+k8dqLCpxi8en9zSnxpsu3M8WXYc=; b=zQwFIVZOSTG6jurtmRG5L1cJYB Dv42BOIrBLYXTwlC+YdglyshR1UlnNOwdHbBlAw9HYR+Uew5U6E7iyYFnQmNzIpldfLx34yMvv/gd 7JW2Oh/VYyWu/ttWR0sGrEly5Z8D3Z9w+XEK7CI+bKeDTRsjoKQSBMeivpa/gZMtESmtfhqwi5366 A/12lncPOJFuPZHic6jeeGU8vlYVL+mPzN2TxWr1ah0Y4CNFJXX045zxAKz2/eHAENnST8AGOFLT0 rH/b9y2ff5rNTQNFIo0zN2syi8Am3hLPG3V5YyFxbC7HVRbolRferwLt+Eocz9Ij2HmFOqvyZaf1M dQsQm6+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siU4f-00000006FGv-1wER; Mon, 26 Aug 2024 07:23:37 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siTyK-00000006EIn-2J1C for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 07:17:05 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-6b351a76beeso87164667b3.0 for ; Mon, 26 Aug 2024 00:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724656623; x=1725261423; 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=UlAkpThGXQLvVPx+k8dqLCpxi8en9zSnxpsu3M8WXYc=; b=z7zNTiLSLlWmbKhs/+VA6QAyrl5vl+F4YZhX5nSgkjHM17iEzubQpctiLKBDhQxnF9 u1SgRqS29Qd95gCRYlBZ99d/sKhYEYrvnxa3KTjHljb4X5KKS+mO3yJroq5reoP8zMRS +JjONhd2TpQVgffZ1VtXsQm5SdK4+E8mRu3ja+6AoBxSazypImibzC/0vn0ZBneHxysO FUSsTJ7WUGzIlFu4ogZSxUccjEoo61gOP75TPXhPevpEHCbMXXdGkPTQ988/HL3Ttbep ZoIidGAobqUOuOqGuCoBdgbe5KHKVIhiT+EhUVJzoisvO2WFwkjfdY1YQjBeAvCkBWN8 rD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724656623; x=1725261423; 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=UlAkpThGXQLvVPx+k8dqLCpxi8en9zSnxpsu3M8WXYc=; b=bJuspUYLZd0pdzr4pcYNijZs3IjPb0lG6hWFfAnoeVwaVsEy1u6WS2r8gBxwKLdhdH Uzw1EwHqB4aJ7uhdAX1wQKTa/Mgxmb3I2ATxEek5EaCpbZ8vXB9u6faphAdVfamXNHUo oTiqfVQCS9+PEaJPxkYHu+egkLUbrWtPujEx+B4h2NrE7SQXPmhoKEEHdsLosCae5iZ7 MiuJk0EHcFmfAhzvd8eUR7nhDBimYuNQN/vJ4O6kbCFWvPeTMm3mNKxu7hfbegRx84Hs o8+jA1/9fc/paYmkujIki19PzhOyTxHu/sLyv0RPoel8bznoMU5OHk1ttdsPM5WuRIAw zMJQ== X-Forwarded-Encrypted: i=1; AJvYcCVs4GonHDMbGbs5yiDYo/EpZrutvrPMS7D5PonQL/jW9OPZRPH/s6FOpmgdHl2uHlWx3re9hD5+oGYnrGv1MzV4@lists.infradead.org X-Gm-Message-State: AOJu0YxvBcsyES103TufMqVFZ8K8dZMnzwFXdstPHkCO49lSasRA1smq PiA+WtOVAxVzacDaf+mOT/816pLwsOGto3CLXksdljnI3TIyslkM8xFprj3pH9uPr1Nk/Q5zSzG eqb+hPJzgBvgPAULnHQ== X-Google-Smtp-Source: AGHT+IGTv9O5nWsMNvAuvREulYcA7bXvWQ9CujjRqJDianvCbgB7Y8UFv1A0WfQ112BR7wvtStav+ASLkpwyAOMW X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a81:dc07:0:b0:691:41f5:7f3d with SMTP id 00721157ae682-6c627f0b1e1mr463277b3.4.1724656623018; Mon, 26 Aug 2024 00:17:03 -0700 (PDT) Date: Mon, 26 Aug 2024 07:16:40 +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-4-manojvishy@google.com> Subject: [PATCH v1 3/4] vfio: Add VFIO_DMA_MAP_FLAG_SYS_CACHE to control device access to system cache From: Manoj Vishwanathan To: Will Deacon , Robin Murphy , Joerg Roedel , Alex Williamson , linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, David Dillow , Manoj Vishwanathan X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_001704_607701_DC204709 X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This new flag allows controlling whether a device buffers should be mapped to sys cache for mapped DMA regions. Signed-off-by: Manoj Vishwanathan --- include/uapi/linux/vfio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 2b68e6cdf190..494611a046d3 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@ -1560,6 +1560,7 @@ struct vfio_iommu_type1_dma_map { #define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */ #define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */ #define VFIO_DMA_MAP_FLAG_VADDR (1 << 2) +#define VFIO_DMA_MAP_FLAG_SYS_CACHE (1 << 6) /* Sys Cache able from device */ __u64 vaddr; /* Process virtual address */ __u64 iova; /* IO virtual address */ __u64 size; /* Size of mapping (bytes) */