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 8B554CCF9E3 for ; Fri, 24 Oct 2025 13:31:45 +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=UyI+FmrQ0+mBNWKAPAvg6H6iklES4lekNAlJ3EHoRDM=; b=w1K0WONknOxXIB kEeFLKsS/873kM4iOkx/jWFN4AgwwDax2Vkf5bYgZP8mV61HC0yFyz5Uiig3tHUjs9sYvqYWsschT oTH61xYF2qaVrMs75ALWKNq4lKNxnWXFlutJyk1C7cC9rNBlar+n9n4oDAjd+rrwSqqrpoP6elLLg fD6MdCs1dSylcp8hCxdplpRqxMbTd5dFTDecTHkpDy8yYEqR5XADIBFaNHWlYTyZlNnjHT7Hhsqck crjR8wMvh6Y3malUHukQzqWC/Ev9vt7G8a6Q9Lu14oIW7kTcPIscX6+SQagE1BDIHX6/AQRZGJRPA QJvFM2ZnwQU8FpUtcpzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vCHtF-00000009Y20-0i56; Fri, 24 Oct 2025 13:31:33 +0000 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vCHtC-00000009Y1A-00OE; Fri, 24 Oct 2025 13:31:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1761312685; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=u39F8WLNvyq44vB4xSRWGu/rMtKru1JoTVTHXDxB/aY=; b=EFjiYyCZa45xyHqQOJrSYbMbhs/PZjzN37YusTRPc+JKs01jrjl09jOFPpzznmYbQ+HIiT40k6Ng2DwqUBFptqqko4kQ4JsQ1ZL0R/myuPR/oG03ZcDYr0TLhD0zUNWBdTCvLvYd83IS/lPFEsySTrD/bhHaIncvFSbFnTtETlY= Received: from localhost.localdomain(mailfrom:fangyu.yu@linux.alibaba.com fp:SMTPD_---0WquOQXL_1761312681 cluster:ay36) by smtp.aliyun-inc.com; Fri, 24 Oct 2025 21:31:22 +0800 From: fangyu.yu@linux.alibaba.com To: anup@brainfault.org Cc: alex@ghiti.fr, aou@eecs.berkeley.edu, atish.patra@linux.dev, fangyu.yu@linux.alibaba.com, guoren@kernel.org, jiangyifei@huawei.com, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, pbonzini@redhat.com, pjw@kernel.org Subject: Re: Re: [PATCH] RISC-V: KVM: Remove automatic I/O mapping for VM_PFNMAP Date: Fri, 24 Oct 2025 21:31:16 +0800 Message-Id: <20251024133116.73803-1-fangyu.yu@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251024_063130_694522_3C0EF4BB X-CRM114-Status: UNSURE ( 6.15 ) 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 >> >> As of commit aac6db75a9fc ("vfio/pci: Use unmap_mapping_range()"), >> vm_pgoff may no longer guaranteed to hold the PFN for VM_PFNMAP >> regions. Using vma->vm_pgoff to derive the HPA here may therefore >> produce incorrect mappings. >> >> Instead, I/O mappings for such regions can be established on-demand >> during g-stage page faults, making the upfront ioremap in this path >> is unnecessary. >> >> Fixes: 9d05c1fee837 ("RISC-V: KVM: Implement stage2 page table programming") >> Signed-off-by: Fangyu Yu > >LGTM. > >Queued it as fix for Linux-6.18 > >Reviewed-by: Anup Patel > >Thanks, >Anup > Hi Anup: Thanks for the review. Please note that this patch has two build warnings, and I have fixed on patch V2: https://lore.kernel.org/linux-riscv/20251021142131.78796-1-fangyu.yu@linux.alibaba.com/ Thanks, Fangyu _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv