OSDN Git Service

KVM: selftests: riscv: Set PTE A and D bits in VS-stage page table
authorAnup Patel <apatel@ventanamicro.com>
Sat, 9 Apr 2022 03:45:44 +0000 (09:15 +0530)
committerAnup Patel <anup@brainfault.org>
Sat, 9 Apr 2022 03:45:44 +0000 (09:15 +0530)
commitfac3725364397f9a40a101f089b86ea655a58d06
tree19c4c4c501e86957c4f8c3b4d212d58120f8351a
parent8c3ce496bd612bd21679e445f75fcabb6be997b2
KVM: selftests: riscv: Set PTE A and D bits in VS-stage page table

Supporting hardware updates of PTE A and D bits is optional for any
RISC-V implementation so current software strategy is to always set
these bits in both G-stage (hypervisor) and VS-stage (guest kernel).

If PTE A and D bits are not set by software (hypervisor or guest)
then RISC-V implementations not supporting hardware updates of these
bits will cause traps even for perfectly valid PTEs.

Based on above explanation, the VS-stage page table created by various
KVM selftest applications is not correct because PTE A and D bits are
not set. This patch fixes VS-stage page table programming of PTE A and
D bits for KVM selftests.

Fixes: 3e06cdf10520 ("KVM: selftests: Add initial support for RISC-V
64-bit")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Tested-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/include/riscv/processor.h