Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1121579ybv; Fri, 7 Feb 2020 15:01:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwKa9Gp7S1IWcrys4CasXduhts7P39L/xrO9DDHYqZ741AxA1LM/r1bH6XD9hFvfsOerl2U X-Received: by 2002:aca:fcc1:: with SMTP id a184mr3553360oii.36.1581116503439; Fri, 07 Feb 2020 15:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581116503; cv=none; d=google.com; s=arc-20160816; b=J8l6IMArEl3E1p/2MyEsEkF/kNkGBS17SmbkIMrcHf+IGrN2OtIbxJzc6cIVLINCfO 4wfBAHJ12tCCbIQNC0YtyxOyj4Rh7EIal6k8V9UHw+g1zQFXFgNDD/AG6AQc7NcReG3l +q771sIvWCYs+YmbBrzh8rv693A2OV9h2jdfAh2jowc5gcjARkrsJ7bjhYtvJ5ulwqzD Nou1ghMfY9OKWz2T8t4AXANmRMRbKjiR/oDsoSlqzJQc2IJm0EPSKy6qoZNxER1uoeGM 6PV1sB9W0FOi/s0ZC+r66WbeV9thZ/ST3AwyFIZmuYQIhNJEtKCPUtSICfOWHdldsG3i Eq+g== 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=Mg3ZsC4pgFdFBM7wdlAk9wteMT5/edAs8oS1GJ/WtPQ=; b=Et98chz6LL6JV8hV1lP+Lh0koK3rEY8xXidvzLCRgN0SQ7iqZlRQDTBR9cHtMk9p1R tZEnuQq9mH9+tv8mqrDeachKR9M4/fr56s3cDYVtFEJyyr1Nex9QgDVbqM5BEuC8PJJH y3Y/cXNo1zBRXJ7GHt0LCGFBvI24mv2fk0hKFa+P21PuTeHCX2IexqryZP0/ehkd2dp4 ORFrHx7nKD4P8UAI+VWqaKczx74owK6Q7y1VwlnHxwaZNlLTCyxPVJifyTSjfq6k0+d5 vOENfFOlFhfT3/9hvbGJq/nMGFq12DOlV/5gRlzEjo5GGxF2Ea3vZ402VlpsW1+3UH1W j0nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Np9/FvrN"; 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 r66si4696814oie.255.2020.02.07.15.01.31; Fri, 07 Feb 2020 15:01:43 -0800 (PST) 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="Np9/FvrN"; 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 S1727144AbgBGXA1 (ORCPT + 99 others); Fri, 7 Feb 2020 18:00:27 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53364 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727048AbgBGXA0 (ORCPT ); Fri, 7 Feb 2020 18:00:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581116424; 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=Mg3ZsC4pgFdFBM7wdlAk9wteMT5/edAs8oS1GJ/WtPQ=; b=Np9/FvrNGxhL80eslAlCFgn2asYw83e+Kky1dmMqjPUY4mkCRloqSoYK5GB32+vJiLHDOM ASCJ/0wy5kmFr+Lhegk03pgqM2AujdzQ+ETxIRSazp5O6tG/pbZxDICxO4mmkHzIFSecOS Urswv6cU9sL9jwxo8ShRaF7tKqzvzqM= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-j2k62M8CPqiY4Zdugrg8uQ-1; Fri, 07 Feb 2020 18:00:21 -0500 X-MC-Unique: j2k62M8CPqiY4Zdugrg8uQ-1 Received: by mail-qt1-f199.google.com with SMTP id e8so571591qtg.9 for ; Fri, 07 Feb 2020 15:00:21 -0800 (PST) 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=Mg3ZsC4pgFdFBM7wdlAk9wteMT5/edAs8oS1GJ/WtPQ=; b=Nyw1ccuF4A6q+zcJj49jJp7nudmgQNaTk05gcNW26Fci0irSB8W+KjDHt1M01qYZRG UdlSTkHyfMd6z5DDfzGdiXMmBo/65uRGrEHsDuUKBDgBazS+xkg8+/6oCYBKz/W4wvwO KxlUSY4b/OmsmwM5ukMD7h0ik89bkvz1PDN8peqxsSVZ8pK7QsBf4DNuzePZxAsS566A DytdFpOsdOApvYYN2U3sMWktTcaVvTRKmF28o24gTBmul4e9rxKZ2kOb1YRTNZudSkkd brD1VjTdjCRW6TJD2kRakRKQQrjybLRpNayPNFisV5G675hsWrwrtGWSEwO0171gBC2Y h/Rg== X-Gm-Message-State: APjAAAWBvdV3c5Zg84VQym1YfacAoaml6jIjY3b86iu1gd4rVo6Fsdv5 S0Sn2HS9Bupfo5fHkObbi7EJgWaMNMjbuF3CKLiultNL9pTBlY3Yb3wqoad3k2SnOIjNydsLben GJdETQY/GIF97XTSFUAIWCk89 X-Received: by 2002:a05:620a:4e:: with SMTP id t14mr1267815qkt.396.1581116420705; Fri, 07 Feb 2020 15:00:20 -0800 (PST) X-Received: by 2002:a05:620a:4e:: with SMTP id t14mr1267793qkt.396.1581116420453; Fri, 07 Feb 2020 15:00:20 -0800 (PST) Received: from xz-x1 ([2607:9880:19c8:32::2]) by smtp.gmail.com with ESMTPSA id g201sm709092qke.110.2020.02.07.15.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 15:00:19 -0800 (PST) Date: Fri, 7 Feb 2020 18:00:15 -0500 From: Peter Xu To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Sean Christopherson , Paolo Bonzini , linux-mips@vger.kernel.org, Vitaly Kuznetsov Subject: Re: [PATCH RFC 0/4] KVM: MIPS: Provide arch-specific kvm_flush_remote_tlbs() Message-ID: <20200207230015.GI720553@xz-x1> References: <20200207223520.735523-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200207223520.735523-1-peterx@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 07, 2020 at 05:35:16PM -0500, Peter Xu wrote: > [This series is RFC because I don't have MIPS to compile and test] > > kvm_flush_remote_tlbs() can be arch-specific, by either: > > - Completely replace kvm_flush_remote_tlbs(), like ARM, who is the > only user of CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL so far > > - Doing something extra before kvm_flush_remote_tlbs(), like MIPS VZ > support, however still wants to have the common tlb flush to be part > of the process. Could refer to kvm_vz_flush_shadow_all(). Then in > MIPS it's awkward to flush remote TLBs: we'll need to call the mips > hooks. > > It's awkward to have different ways to specialize this procedure, > especially MIPS cannot use the genenal interface which is quite a > pity. It's good to make it a common interface. > > This patch series removes the 2nd MIPS usage above, and let it also > use the common kvm_flush_remote_tlbs() interface. It should be > suggested that we always keep kvm_flush_remote_tlbs() be a common > entrance for tlb flushing on all archs. > > This idea comes from the reading of Sean's patchset on dynamic memslot > allocation, where a new dirty log specific hook is added for flushing > TLBs only for the MIPS code [1]. With this patchset, logically the [1] https://lore.kernel.org/kvm/20200207194532.GK2401@linux.intel.com/T/#m2da733d75dab5e54e2ae68de94fe8411166d6274 > new hook in that patch can be dropped so we can directly use > kvm_flush_remote_tlbs(). > > TODO: We can even extend another common interface for ranged TLB, but > let's see how we think about this series first. > > Any comment is welcomed, thanks. > > Peter Xu (4): > KVM: Provide kvm_flush_remote_tlbs_common() > KVM: MIPS: Drop flush_shadow_memslot() callback > KVM: MIPS: Replace all the kvm_flush_remote_tlbs() references > KVM: MIPS: Define arch-specific kvm_flush_remote_tlbs() > > arch/mips/include/asm/kvm_host.h | 7 ------- > arch/mips/kvm/Kconfig | 1 + > arch/mips/kvm/mips.c | 22 ++++++++++------------ > arch/mips/kvm/trap_emul.c | 15 +-------------- > arch/mips/kvm/vz.c | 14 ++------------ > include/linux/kvm_host.h | 1 + > virt/kvm/kvm_main.c | 10 ++++++++-- > 7 files changed, 23 insertions(+), 47 deletions(-) > > -- > 2.24.1 > -- Peter Xu