Thread (48 messages) 48 messages, 5 authors, 2026-05-30

Re: [PATCH 10/17] KVM: arm64: Kill logging_active from kvm_s2_fault

From: Fuad Tabba <hidden>
Date: 2026-03-17 13:24:20
Also in: kvmarm

On Mon, 16 Mar 2026 at 17:55, Marc Zyngier [off-list ref] wrote:
There are only two spots where we evaluate whether logging is
active. Replace the boolean with calls to the relevant helper.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <redacted>

Cheers,
/fuad
quoted hunk ↗ jump to hunk
---
 arch/arm64/kvm/mmu.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index a5b0dd41560f6..caa5bedc79e19 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1723,7 +1723,6 @@ struct kvm_s2_fault {
        bool writable;
        bool s2_force_noncacheable;
        kvm_pfn_t pfn;
-       bool logging_active;
        bool force_pte;
        enum kvm_pgtable_prot prot;
        struct page *page;
@@ -1853,7 +1852,7 @@ static int kvm_s2_fault_compute_prot(const struct kvm_s2_fault_desc *s2fd,
                         */
                        fault->s2_force_noncacheable = true;
                }
-       } else if (fault->logging_active && !kvm_is_write_fault(s2fd->vcpu)) {
+       } else if (memslot_is_logging(s2fd->memslot) && !kvm_is_write_fault(s2fd->vcpu)) {
                /*
                 * Only actually map the page as writable if this was a write
                 * fault.
@@ -1985,11 +1984,9 @@ static int kvm_s2_fault_map(const struct kvm_s2_fault_desc *s2fd,
 static int user_mem_abort(const struct kvm_s2_fault_desc *s2fd)
 {
        bool perm_fault = kvm_vcpu_trap_is_permission_fault(s2fd->vcpu);
-       bool logging_active = memslot_is_logging(s2fd->memslot);
        struct kvm_s2_fault_vma_info s2vi = {};
        struct kvm_s2_fault fault = {
-               .logging_active = logging_active,
-               .force_pte = logging_active,
+               .force_pte = memslot_is_logging(s2fd->memslot),
                .prot = KVM_PGTABLE_PROT_R,
        };
        void *memcache;
@@ -2001,7 +1998,8 @@ static int user_mem_abort(const struct kvm_s2_fault_desc *s2fd)
         * only exception to this is when dirty logging is enabled at runtime
         * and a write fault needs to collapse a block entry into a table.
         */
-       if (!perm_fault || (logging_active && kvm_is_write_fault(s2fd->vcpu))) {
+       if (!perm_fault || (memslot_is_logging(s2fd->memslot) &&
+                           kvm_is_write_fault(s2fd->vcpu))) {
                ret = prepare_mmu_memcache(s2fd->vcpu, true, &memcache);
                if (ret)
                        return ret;
--
2.47.3
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help