Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4848154pxu; Wed, 21 Oct 2020 06:54:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdrW6YjZRUVxKrHRDVO23eE5JPyKjmt+C9XCAiZN/rSUSXUgmchkgTNmR651uf6Mcbg0Qt X-Received: by 2002:a17:906:34ce:: with SMTP id h14mr3530196ejb.325.1603288478764; Wed, 21 Oct 2020 06:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603288478; cv=none; d=google.com; s=arc-20160816; b=KdjrSkgjg3lMrIxNKZi6aQR5REQHosDcB9Dar1Kj6gw3W4nX675iGh+4afz3S5D0e6 K4AqITBEGLHa+gxZfLTRaAMcwC3U9ooxE7GrsxwEs97kPk7ldMOxerbHOVptSB0c6IWW Y1e5dZ8+/oqQ9Cu3SnS3jzmSlQOmddurXhzxR48lRuCJ1jPe9mjtvjbhbRXEMOCd3q5A CaAs6ST/2x5ab98bMwUQ+EzEQDHcRIvRiMjMjzHWoYmb7wRfIG0qWEZiRGEAAwfG+xS2 RvLwESodYOlwke0cEDsUv+sZ83xjYiTG0vjjiLNAgJxDzhpn42kfIylnOTsi4KZmpy5Q tYgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=FEqXz7G12+BmHZNYqLH7P68s5dXdeke9n26KkMvS1JY=; b=W2OanZCunbs7QRj9X6BhMYYTRzf40NiWQyHjIIbcK1RVfvMCPpKfIAUC+Q1U36jVhW ZhUZeodhfyRaqLxmFTc6HeTB2fjhA5y0Z+28RAzhIHnGlSwCH/rIsT88EsPXuPoWRhXG 90JkMO8tzqrXZjlQpXpxuVNo2Q5PhDEe/H24tXKjiR2p3ERe8vnGNb7qMNiDs0DZZDc0 IzpEdvX8sQOyxPCTNsMUP0qk57Xi4hLKAZNcU87+9RIefHii3ynQT0XC4eYxdzckLVbs f5XsQkGu5c5NHgs1JUEiXuJD6OpsVSTCinJE87DEwGSK0e9uggA3PopVeFDwBY80uBuo jkxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DsRT9vRI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ck29si1379781edb.267.2020.10.21.06.54.14; Wed, 21 Oct 2020 06:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DsRT9vRI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2442151AbgJUMAO (ORCPT + 99 others); Wed, 21 Oct 2020 08:00:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59984 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442135AbgJUMAM (ORCPT ); Wed, 21 Oct 2020 08:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603281610; 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=FEqXz7G12+BmHZNYqLH7P68s5dXdeke9n26KkMvS1JY=; b=DsRT9vRI8+PLZV5r+AEWLFi/z9nVUc/ZqOOofVY86b50YMEeqRcZ6XDzjIBz9BpLPjxK57 0xaX4uD9QlOSF1rOj8Hm/l4GLceYugvyrdMvmpCEEEMmDjHgTbSsygPVj0VGrGalarichK 0OB0f6vBvKxFWmBsOIhms+uYqtz+TNE= 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-38-xtALwNQAPjiwQ1iXIgdKsA-1; Wed, 21 Oct 2020 08:00:08 -0400 X-MC-Unique: xtALwNQAPjiwQ1iXIgdKsA-1 Received: by mail-wm1-f72.google.com with SMTP id 13so1310802wmf.0 for ; Wed, 21 Oct 2020 05:00:08 -0700 (PDT) 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:in-reply-to:references:date :message-id:mime-version; bh=FEqXz7G12+BmHZNYqLH7P68s5dXdeke9n26KkMvS1JY=; b=Pvkcr449S7hiI6EcsTcXRmcrLiYRhTEn+yst1VjpQ4RA0fAbs/ATejJzMeM9S52lBm LjUxSG9qbVhNYECwOx8I+fT/DEXflUzAhx/0CGxFaq6sV6TX0Brb5euAmaxuQNsOo22y nfi7WfTIrZihQgH+Sg8Sn+85LoRr9tjmbv12QdGtnsuo0ypcOIErB5HZRnyVDGiZggIL SgAdAu7Yzzvc1LRVlVQfvYw7nJYO1qkaSyaE0xo4paAKYB6iWacl/Hygz6I2jG2Mlqvx ZIYKePVyIx3eWyOGU7zA8Qx0/hVdLvb4CtYM1pON3sfcFuikjBjpQhaamVv+rxSJfOqY 8vUA== X-Gm-Message-State: AOAM5301IBJRHci6P4i0b/Wkzq1abPzALlFZdilggHkKKvzVVbwWYRX9 vtR9pbUX4ppYtuCOA++YxBCUXKyt5MveJPcB5hSqSJsgxjGZs3DgnrTTu0dRrcNiy9jCPUbqvEi tKYIF6FMurKVYPeMcuStVH1lw X-Received: by 2002:a1c:f30d:: with SMTP id q13mr3126695wmq.36.1603281606856; Wed, 21 Oct 2020 05:00:06 -0700 (PDT) X-Received: by 2002:a1c:f30d:: with SMTP id q13mr3126664wmq.36.1603281606572; Wed, 21 Oct 2020 05:00:06 -0700 (PDT) Received: from vitty.brq.redhat.com (g-server-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id d30sm3601490wrc.19.2020.10.21.05.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 05:00:05 -0700 (PDT) From: Vitaly Kuznetsov To: Sean Christopherson Cc: Paolo Bonzini , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/10] KVM: VMX: Stash kvm_vmx in a local variable for Hyper-V paravirt TLB flush In-Reply-To: <20201020215613.8972-3-sean.j.christopherson@intel.com> References: <20201020215613.8972-1-sean.j.christopherson@intel.com> <20201020215613.8972-3-sean.j.christopherson@intel.com> Date: Wed, 21 Oct 2020 14:00:04 +0200 Message-ID: <875z736b7f.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sean Christopherson writes: > Capture kvm_vmx in a local variable instead of polluting > hv_remote_flush_tlb_with_range() with to_kvm_vmx(kvm). > > No functional change intended. > > Signed-off-by: Sean Christopherson > --- > arch/x86/kvm/vmx/vmx.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index 6d53bcc4a1a9..6d41c99c70c4 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -516,26 +516,27 @@ static inline int hv_remote_flush_eptp(u64 eptp, struct kvm_tlb_range *range) > static int hv_remote_flush_tlb_with_range(struct kvm *kvm, > struct kvm_tlb_range *range) > { > + struct kvm_vmx *kvm_vmx = to_kvm_vmx(kvm); > struct kvm_vcpu *vcpu; > int ret = 0, i; > > - spin_lock(&to_kvm_vmx(kvm)->ept_pointer_lock); > + spin_lock(&kvm_vmx->ept_pointer_lock); > > - if (to_kvm_vmx(kvm)->ept_pointers_match == EPT_POINTERS_CHECK) > + if (kvm_vmx->ept_pointers_match == EPT_POINTERS_CHECK) > check_ept_pointer_match(kvm); > > - if (to_kvm_vmx(kvm)->ept_pointers_match != EPT_POINTERS_MATCH) { > + if (kvm_vmx->ept_pointers_match != EPT_POINTERS_MATCH) { > kvm_for_each_vcpu(i, vcpu, kvm) { > /* If ept_pointer is invalid pointer, bypass flush request. */ > if (VALID_PAGE(to_vmx(vcpu)->ept_pointer)) > ret |= hv_remote_flush_eptp(to_vmx(vcpu)->ept_pointer, > range); > } > - } else if (VALID_PAGE(to_kvm_vmx(kvm)->hv_tlb_eptp)) { > - ret = hv_remote_flush_eptp(to_kvm_vmx(kvm)->hv_tlb_eptp, range); > + } else if (VALID_PAGE(kvm_vmx->hv_tlb_eptp)) { > + ret = hv_remote_flush_eptp(kvm_vmx->hv_tlb_eptp, range); > } > > - spin_unlock(&to_kvm_vmx(kvm)->ept_pointer_lock); > + spin_unlock(&kvm_vmx->ept_pointer_lock); > return ret; > } > static int hv_remote_flush_tlb(struct kvm *kvm) Reviewed-by: Vitaly Kuznetsov -- Vitaly