From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB33A37BE7E for ; Mon, 6 Jul 2026 02:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783304493; cv=none; b=aoHWbrHgD1w2snOlzGHs8c0Bo7QIX3t2lyCrE+bwyb+obmbRETMqdpy9l5HgGFBEOGLxGWk40qV7CYZbK8Uy3igadF7haxfeueVnc1rDGrhe7rzcRZbHWRRKU64WVmzca1cK2S02RSQ9n7VVQlq2QNG+vZtvL1uhNlxSogJmwxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783304493; c=relaxed/simple; bh=jdqrdxRgXPPiobqccePzQm12KSBszYg3zz082KpcP7k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nEtiZNgePLVqH7nKePgAnmPlEENatsaPGY8oztAoVRr7kOwyg6N1VJuK+ixvPiI3dvVB6UgI9ggjMpRNMsGGXO19mVglYUmjFoCt93WNVV2ikFQUy5XnuhgsLlgLjLx9G6z/ejXHer4rbrxFvf7TxjxfsEM+nsRlvp1P+7DgH1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UnMIZk5p; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UnMIZk5p" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-c88973b6965so2319883a12.1 for ; Sun, 05 Jul 2026 19:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783304492; x=1783909292; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=blzW8cj7qixZrZx8HMTc8WTCaoiy272JiHUFbPafbvA=; b=UnMIZk5pHHk9716V/7gR2QpKFjuSiKgWR3Fcs/gvOdnEvy1a03TG7c7jC+4HQ9WvJ0 2iIFSMklHGqIiL565MYiUVRbV4Jadae4UNtTNYlZnXaqHwv6aCzvLeM2M5TBluazX4X5 SMP5nHPZMhA2LryAma30P2C4AJhMKA+OqnDTqIY3nG/oPpoazjV/T2lcuAdqUG/5D5hl hUlGMB+Nnxdy3OjinRBlRPLqmKufePXswtPmfLW6V1oRZb1/yDEBSn07rTA4HFdOHdL3 3+HfP3oK0RPyFOpzLpE3GfX68uYcWMRRVL6hoSC5LOnpjEhOsG9RUDPGl13Q9ueDc3ti lEiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783304492; x=1783909292; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=blzW8cj7qixZrZx8HMTc8WTCaoiy272JiHUFbPafbvA=; b=bKXs+qSk0ICEq8LEat6DUDhx79BpoqOLsQl7jMwwTPJ4wIEt0KzFwUAE/PqT69ojDc zKPGjgH410oyZE5UC2CmWWrOU0JgklqlTodzoi3Fqe3pqFwksLgH+iNkIijo7qzldkcf 3eUpcQowd4xBBmyNN+90EN+ezLSR/fEEUVE9wfnelB19iYcFdMvK70ZW2d4a5WCD8eF3 nW9fcD4yJq7yRrLaySWc6tDcT9N9le8GrmiSGnwOlAwI7Gzh+L9aPXuL5Mj1KSxpbK9f C+VoiayeFolQWwVyHAIU7tBIqnwyfKsEcZjM0GMCkLeKpt1t2fbZho/UtG1ZJfaBFiSw 83Pg== X-Forwarded-Encrypted: i=1; AHgh+RpsEOqJer9WUoTK1lJUBvYkZcnG6ghVZaMx66LQ21Cq+Q1w8YXXKXpThux+IQL9hgsN/YurQg2WDFtpcOU=@vger.kernel.org X-Gm-Message-State: AOJu0YyEGlP6Xd91DdigoRbpx1HD+HJeCEv7f2g5OMH+n6u0F435hzkk +OnTs+pOnSzrsWnzqyD5pGIoSCGHpEa6mi3oqZwnJ36UFVSSNyXDtfeR X-Gm-Gg: AfdE7clSxi7LRgilHujdch5zF5DpSeArbxarou5IjsLrxdxJ3BLS8cv9Eb1wNqSTV67 vd484tymYMueAmX0tfey9Ay9NdI/rqhRzPRg7FGqE08OybDTfFzv86oC1GelfB5X5qqesOvpnBW OgO7v1PWtGpSnTrkuz7DZGnLVvB6lQNR3VCWgh6xf+iSskXU+tDhmOxiecLzPHWojsHPgHSHmvA o3EM1yQmdHVu/gBjrgT4rHri29nkYbSBNHoeWOrI0sciZu6W8aOMwI/PpsuqYqsvuTXJpBI9kP6 k0TlUMqrcNUZdxvhSuu35+N+XI8SBrXPeXDis/O9p7c2XijcZc1o8MWqFJrV7CjKV0pQS+bWfED 3PDpmNV+5qHggKou/VkNb7JkyIcVGCmKgEv45mhazTB+WOIEg/VwQ3JGToOKmDpm7 X-Received: by 2002:a17:90a:d40c:b0:37f:f089:c81b with SMTP id 98e67ed59e1d1-383394cf557mr5675419a91.3.1783304492074; Sun, 05 Jul 2026 19:21:32 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38146b8d314sm3764140a91.15.2026.07.05.19.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2026 19:21:31 -0700 (PDT) From: Inochi Amaoto To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Anup Patel , Atish Patra , Paolo Bonzini , Shuah Khan , Charlie Jenkins , Sergey Matyukevich , Thomas Huth , Inochi Amaoto , Deepak Gupta Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, Yixun Lan , Longbin Li Subject: [PATCH v5 0/8] RISC-V: KVM: Add Svadu/Zicfiss/Zicfilp FWFT support Date: Mon, 6 Jul 2026 10:20:36 +0800 Message-ID: <20260706022046.214956-1-inochiama@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patchset based on the patchset "RISC-V: KVM: Add Zicfiss/Zicfilp support". The patch includes all the function of original patchset from Quan: adding the Svadu/Zicfiss/Zicfilp FWFT for the RISC-V KVM. And this patchset already passes the KVM unit test. Test with the patch applied https://lore.kernel.org/all/20260618064406.14508-1-cuiyunhui@bytedance.com/ Changed from v4: patch 1: 1. Use NACL for csr update 2. Check ISA mapping before cleaning the ADUE bit patch 4: 1. Clear the zicfiss csr during a VCPU reset 2. Add zicfiss csr to num_csr_regs() patch 6: 1. Cleanup SPELP after redirecting the trap patch 7: 1. Use interrupt bit instead of number for masking/unmasking patch 8: 1. Add missing entry for the test 2. Fix the wrong comment. Changed from v3: - https://lore.kernel.org/kvm/20260607081105.993908-1-inochiama@gmail.com/ 1. rebase to the v7.2-rc1 2. Tested with the updated Svadu patch 3. Remove the dependency as it is already merged. Changed from v2: - https://lore.kernel.org/kvm/20260601084336.2601675-1-inochiama@gmail.com/ 1. rebase with Yong-Xuan's patch set 2. Add SSP CSR context switch/set/get 3. Move the software-check exception set/unset into FWFT 4. Only delegate software-check exception when Zicfiss/Zicfilp is enabled. 5. Make KVM SBI_FWFT_PTE_AD_HW_UPDATING depends on both Svadu and Svade enabled. Changed from Quan's v1: - https://lore.kernel.org/kvm/cover.1764509485.git.zhouquan@iscas.ac.cn/ 1. rebase to the latest master. 2. Split Svadu change as separate patch 3. Fix all build error from the original series 4. Remove the Svadu check in kvm_riscv_vcpu_config_ran_once() and in favor of the FWFT. 5. Remove the LPE/SSE setting bit in kvm_riscv_vcpu_config_ran_once() (kvm_riscv_vcpu_setup_config() in original patchset) Inochi Amaoto (8): RISC-V: KVM: Add support for Svadu FWFT features KVM: riscv: selftests: add Svadu FWFT extension to get-reg-list test RISC-V: KVM: Allow Zicfiss/Zicfilp extensions for Guest/VM RISC-V: KVM: Add ssp context save/restore RISC-V: KVM: Handle software-check exits for VCPU RISC-V: KVM: Delegate SPELP bit to VS/VU mode if landing pad is enabled. RISC-V: KVM: Add support for control-flow integrity FWFT features KVM: riscv: selftests: add Zicfiss/Zicfilp extension to get-reg-list test arch/riscv/include/asm/csr.h | 1 + arch/riscv/include/asm/kvm_host.h | 7 + arch/riscv/include/uapi/asm/kvm.h | 13 ++ arch/riscv/kvm/isa.c | 2 + arch/riscv/kvm/vcpu.c | 7 + arch/riscv/kvm/vcpu_exit.c | 11 ++ arch/riscv/kvm/vcpu_onereg.c | 68 ++++++- arch/riscv/kvm/vcpu_sbi_fwft.c | 184 ++++++++++++++++++ .../selftests/kvm/riscv/get-reg-list.c | 90 +++++++++ 9 files changed, 381 insertions(+), 2 deletions(-) -- 2.55.0