From mboxrd@z Thu Jan 1 00:00:00 1970 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 83F9BF45A12 for ; Sat, 11 Apr 2026 02:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EHyEEY9MapwRF92V9Vlv41hIy7kw74X6gxAu4ZLzs4w=; b=XL03wmM3Mk8Nro n90HLeD6Drfx4EvQ0SajSuGp1DIm2Ie2ohiOnroZFno0jVCxLgsHM+h8l2Fp9qR2n/dtpP5AbTDbQ jseZ2VaQqCkqBVhEGOrEOiU2iX7eZmy6PF1cO2uut+dmoguD4oC2zUNKf1ysBm1Y42lq594r6fAz8 EFniZ5WgapwzZM07ECsJkcuTf6QFMzVRNHSFmGjvdIwswvCYuwpTm9URSMgIYxu/2SaOdyWDhPrAi 23cSDuyAZ7Iw7u/fRI0Amr0wtmK21acWwL/5SQETFuAiawGamhyFZVI0ZezBn1A04uV1GqnIr3cy8 docu/V8q3jbADaw+EZOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wBNzh-0000000D3B4-0bS5; Sat, 11 Apr 2026 02:22:45 +0000 Received: from out30-111.freemail.mail.aliyun.com ([115.124.30.111]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wBNzc-0000000D39B-0pAS; Sat, 11 Apr 2026 02:22:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1775874153; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=lRfbN+qFsMwF7HYtaTY+0ggUK9iXGO0XzHEDssk5rVo=; b=ol9jUcwWAFG5B6LF0FFb1i+hBPbIKPadEatv/MOeejkWUVaXJuV6zqD3pomFL3X/kz1/o1NMgt8aMsLEOIJ1d0LNBLW2T3gRl9SHPNJzZJ13OEiaUzATDxdee731I7dDxA9AFlxZL6KLMXPeqAcfbNnVPYISD6ylj2VdJYLs3pA= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045098064;MF=fangyu.yu@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0X0miYRm_1775874148; Received: from localhost.localdomain(mailfrom:fangyu.yu@linux.alibaba.com fp:SMTPD_---0X0miYRm_1775874148 cluster:ay36) by smtp.aliyun-inc.com; Sat, 11 Apr 2026 10:22:29 +0800 From: fangyu.yu@linux.alibaba.com To: joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, tjeznach@rivosinc.com, jgg@ziepe.ca, kevin.tian@intel.com, baolu.lu@linux.intel.com, vasant.hegde@amd.com Cc: guoren@kernel.org, iommu@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Fangyu Yu Subject: [PATCH 1/2] iommu/riscv: Advertise Svpbmt support to generic page table Date: Sat, 11 Apr 2026 10:22:22 +0800 Message-Id: <20260411022223.91029-2-fangyu.yu@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20260411022223.91029-1-fangyu.yu@linux.alibaba.com> References: <20260411022223.91029-1-fangyu.yu@linux.alibaba.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260410_192240_439148_EB5A983B X-CRM114-Status: UNSURE ( 7.03 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Fangyu Yu The RISC-V IOMMU can optionally support Svpbmt page-based memory types in its page table format. When present,the generic page table code can use this capability to encode memory attributes (e.g. MMIO vs normal memory) in PTEs. Signed-off-by: Fangyu Yu --- drivers/iommu/riscv/iommu.c | 2 ++ include/linux/generic_pt/common.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/iommu/riscv/iommu.c b/drivers/iommu/riscv/iommu.c index c7d0342aa747..e53883935563 100644 --- a/drivers/iommu/riscv/iommu.c +++ b/drivers/iommu/riscv/iommu.c @@ -1194,6 +1194,8 @@ static struct iommu_domain *riscv_iommu_alloc_paging_domain(struct device *dev) cfg.common.features = BIT(PT_FEAT_SIGN_EXTEND) | BIT(PT_FEAT_FLUSH_RANGE) | BIT(PT_FEAT_RISCV_SVNAPOT_64K); + if (iommu->caps & RISCV_IOMMU_CAPABILITIES_SVPBMT) + cfg.common.features |= BIT(PT_FEAT_RISCV_SVPBMT); domain->riscvpt.iommu.nid = dev_to_node(iommu->dev); domain->domain.ops = &riscv_iommu_paging_domain_ops; diff --git a/include/linux/generic_pt/common.h b/include/linux/generic_pt/common.h index fc5d0b5edadc..dfadf8a5752a 100644 --- a/include/linux/generic_pt/common.h +++ b/include/linux/generic_pt/common.h @@ -188,6 +188,7 @@ enum { * Support the 64k contiguous page size following the Svnapot extension. */ PT_FEAT_RISCV_SVNAPOT_64K = PT_FEAT_FMT_START, + PT_FEAT_RISCV_SVPBMT, }; -- 2.50.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv