RISC-V: KVM: Fix comments in kvm_riscv_vcpu_isa_disable_allowed
Subsystems (3)
PATCH 1/1 RISC-V: KVM: Fix comments in kvm_riscv_vcpu_isa_disable_allowed
The comments for EXT_SVADE are opposite with the codes. Fix it to avoid confusion.
--- arch/riscv/kvm/vcpu_onereg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kvm/vcpu_onereg.c +1 -1
@@ -203,7 +203,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext)case KVM_RISCV_ISA_EXT_SVADE :/* * The henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero. -* Svade is not allowed to disable when the platform use Svade. +* Svade is allowed to disable when the platform use Svade. */ return arch_has_hw_pte_young ();default :
Signature · 1 line
2.34.1
Quoted 13 lines · Chao Du
The comments for
EXT_SVADEare opposite with the codes. Fix it to avoid confusion.Signed-off-by Chao Du <[email protected]>--- arch/riscv/kvm/vcpu_onereg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/kvm/vcpu_onereg.c +0
-0
arch/riscv/kvm/vcpu_onereg.c static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) · line 207
Quoted 6 lines
arch/riscv/kvm/vcpu_onereg.c +1
-1@@ -203,7 +203,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext)case KVM_RISCV_ISA_EXT_SVADE :/* * The henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero. -* Svade is not allowed to disable when the platform use Svade. +* Svade is allowed to disable when the platform use Svade. */
It was correct (but confusing) before this change. When arch_has_hw_pte_young() returns true, that means we can use SVADU (which is !SVADE). If we don't have SVADU, then we must be using SVADE, and therefore can't disable it.
How about
/*
* The henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero.
* Svade can't be disabled unless we support Svadu. */
Thanks,
drew
Quoted 10 lines
arch/riscv/kvm/vcpu_onereg.c +0
-0return arch_has_hw_pte_young ();default :Signature · 7 lines
2.34.1 -- kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv
Quoted 9 lines · Andrew Jones
Quoted 8 lines · Chao Du
The comments for
EXT_SVADEare opposite with the codes. Fix it to avoid confusion.Signed-off-by Chao Du <[email protected]>--- arch/riscv/kvm/vcpu_onereg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
arch/riscv/kvm/vcpu_onereg.c static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) · line 207
Quoted 11 lines
arch/riscv/kvm/vcpu_onereg.c +1
-1@@ -203,7 +203,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext)case KVM_RISCV_ISA_EXT_SVADE :/* * The henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero. -* Svade is not allowed to disable when the platform use Svade. +* Svade is allowed to disable when the platform use Svade. */ It was correct (but confusing) before this change. When
arch_has_hw_pte_young()returns true, that means we can use SVADU (which is !SVADE). If we don't have SVADU, then we must be using SVADE, and therefore can't disable it.
Thanks for the clarification.
I had some misunderstandings about the relation between SVADU and SVADE.
Quoted 6 lines
How about
/*
* The henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero.
* Svade can't be disabled unless we support Svadu. */
Yeah, that's better.
Thanks,
Chao
Quoted 14 lines
Thanks,
drewQuoted 10 lines
arch/riscv/kvm/vcpu_onereg.c +0
-0return arch_has_hw_pte_young ();default :Signature · 7 lines
2.34.1 -- kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv
Signature · 3 lines
kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv