[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a78041a0-a987-5456-ed3f-44eb1a6022a7@loongson.cn>
Date: Thu, 19 Mar 2020 10:21:09 +0800
From: maobibo <maobibo@...ngson.cn>
To: Peter Xu <peterx@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Sean Christopherson <sean.j.christopherson@...el.com>,
Paolo Bonzini <pbonzini@...hat.com>,
linux-mips@...r.kernel.org, Vitaly Kuznetsov <vkuznets@...hat.com>
Subject: Re: [PATCH RFC 4/4] KVM: MIPS: Define arch-specific
kvm_flush_remote_tlbs()
On 03/18/2020 11:28 PM, Peter Xu wrote:
> On Wed, Mar 18, 2020 at 11:03:13AM +0800, maobibo wrote:
>>
>>
>> On 02/08/2020 06:35 AM, Peter Xu wrote:
>>> Select HAVE_KVM_ARCH_TLB_FLUSH_ALL for MIPS to define its own
>>> kvm_flush_remote_tlbs(). It's as simple as calling the
>>> flush_shadow_all(kvm) hook. Then replace all the flush_shadow_all()
>>> calls to use this KVM generic API to do TLB flush.
>>>
>>> Signed-off-by: Peter Xu <peterx@...hat.com>
>>> ---
>>> arch/mips/kvm/Kconfig | 1 +
>>> arch/mips/kvm/mips.c | 22 ++++++++++------------
>>> 2 files changed, 11 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig
>>> index eac25aef21e0..8a06f660d39e 100644
>>> --- a/arch/mips/kvm/Kconfig
>>> +++ b/arch/mips/kvm/Kconfig
>>> @@ -26,6 +26,7 @@ config KVM
>>> select KVM_MMIO
>>> select MMU_NOTIFIER
>>> select SRCU
>>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>>> ---help---
>>> Support for hosting Guest kernels.
>>>
>>> diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
>>> index 1d5e7ffda746..518020b466bf 100644
>>> --- a/arch/mips/kvm/mips.c
>>> +++ b/arch/mips/kvm/mips.c
>>> @@ -194,13 +194,16 @@ int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
>>> return 0;
>>> }
>>>
>>> +void kvm_flush_remote_tlbs(struct kvm *kvm)
>>> +{
>>> + kvm_mips_callbacks->flush_shadow_all(kvm);
>>> +}
>>> +
>> Hi Peter,
>
> Hi, Bibo,
>
>>
>> Although I do not understand mip VZ fully, however it changes behavior of
>> MIPS VZ, since kvm_flush_remote_tlbs is also called in function
>> kvm_mmu_notifier_change_pte/kvm_mmu_notifier_invalidate_range_start
>
> I'm not familiar with MIPS either, however... I would start to suspect
> MIPS could be problematic with MMU notifiers when cpu_has_guestid is
> not set. If that's the case, then this series might instead fix it.
yeap, from my viewpoint this series actually fix it when cpu_has_guestid
is not set, previous kvm_flush_remote_tlbs function do nothing actually
for MIPS VZ machine without cpu_has_guestid flag.
>
> Thanks,
>
Powered by blists - more mailing lists