lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 15/22] kvm: mmu: Support changed pte notifier in tdp MMU
From
Date
On 25/09/20 23:22, Ben Gardon wrote:
> + *iter.sptep = 0;
> + handle_changed_spte(kvm, as_id, iter.gfn, iter.old_spte,
> + new_spte, iter.level);
> +

Can you explain why new_spte is passed here instead of 0?

All calls to handle_changed_spte are preceded by "*something =
new_spte" except this one, so I'm thinking of having a change_spte
function like

static void change_spte(struct kvm *kvm, int as_id, gfn_t gfn,
u64 *sptep, u64 new_spte, int level)
{
u64 old_spte = *sptep;
*sptep = new_spte;

__handle_changed_spte(kvm, as_id, gfn, old_spte, new_spte, level);
handle_changed_spte_acc_track(old_spte, new_spte, level);
handle_changed_spte_dirty_log(kvm, as_id, gfn, old_spte, new_spte, level);
}

in addition to the previously-mentioned cleanup of always calling
handle_changed_spte instead of special-casing calls to two of the
three functions. It would be a nice place to add the
trace_kvm_mmu_set_spte tracepoint, too.

Paolo

\
 
 \ /
  Last update: 2020-09-28 17:12    [W:0.502 / U:4.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site