Message ID | 20230105095848.6061-1-jiangshanlai@gmail.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp218601wrt; Thu, 5 Jan 2023 01:58:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvi60HXbUOb5RKHbT6jn7lT9Zvg/ADzeXAYH958D9axsRtS5ERflIlEY0epR2rSNgcNAyQX X-Received: by 2002:aa7:9156:0:b0:57e:f1a2:1981 with SMTP id 22-20020aa79156000000b0057ef1a21981mr56875849pfi.8.1672912738488; Thu, 05 Jan 2023 01:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672912738; cv=none; d=google.com; s=arc-20160816; b=wXDmOXcSr8/ycsHBaZd2Ob5e2YmZJlqSKCfkNsfWNgY7eUw//8RyiTXLkwWtV9RI3Z AMYTwPV8OFyeBML8CrzkIfxxpVRlH4A4vVwaNkP1ztu7nxhVho98zHFinRrmRIKYqETo fuzT9h/WPnF8LnHvhPFn2GxWt0MYU04lQUWBcJUHRPAy9FkyS1PWVyK8tXyjqEP+p0kd 0BbgNcF21+wzPAcSppJGCBV4zVyhrGuFkiIASFH1GxNXrSxM2LB6XL9cQyJ7fiMpr0Fl IXKr59tJTm4IL6HMbE1EO+GbDSXuWlVLFcb0vPw/dbUIIfDuXJVpSVRkdWWHkZsEltDh 6Rbw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=+8r6dwMdHsrpTUxza2Gmd/q/3+CXwtM/BlaVF6ITa+4=; b=hwUFa4TXs3jIffRVR4vgwOVfBxbmdd28X5o2muFOpuqAygqRUTktb21zmKhsFhbcB9 2+9PLpz2zuBNRlMnRQwObBgYVsITtHAhv98p+cpnSX7BTacxjwuRxozXz3TPwsAYWnf1 wciobGphfpe6xHKsbwyZf8J+IvlHuTDoO6CxQyWlXWPOF10wCk1s5M3waqeWSzC/7OUa rYaNPlf0nxIRyEvyDAflPrSd872vWluxnKZ3XDGtap3KNEp5DtmBESWYY5dxnE/InwTP JqaVzx8ecSQYbBLIhK4M3fJt6Wx3F8HjHj4orNt3AabU9A7t3lBG5j8ylUZFDMyuAwKZ eh/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YU4SsLFo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v63-20020a626142000000b005780084676asi34752259pfb.367.2023.01.05.01.58.41; Thu, 05 Jan 2023 01:58:58 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YU4SsLFo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232115AbjAEJ5w (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Thu, 5 Jan 2023 04:57:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbjAEJ5f (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Jan 2023 04:57:35 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 456854FD63 for <linux-kernel@vger.kernel.org>; Thu, 5 Jan 2023 01:57:35 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id cl14so2856464pjb.2 for <linux-kernel@vger.kernel.org>; Thu, 05 Jan 2023 01:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+8r6dwMdHsrpTUxza2Gmd/q/3+CXwtM/BlaVF6ITa+4=; b=YU4SsLFo2FTpo+ODl2F714/MqxXRaUdwFykAPTgTx3Xh24liNZx3ocfZAzjFhl4PgG gBrn5ptGmxAVVRzs2p/7BXPefLpw5CWnpkq4KCShlY+J27aIJhIzDZ/Li2izwVxH7yMi EgtRg00GwV174un9BFcCxULRN0vWMP8jqZtOFl/cgQHmmfurb+1jkHD3jXT/gxNLXKPl mdZ8pf7r21DYHnJGCIb559KspPGAViutpqsk0jCOq19zpdARPAi/oULKZPRDnK0Wf5LP KFQyB98SL2TJ3CXepLuQ6189JYcPeydsypaBGqSn/TVJj6LSoGqSEpYuA+OcG+4Br27t /zCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+8r6dwMdHsrpTUxza2Gmd/q/3+CXwtM/BlaVF6ITa+4=; b=tnbqp9ZNp2Tw/HUziadIj/zrt7w5GShX4tlAZo5V3gHfwrVJqKbZg1zyRHQbUQQcas y7p/9UPx6Rz19l9ZTH5Gig+eydBgpqzEt9PfTh6QLKms9qu/8QNb0NkrgOlvGghskBWy qFk2fpKaFeeirxBiTqDHN4FM6xJVZwBMMXvXISOth+0M9JfbNMOCMQhzourYn3eFQ2Gu zGRAazsnBdr/hfCw8Prw5UXJMOsxR6f1zqwXXbSOAGiF01cytYDciQ4Gky+E7o1QLrHd 7rTqkBF0tCO8uEb7umYV6HWTQn20dyktF3QZ76kqRDIqTNE0HAU8MNDJJKkXA3eWgG6/ 0eEw== X-Gm-Message-State: AFqh2kqgm2jQAKuaVMsrPQXH44u7wsoyztEvpa1/dapPL7atYjUWHJIx ZlFMVsKFgjQfM3SvHZLDtkQdYVg5wAs= X-Received: by 2002:a17:902:c382:b0:192:4e35:e048 with SMTP id g2-20020a170902c38200b001924e35e048mr52579727plg.35.1672912654443; Thu, 05 Jan 2023 01:57:34 -0800 (PST) Received: from localhost ([198.11.176.14]) by smtp.gmail.com with ESMTPSA id c18-20020a170903235200b0017ec1b1bf9fsm6966985plh.217.2023.01.05.01.57.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2023 01:57:33 -0800 (PST) From: Lai Jiangshan <jiangshanlai@gmail.com> To: linux-kernel@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com>, Lai Jiangshan <jiangshan.ljs@antgroup.com> Subject: [PATCH 0/7] kvm: x86/mmu: Share the same code to invalidate each vTLB entry Date: Thu, 5 Jan 2023 17:58:41 +0800 Message-Id: <20230105095848.6061-1-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754176147940248894?= X-GMAIL-MSGID: =?utf-8?q?1754176147940248894?= |
Series |
kvm: x86/mmu: Share the same code to invalidate each vTLB entry
|
|
Message
Lai Jiangshan
Jan. 5, 2023, 9:58 a.m. UTC
From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
FNAME(invlpg) and FNAME(sync_page) invalidate vTLB entries but in
slightly different methods.
Make them use the same method and share the same code.
Lai Jiangshan (7):
kvm: x86/mmu: Use KVM_MMU_ROOT_XXX for kvm_mmu_invalidate_gva()
kvm: x86/mmu: Use kvm_mmu_invalidate_gva() in kvm_mmu_invpcid_gva()
kvm: x86/mmu: Use kvm_mmu_invalidate_gva() in
nested_ept_invalidate_addr()
kvm: x86/mmu: Reduce the update to the spte in FNAME(sync_page)
kvm: x86/mmu: Move the code out of FNAME(sync_page)'s loop body into
mmu.c
kvm: x86/mmu: Remove FNAME(invlpg)
kvm: x86/mmu: Remove @no_dirty_log from FNAME(prefetch_gpte)
arch/x86/include/asm/kvm_host.h | 7 +-
arch/x86/kvm/mmu/mmu.c | 177 +++++++++++++++++----------
arch/x86/kvm/mmu/paging_tmpl.h | 207 ++++++++------------------------
arch/x86/kvm/vmx/nested.c | 5 +-
arch/x86/kvm/x86.c | 2 +-
5 files changed, 176 insertions(+), 222 deletions(-)
Comments
On Thu, Jan 5, 2023 at 5:57 PM Lai Jiangshan <jiangshanlai@gmail.com> wrote: > > From: Lai Jiangshan <jiangshan.ljs@antgroup.com> > > FNAME(invlpg) and FNAME(sync_page) invalidate vTLB entries but in > slightly different methods. > > Make them use the same method and share the same code. > > Lai Jiangshan (7): > kvm: x86/mmu: Use KVM_MMU_ROOT_XXX for kvm_mmu_invalidate_gva() > kvm: x86/mmu: Use kvm_mmu_invalidate_gva() in kvm_mmu_invpcid_gva() > kvm: x86/mmu: Use kvm_mmu_invalidate_gva() in > nested_ept_invalidate_addr() > kvm: x86/mmu: Reduce the update to the spte in FNAME(sync_page) > kvm: x86/mmu: Move the code out of FNAME(sync_page)'s loop body into > mmu.c > kvm: x86/mmu: Remove FNAME(invlpg) > kvm: x86/mmu: Remove @no_dirty_log from FNAME(prefetch_gpte) > > arch/x86/include/asm/kvm_host.h | 7 +- > arch/x86/kvm/mmu/mmu.c | 177 +++++++++++++++++---------- > arch/x86/kvm/mmu/paging_tmpl.h | 207 ++++++++------------------------ > arch/x86/kvm/vmx/nested.c | 5 +- > arch/x86/kvm/x86.c | 2 +- > 5 files changed, 176 insertions(+), 222 deletions(-) > > -- > 2.19.1.6.gb485710b > Hello Ping. Cheers, Lai