Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1104296ybv; Fri, 7 Feb 2020 14:36:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyIny297U8Wh4Esp9WV0xjg7cTckDIkJt5GsvzrQ3/ytLutWjD3/JtwhDIb4LKVnRVdbZch X-Received: by 2002:a54:4e8d:: with SMTP id c13mr3559283oiy.27.1581114991576; Fri, 07 Feb 2020 14:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581114991; cv=none; d=google.com; s=arc-20160816; b=HAU1l55CZx0TDHasDCcZK47iYTXXiTgg9fLbZYQCFLqF28Eo1Ru35zoo7guIJDUVeb X5htGjdlRPpEOOv6yMT1ZToJeT391yQPP3mPI0VABIODnX0BbTTgK+MxI/a5vkoRooKd WWYnZgHJNUbv3LlVWBnR4VI8u6sssYkwSNLU6dnyJg/v1TlAMfujYGavgyVB4BiWSL6T JAmD5dhjl0ZOY6iNt6llA04pm62R8eDwtyMOsCXkAJ8cPxNIXIpKC1hmdWszUm6gQYN8 E2XfMIQ96cFAL1NPBrk7UH4QEGuVXHGf4ISII5SrwvSsS9BHGUg0iTU6O+taESZ99+kd Nk4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ugZBz7enuCINLO2hCs0M9spDUSXUeBZ8X9fYPkjTl9M=; b=w4VpLxWne1eNAHUlyUZTnqFNkIFZ2iWA6F5+yfgYZ/6eMUSeZvVSKI9yNM7iKWTtmh TJRj50mSAaKFZ99St0wpkFMkCRHNf4m4/cbzTujlElEzhN3idY764ib9gS271F9LOvKg yPECtSISpm/ncUB9HIZ1XHGUfTzd+qwgSF0VWmJnF9/K6mSQiMowgXtyC6rQvce6bLoF iXJnQ31g6clKYDX1MTXm8msv3G7l5Qr7f7oSF5plNxH3s5YBmU/T8xD5ppU3F7t+N+Ct x/Svg0JIGQ7V+YnnTEhFJhREpeI1U1aJ8Nr3S79L4zIl36GqgiasfFuwp07VFAHB9csG 4VYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IkHEsWcQ; 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 r4si401301otq.188.2020.02.07.14.36.20; Fri, 07 Feb 2020 14:36:31 -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=IkHEsWcQ; 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 S1727195AbgBGWf1 (ORCPT + 99 others); Fri, 7 Feb 2020 17:35:27 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:34858 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727031AbgBGWf0 (ORCPT ); Fri, 7 Feb 2020 17:35:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581114925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ugZBz7enuCINLO2hCs0M9spDUSXUeBZ8X9fYPkjTl9M=; b=IkHEsWcQUKMpeKWLikQTM2i19H+KWkWuzinewAqA5nXJ9MOOGXdAN8Qs2lr8+akPfS+rci 4MxGVqsoAvk1cm/BdJgePTR9scGeKpJ3sm17riGvoFq/snT9dyiOHydvbXhB8Hqg0im1Y0 yUPEtW+qI1pnUoh5Hh8LOsaymQC2FFg= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-rJzQ-TRFOfO9w3tcsfH12g-1; Fri, 07 Feb 2020 17:35:24 -0500 X-MC-Unique: rJzQ-TRFOfO9w3tcsfH12g-1 Received: by mail-qk1-f200.google.com with SMTP id a23so487147qkl.7 for ; Fri, 07 Feb 2020 14:35:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ugZBz7enuCINLO2hCs0M9spDUSXUeBZ8X9fYPkjTl9M=; b=QNwX6P2lfQDK/6dVMNOqib2BFY/LhS+wWPsP2ok2/qZOQik4VUYvMbiMu7NAHuS0am N9LQ5dMmxLU8q6EVBEBqSeJgChu28VCaFXCRViWCbhRyGAK3kte0Hzr0WliccbMZr5Zz KSmFeYSsiaxEgon2ZzAT4CeNwC7DEkX2SYDeuYKZeccVxPOwMcpRCXGV8PK3rA09zYIP OpFZFbD24Jp0kYoUxcivOcVzmrpRsFcPj2Zkqic9zBFI+3N30eH3nOWd7lADTyEKJijG ek+y4QEZzur1E27s7c/MxriOav6ZKI3r/kyiyMcj62uVcHsdOX4IvrHLKRM493ovy/N8 qbCA== X-Gm-Message-State: APjAAAWBrvw8paGdNMKdAeqkgs61aDR6qugy1kP29SimB4H4FBdQOTyZ DEcPKaF7pAnRT0M/ybqF9LXRW79NP97YAb/jJErANUTUvMEAksn+ttzU8Mpp+iuuWyrFhR0rHRM 6SYiIBrC4RmDnxZEOcuJH6spw X-Received: by 2002:ac8:1205:: with SMTP id x5mr598703qti.238.1581114923526; Fri, 07 Feb 2020 14:35:23 -0800 (PST) X-Received: by 2002:ac8:1205:: with SMTP id x5mr598684qti.238.1581114923289; Fri, 07 Feb 2020 14:35:23 -0800 (PST) Received: from xz-x1.redhat.com ([2607:9880:19c8:32::2]) by smtp.gmail.com with ESMTPSA id u12sm2178736qtj.84.2020.02.07.14.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 14:35:22 -0800 (PST) From: Peter Xu To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Sean Christopherson , Paolo Bonzini , linux-mips@vger.kernel.org, peterx@redhat.com, Vitaly Kuznetsov Subject: [PATCH RFC 0/4] KVM: MIPS: Provide arch-specific kvm_flush_remote_tlbs() Date: Fri, 7 Feb 2020 17:35:16 -0500 Message-Id: <20200207223520.735523-1-peterx@redhat.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [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 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