Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2234201/?format=api
{ "id": 2234201, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234201/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260507113706.11400-9-fangyu.yu@linux.alibaba.com/", "project": { "id": 70, "url": "http://patchwork.ozlabs.org/api/1.2/projects/70/?format=api", "name": "Linux KVM RISC-V", "link_name": "kvm-riscv", "list_id": "kvm-riscv.lists.infradead.org", "list_email": "kvm-riscv@lists.infradead.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "http://lists.infradead.org/pipermail/kvm-riscv/", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260507113706.11400-9-fangyu.yu@linux.alibaba.com>", "list_archive_url": null, "date": "2026-05-07T11:37:04", "name": "[RFC,v2,08/10] iommu/riscv: Pre-enable GADE for second-stage domains", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7661508bee82c87286eab9a403f91bf5ce5dff8b", "submitter": { "id": 91416, "url": "http://patchwork.ozlabs.org/api/1.2/people/91416/?format=api", "name": null, "email": "fangyu.yu@linux.alibaba.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260507113706.11400-9-fangyu.yu@linux.alibaba.com/mbox/", "series": [ { "id": 503164, "url": "http://patchwork.ozlabs.org/api/1.2/series/503164/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/list/?series=503164", "date": "2026-05-07T11:36:57", "name": "iommu/riscv: Add hardware dirty tracking for second-stage domains", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/503164/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2234201/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2234201/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=B+n9QloT;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=JLZRCKGO;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gB9GR74lCz23mF\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 21:37:35 +1000 (AEST)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux))\n\tid 1wKx2r-00000003el2-2Nui;\n\tThu, 07 May 2026 11:37:33 +0000", "from out199-9.us.a.mail.aliyun.com ([47.90.199.9])\n\tby bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux))\n\tid 1wKx2n-00000003edh-1qvm;\n\tThu, 07 May 2026 11:37:31 +0000", "from localhost.localdomain(mailfrom:fangyu.yu@linux.alibaba.com\n fp:SMTPD_---0X2UVF1m_1778153842 cluster:ay36)\n by smtp.aliyun-inc.com;\n Thu, 07 May 2026 19:37:23 +0800" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=FYiuLzuuGLw2AUUpSNs7mFXLzcVYq2eaeY6IzdJpHEQ=; b=B+n9QloT2EY1zl\n\tTv5m0zal4YoajXmdCbkiny1DBJ8+AaUC1dTDh1TJgYNeNscVV1Q7eLxkUh9AfZLA00aly70XJN2h5\n\tOe/O9MJa25FhbCHJZYqxGGFlI3xn3KuIbFkeGbICGfugk18aLb3S2RihtG6fp+SOUtOUh42kFFwJ/\n\t7N6OMTVWGOBgAnqBbvRmHItNV7gHdVILhnVw0OHT76aLsBWIqg5Sgcm7w5Fd/o1fgFTirBRj0Rqly\n\tgr/p086eOVOu3cwZLLvwco073xdsC9Il48w5Vh2BeylmKPB7joIRb2CIJu4RGQfRU4E9oi2Db0NfI\n\tgTSbDFeiIpsJnzh2Dcdw==;", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linux.alibaba.com; s=default;\n\tt=1778153845; h=From:To:Subject:Date:Message-Id:MIME-Version;\n\tbh=hesx5mr3hyIU597nzAcEZE25NXb5nnN09Ut/PVDl82s=;\n\tb=JLZRCKGOYXjaDJ/iERJ9nTMtGqRHKGeOxZmTCFSnbMplFVl+f4W7zY122s7n4TL1LljTrQlj/i1rAcPQvv4h2wqzwdCI9oHAlHx5eIdv29ezXPefeZNOloovUbd7kfdzFct8rgx/MkIbned5/FLUh7nHEObHx6+7hIX62nnUfnU=" ], "X-Alimail-AntiSpam": "\n AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=fangyu.yu@linux.alibaba.com;NM=1;PH=DS;RN=24;SR=0;TI=SMTPD_---0X2UVF1m_1778153842;", "From": "fangyu.yu@linux.alibaba.com", "To": "joro@8bytes.org,\n\twill@kernel.org,\n\trobin.murphy@arm.com,\n\tpjw@kernel.org,\n\tpalmer@dabbelt.com,\n\taou@eecs.berkeley.edu,\n\talex@ghiti.fr,\n\ttjeznach@rivosinc.com,\n\tjgg@ziepe.ca,\n\tkevin.tian@intel.com,\n\tbaolu.lu@linux.intel.com,\n\tvasant.hegde@amd.com,\n\tanup@brainfault.org,\n\tatish.patra@linux.dev,\n\tskhawaja@google.com,\n\tjgg@nvidia.com", "Cc": "guoren@kernel.org,\n\tandrew.jones@oss.qualcomm.com,\n\tkvm@vger.kernel.org,\n\tiommu@lists.linux.dev,\n\tkvm-riscv@lists.infradead.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org,\n\tFangyu Yu <fangyu.yu@linux.alibaba.com>", "Subject": "[RFC PATCH v2 08/10] iommu/riscv: Pre-enable GADE for second-stage\n domains", "Date": "Thu, 7 May 2026 19:37:04 +0800", "Message-Id": "<20260507113706.11400-9-fangyu.yu@linux.alibaba.com>", "X-Mailer": "git-send-email 2.39.3 (Apple Git-146)", "In-Reply-To": "<20260507113706.11400-1-fangyu.yu@linux.alibaba.com>", "References": "<20260507113706.11400-1-fangyu.yu@linux.alibaba.com>", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260507_043729_785184_1592B427 ", "X-CRM114-Status": "UNSURE ( 7.31 )", "X-CRM114-Notice": "Please train this message.", "X-Spam-Score": "-17.6 (-----------------)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: From: Fangyu Yu <fangyu.yu@linux.alibaba.com> Pre-enable\n RISCV_IOMMU_DC_TC_GADE\n in the device context when attaching a second-stage domain, if the IOMMU\n supports AMO_HWAD. Software pre-populates second-stage page tables with D\n set,\n so enabling GADE by default does not change normal behavior. When dirty\n tracking is enabled, iommufd clears the pre-set D bits and GADE beco [...] \n Content analysis details: (-17.6 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list\n -7.5 USER_IN_DEF_SPF_WL From: address is in the default SPF welcome-list\n -0.0 SPF_PASS SPF: sender matches SPF record\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's\n domain\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]\n 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay\n lines\n -0.5 ENV_AND_HDR_SPF_MATCH Env and Hdr From used in default SPF WL Match\n -0.0 DMARC_PASS DMARC pass policy", "X-BeenThere": "kvm-riscv@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<kvm-riscv.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/kvm-riscv/>", "List-Post": "<mailto:kvm-riscv@lists.infradead.org>", "List-Help": "<mailto:kvm-riscv-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"kvm-riscv\" <kvm-riscv-bounces@lists.infradead.org>", "Errors-To": "kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "From: Fangyu Yu <fangyu.yu@linux.alibaba.com>\n\nPre-enable RISCV_IOMMU_DC_TC_GADE in the device context when\nattaching a second-stage domain, if the IOMMU supports AMO_HWAD.\n\nSoftware pre-populates second-stage page tables with D set, so\nenabling GADE by default does not change normal behavior. When\ndirty tracking is enabled, iommufd clears the pre-set D bits and\nGADE becomes necessary for hardware to update the dirty bit on\nwrite access.\n\nThis avoids toggling GADE dynamically and keeps device context\nsetup consistent with second-stage domain attachment.\n\nSigned-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>\n---\n drivers/iommu/riscv/iommu.c | 2 ++\n 1 file changed, 2 insertions(+)", "diff": "diff --git a/drivers/iommu/riscv/iommu.c b/drivers/iommu/riscv/iommu.c\nindex ebf42f74e194..4adf2b6be89b 100644\n--- a/drivers/iommu/riscv/iommu.c\n+++ b/drivers/iommu/riscv/iommu.c\n@@ -1229,6 +1229,8 @@ static int riscv_iommu_attach_paging_domain(struct iommu_domain *iommu_domain,\n \t\tdc.iohgatp = FIELD_PREP(RISCV_IOMMU_DC_IOHGATP_MODE, pt_info.iohgatp_mode) |\n \t\t\t FIELD_PREP(RISCV_IOMMU_DC_IOHGATP_GSCID, domain->gscid) |\n \t\t\t FIELD_PREP(RISCV_IOMMU_DC_IOHGATP_PPN, pt_info.ppn);\n+\t\tif (iommu->caps & RISCV_IOMMU_CAPABILITIES_AMO_HWAD)\n+\t\t\tdc.tc |= RISCV_IOMMU_DC_TC_GADE;\n \t} else {\n \t\tdc.fsc = FIELD_PREP(RISCV_IOMMU_PC_FSC_MODE, pt_info.fsc_iosatp_mode) |\n \t\t FIELD_PREP(RISCV_IOMMU_PC_FSC_PPN, pt_info.ppn);\n", "prefixes": [ "RFC", "v2", "08/10" ] }