[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <af1045cb-2e53-4967-831c-5375ef1c97a2@redhat.com>
Date: Sat, 26 Sep 2020 02:39:59 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Ben Gardon <bgardon@...gle.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Cannon Matthews <cannonmatthews@...gle.com>,
Peter Xu <peterx@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Peter Shier <pshier@...gle.com>,
Peter Feiner <pfeiner@...gle.com>,
Junaid Shahid <junaids@...gle.com>,
Jim Mattson <jmattson@...gle.com>,
Yulei Zhang <yulei.kernel@...il.com>,
Wanpeng Li <kernellwp@...il.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Xiao Guangrong <xiaoguangrong.eric@...il.com>
Subject: Re: [PATCH 05/22] kvm: mmu: Add functions to handle changed TDP SPTEs
On 25/09/20 23:22, Ben Gardon wrote:
> +
> + /*
> + * Recursively handle child PTs if the change removed a subtree from
> + * the paging structure.
> + */
> + if (was_present && !was_leaf && (pfn_changed || !is_present)) {
> + pt = spte_to_child_pt(old_spte, level);
> +
> + for (i = 0; i < PT64_ENT_PER_PAGE; i++) {
> + old_child_spte = *(pt + i);
> + *(pt + i) = 0;
> + handle_changed_spte(kvm, as_id,
> + gfn + (i * KVM_PAGES_PER_HPAGE(level - 1)),
> + old_child_spte, 0, level - 1);
> + }
Is it worth returning a "flush" value to the caller, to avoid multiple
kvm_flush_remote_tlbs_with_address when e.g. zapping a 3rd-level PTE?
Also I prefer if we already include here a "stupid" version of
handle_changed_spte that just calls __handle_changed_spte. (If my
suggestion is accepted, handle_changed_spte could actually handle the
flushing).
Paolo
> +
> + kvm_flush_remote_tlbs_with_address(kvm, gfn,
> + KVM_PAGES_PER_HPAGE(level));
> +
> + free_page((unsigned long)pt);
> + }
Powered by blists - more mailing lists