Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp243192ybd; Tue, 25 Jun 2019 20:35:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwM1/U/Nh7NP1KGstF3bQbCIuszH8QP2TjmyixQKWnMcSvCKLq83OYcC3t3M9K6v4o38Erz X-Received: by 2002:a17:90a:20c6:: with SMTP id f64mr1743996pjg.57.1561520149873; Tue, 25 Jun 2019 20:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520149; cv=none; d=google.com; s=arc-20160816; b=HQR+T+IgXUNS4jaEPg44q67GmuQi1Ss7F4sYTFz5gd04Jip2isrEPr2X32hvmQFlof JURncMe2cyvINNgDXb8xt6pUZrF+EYs/32EpCZIffPfig5+uPrFVK7z8RY9NodZahZMy vmMm0sXCTWtl2v8PejTAB8dlj5elj+nJ1nIMHypRwjmdtpMY9SZOUaAK/8B2w2oBFWrD ZTkO15d5xSf8lOaGAcmi0LImzhMwJ4JY30ej9aUwPpwIHF9hk0HF31CrTwyfJm8/CF9D 5joox2/aiI+nM8f6AqEiEu2rAzwDPq6QL8yE1uedCbPfYVVwptIv7Ika6eSriMSc8MYM mxmQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=eNueNlOjnwAtwYRgKGRQtY07QxMhYArr0FusDqZrQIE=; b=b5P4em+n2OCzrYqiK7DH/U8Fg/hMWfGKEW32je6jSww3s2jMP0IcnCp4+fNVFUA8xA a7k0X4/LWZ75XCqnzSbaHRbU58OsRxiVztgHrPJr9POgi4g6v6mKR8Tg92IQRdt5NxNr owmKCcN5RDX6rIiS6kCl40Wz70gSXXccDP+IJOdeZko9iRTVtCpVWcDwaDr6x6dQxQ57 cEvhPoyPPl0NepbPFcYy2jpgjV5tuV/aFDZ+Tn7WQ0yEc3b3x1ULKruQIGknbn6F8BeI pWSMMpZWsRrRuWSqaod1X1HgCqTEScrnHEb/V4a2Nc61g85+1EUmqvdS+sABBkgBSeDX coQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WE58dK3c; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si1959688plg.136.2019.06.25.20.35.32; Tue, 25 Jun 2019 20:35:49 -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=@kernel.org header.s=default header.b=WE58dK3c; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726508AbfFZDf2 (ORCPT + 99 others); Tue, 25 Jun 2019 23:35:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:46434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFZDf2 (ORCPT ); Tue, 25 Jun 2019 23:35:28 -0400 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5CD8220645 for ; Wed, 26 Jun 2019 03:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520127; bh=bwu3JRlFer6tfX9zJIfIQ3eGTj7LyoViGNSc3TpVHm8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WE58dK3c6MNpnTrS4KSJWik2GvESmqMTeagxMaC8n8fZVsXqOhTRbSE+b6G+zmuAl PDMkTukU98Ue+cYhuXEnR4lgQHD5JaeNV7j9TsgLPQK1OmJw81wwx1hDPP293Ci8z6 nS9R+PbHInk//CeqpJJYUqDPB4kFAPh1XswQ71T4= Received: by mail-wm1-f44.google.com with SMTP id w9so3579146wmd.1 for ; Tue, 25 Jun 2019 20:35:27 -0700 (PDT) X-Gm-Message-State: APjAAAUDZh2mf256CTfbv0taNcOZnFxhAvR4SgYWcDU2czk7UqO+NxAV Umlvgnqvz7qQoTfntheE6BvUzJxeNPF693SwUWflDQ== X-Received: by 2002:a7b:cd84:: with SMTP id y4mr755114wmj.79.1561520125983; Tue, 25 Jun 2019 20:35:25 -0700 (PDT) MIME-Version: 1.0 References: <20190613064813.8102-1-namit@vmware.com> <20190613064813.8102-7-namit@vmware.com> <401C4384-98A1-4C27-8F71-4848F4B4A440@vmware.com> In-Reply-To: <401C4384-98A1-4C27-8F71-4848F4B4A440@vmware.com> From: Andy Lutomirski Date: Tue, 25 Jun 2019 20:35:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6/9] KVM: x86: Provide paravirtualized flush_tlb_multi() To: Nadav Amit Cc: Dave Hansen , Peter Zijlstra , Andy Lutomirski , LKML , Ingo Molnar , Borislav Petkov , "the arch/x86 maintainers" , Thomas Gleixner , Dave Hansen , Paolo Bonzini , "kvm@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 7:39 PM Nadav Amit wrote: > > > On Jun 25, 2019, at 2:40 PM, Dave Hansen wrote: > > > > On 6/12/19 11:48 PM, Nadav Amit wrote: > >> Support the new interface of flush_tlb_multi, which also flushes the > >> local CPU's TLB, instead of flush_tlb_others that does not. This > >> interface is more performant since it parallelize remote and local TLB > >> flushes. > >> > >> The actual implementation of flush_tlb_multi() is almost identical to > >> that of flush_tlb_others(). > > > > This confused me a bit. I thought we didn't support paravirtualized > > flush_tlb_multi() from reading earlier in the series. > > > > But, it seems like that might be Xen-only and doesn't apply to KVM and > > paravirtualized KVM has no problem supporting flush_tlb_multi(). Is > > that right? It might be good to include some of that background in the > > changelog to set the context. > > I=E2=80=99ll try to improve the change-logs a bit. There is no inherent r= eason for > PV TLB-flushers not to implement their own flush_tlb_multi(). It is left > for future work, and here are some reasons: > > 1. Hyper-V/Xen TLB-flushing code is not very simple > 2. I don=E2=80=99t have a proper setup > 3. I am lazy > In the long run, I think that we're going to want a way for one CPU to do a remote flush and then, with appropriate locking, update the tlb_gen fields for the remote CPU. Getting this right may be a bit nontrivial.