Skip to content

[PW_SID:994195] Fixup & optimize hgatp mode & vmid detect functions - #819

Closed
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw994195
Closed

[PW_SID:994195] Fixup & optimize hgatp mode & vmid detect functions#819
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw994195

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 994195 applied to workflow__riscv__fixes

Name: Fixup & optimize hgatp mode & vmid detect functions
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=994195
Version: 4

fangyu0809 and others added 3 commits August 21, 2025 22:47
According to the RISC-V Privileged Architecture Spec, when MODE=Bare
is selected,software must write zero to the remaining fields of hgatp.

We have detected the valid mode supported by the HW before, So using a
valid mode to detect how many vmid bits are supported.

Fixes: fd7bb4a ("RISC-V: KVM: Implement VMID allocator")
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Reviewed-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The HGATP has been set to zero in gstage_mode_detect(), so there
is no need to save the old context. Unify the code convention
with gstage_mode_detect().

Reviewed-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
urrent kvm_riscv_gstage_mode_detect() assumes H-extension must
have HGATP_MODE_SV39X4/SV32X4 at least, but the spec allows
H-extension with HGATP_MODE_BARE alone. The KVM depends on
!HGATP_MODE_BARE at least, so enhance the gstage-mode-detect
to block HGATP_MODE_BARE.

Move gstage-mode-check closer to gstage-mode-detect to prevent
unnecessary init.

Reviewed-by: Troy Mitchell <troy.mitchell@linux.dev>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 105.98 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1056.80 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1376.39 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.74 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.70 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 75.18 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
kdoc
Desc: Detects for kdoc errors
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[V4,RESEND,1/3] RISC-V: KVM: Write hgatp register with valid mode bits"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 104.92 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1058.70 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1376.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.15 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.19 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 75.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[V4,RESEND,2/3] RISC-V: KVM: Remove unnecessary HGATP csr_read"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 104.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1054.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1368.83 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.13 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.00 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 75.34 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[V4,RESEND,3/3] RISC-V: KVM: Prevent HGATP_MODE_BARE passed"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot deleted the pw994195 branch August 29, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants