Re: [PATCH] KVM: x86/mmu: improve robustness of some functions

2021-01-25 Thread Sean Christopherson
On Mon, Jan 25, 2021, Paolo Bonzini wrote: > On 25/01/21 10:54, Vitaly Kuznetsov wrote: > > > > What if we do something like (completely untested): > > > > diff --git a/arch/x86/kvm/mmu/mmu_internal.h > > b/arch/x86/kvm/mmu/mmu_internal.h > > index bfc6389edc28..5ec15e4160b1 100644 > > ---

Re: [PATCH] KVM: x86/mmu: improve robustness of some functions

2021-01-25 Thread Vitaly Kuznetsov
Stephen Zhang writes: > If the name of this function changes, you can easily > forget to modify the code in the corresponding place. > In fact, such errors already exist in spte_write_protect > and spte_clear_dirty. > What if we do something like (completely untested): diff --git

Re: [PATCH] KVM: x86/mmu: improve robustness of some functions

2021-01-25 Thread Paolo Bonzini
On 25/01/21 10:54, Vitaly Kuznetsov wrote: What if we do something like (completely untested): diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h index bfc6389edc28..5ec15e4160b1 100644 --- a/arch/x86/kvm/mmu/mmu_internal.h +++ b/arch/x86/kvm/mmu/mmu_internal.h @@

[PATCH] KVM: x86/mmu: improve robustness of some functions

2021-01-22 Thread Stephen Zhang
If the name of this function changes, you can easily forget to modify the code in the corresponding place. In fact, such errors already exist in spte_write_protect and spte_clear_dirty. Signed-off-by: Stephen Zhang --- arch/x86/kvm/mmu/mmu.c | 16 1 file changed, 8