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 8AC01C5AC67 for ; Tue, 11 Aug 2026 06:03:01 +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: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:In-Reply-To:References: List-Owner; bh=B0vqqZV5mRj1tlzko3nGGi5CEd31NuD27Ewj0U2Z3PM=; b=nfx+hmkTeyBVWO ujZvA5dADwySneM3T6qoGFUBN6BCqMGuho3tfAufbFHOi3IVy1Rs+tmPygO5Ij7CWY7xWnW6trv9f 5eLsb7thDMfPZ0cqacRFFNufaHQwTKFd3whi5/HJ9Ynb6Qij3tV+bkRUZTHPI0OBcCV0u7bd09eYY RDHefJsihVee3ueM5QCQf2ujIM6IpeYoqyttIuVbo0i+vm4eVWRmXPy6jjl7/jgB4S0G+zyRIb6WI HPHg7E+hz38Bvjn9tMRz+/xUU4BXgQR2mE078Wb9CuhtLLi/mvWh5Xft8nW6O5Hk4Ayu4/Mu+myFr oeTfu8qymrxyo2pNRc4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wtfZZ-0000000DMsr-43mi; Tue, 11 Aug 2026 06:02:49 +0000 Received: from mta1.migadu.com ([37.59.57.117] helo=out-186.mta1.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wtfZX-0000000DMqE-26pA for linux-riscv@lists.infradead.org; Tue, 11 Aug 2026 06:02:48 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786428154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WYtY1rGPyp4UaCJfpmk8LbHxzINII5BxDNNg7wmiL1Y=; b=QhqBe4xVk3oISf6Sjp5+lCqhNofmL6YOa9bSVfi9LK3ixb3Hd4jhoAnAcqz6oz53U6TaWA I3wn59xB3anIbk2XphgJ4UUoFjkh17r1x+3FHBI3hHH7D+HX54IsBc7I5TcgWo7bw5OXS6 RejMI+CaxQ7ZtYAo++Y61x5O1M/xbz0= From: Jinyu Tang To: Anup Patel , Anup Patel , Paolo Bonzini , Sean Christopherson Cc: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Andrew Jones , Conor Dooley , Yong-Xuan Wang , Nutty Liu , Jinyu Tang , Jinyu Tang Subject: [PATCH 0/3] KVM: riscv: Add KVM_PRE_FAULT_MEMORY support Date: Tue, 11 Aug 2026 14:01:31 +0800 Message-ID: <20260811060134.106973-1-jinyu.tang@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260810_230247_681946_0297EE2F X-CRM114-Status: UNSURE ( 6.62 ) 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 This series adds RISC-V support for the generic KVM_PRE_FAULT_MEMORY vcpu ioctl and enables the existing generic KVM selftest for RISC-V. KVM_PRE_FAULT_MEMORY lets userspace ask KVM to populate stage-2 mappings for a GPA range before running a vCPU that is expected to access that range. x86 already supports the ioctl; RISC-V currently falls back to normal first-touch G-stage faults. Patch 1 implements the RISC-V arch hook using the existing G-stage map path. Patch 2 fixes the RISC-V selftest page-table walker for Sv57, which can be selected as the default guest mode. Patch 3 enables pre_fault_memory_test for RISC-V. Tested with pre_fault_memory_test on a RISC-V KVM host. Jinyu Tang (3): KVM: riscv: Implement KVM_PRE_FAULT_MEMORY KVM: selftests: Add RISC-V Sv57 page table indexing KVM: selftests: Enable pre_fault_memory_test for RISC-V arch/riscv/kvm/Kconfig | 1 + arch/riscv/kvm/gstage.c | 3 ++ arch/riscv/kvm/mmu.c | 33 +++++++++++++++++++ arch/riscv/kvm/vm.c | 1 + tools/testing/selftests/kvm/Makefile.kvm | 1 + .../selftests/kvm/include/riscv/processor.h | 6 ++++ .../selftests/kvm/lib/riscv/processor.c | 2 ++ .../selftests/kvm/pre_fault_memory_test.c | 3 ++ 8 files changed, 50 insertions(+) -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv