Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp752919ybh; Wed, 18 Mar 2020 08:30:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt8foFLq88NRGb22V0OGBtwMmb6MqzZZLgxGtstSjryqC/idvs6SA4DImw7ZEI1vqXlfARC X-Received: by 2002:aca:1c0c:: with SMTP id c12mr1392662oic.104.1584545424106; Wed, 18 Mar 2020 08:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584545424; cv=none; d=google.com; s=arc-20160816; b=cPVcyIljjOAWr1d3Objg7CJ8Cml13xsLv/gfYpzE6V6myUaZQiyByVzMd0pJcIaZTc 40ZKoH/8Uk4tMado9BbRCJ1e3Vos9qwy/Du9Ur88HLhT8VHw7N4dDZ4F+3grS5M+MPyE 2g07oFpjVprOjuwWDHo54a8EpZGSMDv45lR1W/7pFs/J2qAdocgcfFdny0WRRJJ5Z2CE 9gm60BWXZfGTzn7of7JtHuWfpI/B0/9/IVKZDHlb+MOd0aar7TslSwL3O0sAhgbHIzKO ebBDrdBnCtD+M3Rq09ZVt0N58h8DJcmYi5U7o0e7iLPgHJMznpiDE1kD2qpQIt/slH/L PMYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VUCh0wftalNEjNdcnFsloNUT1bkuB14BiJcAimoQrqM=; b=A3zbQNS6/TIT+PscVaHukcN9kb+ltnMeOVZNAbcZmdS97ffec6srqOoSa17tADfDLB j5WUREFtfuFzn56BgZgR3zCcgV5t5v9/9h5f8VImioQGLlrdVnsf2XndG0lMWkigYokU F7raa0CdJOQkO9uDrEx9l0RnlMLZY3vZIA1g78Xm1XkKQhilLnKR+s4lX2oPNbBl5+ZW VJ3kWRZApjBLOPsGKrP5LONJQgwJw60e4X8C4v+lsehnJsTXxzVPFZ71xWsfI5bH8Lkf kEHARljs9TaoJVuWHEGi2rJbs3/LXabz8oD6SbgiKIMo7yaYXHfk7Blu1lcolIOoRZyt OQUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FJZLVPVw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si3417877oij.235.2020.03.18.08.30.09; Wed, 18 Mar 2020 08:30:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FJZLVPVw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbgCRP2r (ORCPT + 99 others); Wed, 18 Mar 2020 11:28:47 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:29500 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbgCRP2q (ORCPT ); Wed, 18 Mar 2020 11:28:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584545325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VUCh0wftalNEjNdcnFsloNUT1bkuB14BiJcAimoQrqM=; b=FJZLVPVwM9sxinJZPM/+apOJKvvsEkOOyS3GoeVFkkKeujwnU+YOS1r4a+TFQSnsRouWHF Xrt/cTIF7hTN5QQrXnAONodLbUvT7NmADEJEstbdh9ni9dnJqn2w99QqYXfZJ6SkvACRyI suDEjptPlEaZILKbyyf4c+gge5YaK8A= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-5JXZHwKXPpCREUrxMlRxjg-1; Wed, 18 Mar 2020 11:28:43 -0400 X-MC-Unique: 5JXZHwKXPpCREUrxMlRxjg-1 Received: by mail-wm1-f72.google.com with SMTP id z16so1188954wmi.2 for ; Wed, 18 Mar 2020 08:28:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VUCh0wftalNEjNdcnFsloNUT1bkuB14BiJcAimoQrqM=; b=VPzXiAPdCXHko/+RYBXr/GRc5shHi7zrQ8TtoZWOJECZV7niAU/IljnN1VhS0dVP4A 7tYb/27No+ywz80yQQhAEwNfsSBxvIKDLLL3BhbYpTUidl+0svYWGz5W0br3ok4X7nBP mOrjMZmHjsTtT1dHiKdqH2huZss5ih1VpHqkhtXBmxZYEvbTN10oYxx5DgJnrut0kK2A vOh6k4KhlNmTZEtMlHVb8mUFtyhAGeq8G0ZdRgmZ13O8rkL06DR4G3j50G5AcINCOrS1 3E9jvb1a3StPqxDXl6OR34E/QiSF5sTYSilH3WwyoP6rgqoPWJlF1BJBNAcKNBjxhjrM irDQ== X-Gm-Message-State: ANhLgQ0V8vEO4M3/otnTdqVMBITcmJhnopLTEXcpDKW5E3ewfWAE9xvW S+LzO+pq+KUigN9HEf0c9Wbupm3SP/pP6l+2adV8Q8tkcx82F0ZpKNSn09KOK80mWDwhSGcIH/b W9FCoQVwECfVowcHqGXO/dPI4 X-Received: by 2002:adf:9dc3:: with SMTP id q3mr6070603wre.261.1584545322303; Wed, 18 Mar 2020 08:28:42 -0700 (PDT) X-Received: by 2002:adf:9dc3:: with SMTP id q3mr6070584wre.261.1584545322057; Wed, 18 Mar 2020 08:28:42 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id b12sm9676686wro.66.2020.03.18.08.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 08:28:41 -0700 (PDT) Date: Wed, 18 Mar 2020 11:28:37 -0400 From: Peter Xu To: maobibo Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , Paolo Bonzini , linux-mips@vger.kernel.org, Vitaly Kuznetsov Subject: Re: [PATCH RFC 4/4] KVM: MIPS: Define arch-specific kvm_flush_remote_tlbs() Message-ID: <20200318152837.GB26585@xz-x1> References: <20200207223520.735523-1-peterx@redhat.com> <20200207223520.735523-5-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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. Thanks, -- Peter Xu