From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36547C433FE for ; Thu, 19 May 2022 23:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343678AbiESXow (ORCPT ); Thu, 19 May 2022 19:44:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343701AbiESXor (ORCPT ); Thu, 19 May 2022 19:44:47 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 509A11238A6 for ; Thu, 19 May 2022 16:44:41 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id a12so4883944vsp.5 for ; Thu, 19 May 2022 16:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=T7TMhWp0SAA5jCPI+KmjChJGEDhSNE7gjRtO2nBQMRY=; b=BzegkdqL04SDprwN3BH/yJoSzWsLHcyLmAGGCEygbOdvHy4tYEJYBiKWOptkLQozzC HyDWCA3IvrWI9y/I4CdWbk1sDNCn/9d0MLbjeECNUWs6jJoKwb6C8dLGQ0frIy+owMvD ONHfSqTfyu6HoAcMV78W6yWv3NOt4V5b+TtXodoAwFzCRyIx3dBKRQIhKfejJpFNDlSY JxhrLMvqg9MGPoYnDAxQlJZvV24y3ef+V+o+GBOiZaWeH+8UpkEP9qfU8M7zaHpNZOMx HdD4qBq8iNGMti572kJjIMhTiHehFb817O24qw59XZQ+rnuGBMn6vVQYxK1Ronei/2aV YJoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=T7TMhWp0SAA5jCPI+KmjChJGEDhSNE7gjRtO2nBQMRY=; b=PcCFs1wJE2cvH+ckLAc4tZXFLYULzDQlkn8vqeDvpMCVet7jgniZR/LkHKq9y/szvN R3ymG8wxAB7tBpLrYC8aD8sCmkwpZ32DYZstWyR216MM4Ys2WGU90Sp8SRbtPwMXWYgH ubtESZmGqjATvt/5I/FVqPPhhUicesy/FyRA7cWGWAJUf13Ex1SZ6gc4Vpiw5LNvJ6OH upvATYQ7zGPDN74whc9e+iV+V4h6K2fJEkiNnKWqcUo+lFudHVyw2t6s3ind9HtYDUaF Ns1L6uNYApzwBgRLwll+HGFSoeI1TR6FZsGRK7hUq/zkyoyO837d0f3HL9qarcMswf4R uazA== X-Gm-Message-State: AOAM5335wYhtyosQE1cqk8vvMCcX6D7UJUkZU056t9aETiJEB+zDMz6e ++uX96SDmexcMYvtsLoEbMqyoUT2307I4A== X-Google-Smtp-Source: ABdhPJyHFOCMJV+CyCoxWknfQ8NqR0JS4gDvoJu+C1UV67ZhJqkTrdelVCUD8uOqNzc2ybutuw8y7A== X-Received: by 2002:a17:902:c409:b0:161:b135:87c9 with SMTP id k9-20020a170902c40900b00161b13587c9mr7135944plk.94.1653003869609; Thu, 19 May 2022 16:44:29 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id q22-20020a17090aa01600b001cd4989ff5esm352938pjp.37.2022.05.19.16.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 16:44:29 -0700 (PDT) Date: Thu, 19 May 2022 23:44:25 +0000 From: Sean Christopherson To: Vitaly Kuznetsov Cc: Maxim Levitsky , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH v3 20/34] KVM: x86: KVM_REQ_TLB_FLUSH_CURRENT is a superset of KVM_REQ_HV_TLB_FLUSH too Message-ID: References: <20220414132013.1588929-1-vkuznets@redhat.com> <20220414132013.1588929-21-vkuznets@redhat.com> <6c9add3244d86080ccd8c3c72a37b9ee112d45b8.camel@redhat.com> <87mtfdubro.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mtfdubro.fsf@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 19, 2022, Vitaly Kuznetsov wrote: > This, however, made me think there's room for optimization here. In some > cases, when both KVM_REQ_TLB_FLUSH_CURRENT and KVM_REQ_TLB_FLUSH_GUEST > were requested, there's no need to flush twice, e.g. on SVM > .flush_tlb_current == .flush_tlb_guest. I'll probably not go into this > territory with this series as it's already fairly big, just something > for the future. Definitely not worth your time. On VMX, CURRENT isn't a superset of GUEST when EPT is enabled. And on SVM, the flush doesn't actually occur until VM-Enter, i.e. the redundant flush is just an extra write to svm->vmcb->control.tlb_ctl (or an extra decrement of asid_generation).