Received: by 2002:a05:6512:e85:0:0:0:0 with SMTP id bi5csp143683lfb; Thu, 23 Jun 2022 21:20:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sjPs6UlxpXMKOQb8CYE0dl/JPN0CMWrhvKmeqAxaCT5Lvwm6pf6AXpeFaD3hZVOpBynuUq X-Received: by 2002:a63:360b:0:b0:40c:2d81:9a86 with SMTP id d11-20020a63360b000000b0040c2d819a86mr10116137pga.60.1656044439558; Thu, 23 Jun 2022 21:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656044439; cv=none; d=google.com; s=arc-20160816; b=mNuvRdwlIVsMt2mmaQrimlnET+WJaps+Y0BWYFGK5QEYIYwx8I0+juiy7Fjggw5QzK WOWt0CqEOWekMxfss8c23NbNx7V9slFlURnSxLtGUEsYhy9eeJ47QOsKBiZZW0H5Za9d F2we/je4H05whIwxOdTyVN54cXA0ph4J+pUD5dg8j2/Jg1QbNmf6NGGczbEQ0D81P1hQ xmL9SlzoS8ZBu82pWIlGyYO09LqwqFV4wT0MG6w8lAhVOw4dDwqxW/NNCT6M06dvItBy ZfVE9gHguSNj5ceXepe16JNr0qJjEsLk5wjQ8gqpxD2FRWEerofSmOth6OoD8fQDJtFz m6qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4fg45r7Mxwlbepcdk6r45E0cXJNfH9JFOhT8jdSWTRM=; b=l+EpS93cVKvn3cGDehM18/yZMK/AW35SCpj5on5DZCnhg5+xCuIOGeQz26tsKHEXZe VQqhiSiOae5OOzs+wJ+PPEHoCRzrFyaumKqBZlNGz3oDaXdAiRua/Sd8/7cS8Vujsbgb qG6JsgAERctqNxMLnVVl0R2jtxtcr3oizX0yu1bU2AM5oCu2quwDvuY6KbuoJ/DSRbf7 2oBaaQYVbmwZolWDX7z7XmRTOWi/rV6vTJmNwz5gZQHZhJk6W4Q4H7r1JYkxb6ZNk/+i coUBnXEBecUAG1C4SK2/R5hxI7xUttWpvc711xtPNPyD/Y+FiOGQBCCjLbtW3KZNZdW2 E3cQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a63d007000000b0040d27389464si1407047pgf.649.2022.06.23.21.20.17; Thu, 23 Jun 2022 21:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbiFXDhd (ORCPT + 99 others); Thu, 23 Jun 2022 23:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbiFXDhQ (ORCPT ); Thu, 23 Jun 2022 23:37:16 -0400 Received: from out0-158.mail.aliyun.com (out0-158.mail.aliyun.com [140.205.0.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C1953A72; Thu, 23 Jun 2022 20:37:11 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047212;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---.OBfZx4e_1656041828; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.OBfZx4e_1656041828) by smtp.aliyun-inc.com; Fri, 24 Jun 2022 11:37:08 +0800 From: "Hou Wenlong" To: kvm@vger.kernel.org Cc: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] KVM: x86/mmu: Use 1 as the size of gfn range for tlb flushing in FNAME(invlpg)() Date: Fri, 24 Jun 2022 11:37:01 +0800 Message-Id: <52c2dc356b609474d7a92e72710b270861c1c83e.1656039275.git.houwenlong.hwl@antgroup.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only SP with PG_LEVLE_4K level could be unsync, so the size of gfn range must be 1. Signed-off-by: Hou Wenlong --- arch/x86/kvm/mmu/paging_tmpl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h index fa78ee0caffd..fc6d8dcff019 100644 --- a/arch/x86/kvm/mmu/paging_tmpl.h +++ b/arch/x86/kvm/mmu/paging_tmpl.h @@ -938,8 +938,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva, hpa_t root_hpa) mmu_page_zap_pte(vcpu->kvm, sp, sptep, NULL); if (is_shadow_present_pte(old_spte)) kvm_flush_remote_tlbs_with_address(vcpu->kvm, - kvm_mmu_page_get_gfn(sp, sptep - sp->spt), - KVM_PAGES_PER_HPAGE(sp->role.level)); + kvm_mmu_page_get_gfn(sp, sptep - sp->spt), 1); if (!rmap_can_add(vcpu)) break; -- 2.31.1