Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp636992rwl; Thu, 5 Jan 2023 02:20:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXu5zE7zfD4jjsfb4mjdEQlruN3aXC4C4Q+NecrWxvDwCBUTpLXph0v3+vFhYk2nqhpUzkIN X-Received: by 2002:a05:6a20:c1a5:b0:b4:833b:7f03 with SMTP id bg37-20020a056a20c1a500b000b4833b7f03mr17020426pzb.32.1672914043279; Thu, 05 Jan 2023 02:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672914043; cv=none; d=google.com; s=arc-20160816; b=qA5Tz5YMrAsnQvfbxmbrUKLiQWwQHST1iFY6c4NEmLqo6SwLvb/ebE6qvkJVte9N/K +QzSv2YEQk6FGvbK8TFE47h42kUbEoBRfrKd5PUMVj3zYnu4OdL61u2v+Z5L2NU7ODDj dzcxplaJuOAWNTVnpt2DOR8BmVE1+rkOXGlGu8tHuYNTpnSWUPvcFhyZbFF3CSAEjW56 NGm36dVXXs2AoSaIAtwgXE/CrzzRkMWzsntcHz/uw8a/qPZyZwM7EKoFtGck1Qv2/LIN QgmUszm/zg12ULl2H2lUxQPsomTpp5ZQwB7eGIimo6aPWH0kG0mgOmjPawJrOueOUPP3 mkoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zzFihM3brSUyhj9EQhpuT0935H6SDBtRIpGFGva+eS0=; b=kJy+X46AYG4RuAZ5KFXmRvZElChfqylV6tOLHGM9M6Bk7Gj5s/RTDvbglFytmGI18a bpNNM38Fa8vNgJsgc+tPNwOi+eqassb02kiNkye72d3qOYRHuG4mXJ9XPeTCtnkktqVJ uIsG5c/Me7ZEEuWL2rOMWg0tPzHoRCcJcJOBY07cBuFGlrgux3m5/qER9iOrhdFFXZLg bx+DbOJxvSC72iz/9P+epU+Yl/lAz7BvWg007Q1sOf43G4nhryv9UJzww99oJRgfBPA+ l9lTAaCZy/OepN8gl4irVN18YSRQsD8YuMze2fSyT0OFMYMfCYUCXhrGsPX6Gk6BpDnl K0fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oSjh5hcW; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a654489000000b004785d1fa649si38320301pgq.432.2023.01.05.02.20.35; Thu, 05 Jan 2023 02:20:43 -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=oSjh5hcW; 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 S232262AbjAEKIU (ORCPT + 55 others); Thu, 5 Jan 2023 05:08:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbjAEKIR (ORCPT ); Thu, 5 Jan 2023 05:08:17 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4FAC13E32; Thu, 5 Jan 2023 02:08:16 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id cl14so2884183pjb.2; Thu, 05 Jan 2023 02:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zzFihM3brSUyhj9EQhpuT0935H6SDBtRIpGFGva+eS0=; b=oSjh5hcWGIuSYuO5td5hhVRavQ3Vt1WzvJZhVJyr8FVBTs23efK4B+POjJaG6Oz1JG ovuSeRe2ObLwoojm8lON2+VROXpAPPnvSHafe3NPPFz7cMTF7FO5WqgiunIt0yWzXiY6 AvO0fuP+yaH1dvnRB6RTUM9CVbWsTowY1O7+GX6SMeLJwJ7mKkLmPFczGoJx7AxLjl6m GwNRvif7hmWll+dR3m1jUzdIpCL027EClLrnpuWOYQ7pBY1EhJLj3Sourm76MSVCbN1E lS6yyz9hbDPHz1tEkiAPb9+Avtm2AJ9irIy2XL91GtlRAmNSTtwH1bYmQ+R7jgZZ0i2a DAZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zzFihM3brSUyhj9EQhpuT0935H6SDBtRIpGFGva+eS0=; b=fB7wf16sLGfCL2RbnROWJ6OdiViRkf/Z29zigNKrhcsTJeMX+4uOh1HKGXGYFIh60N 2aijhF8po0kK46Y/ym7YTfqD8MBSMx0QsdYG/SCRaKEVeg0oOueFMiuvE0RnjLWzsyDq q9WOwZgj8j5id548AFdfzmpuU8qYnm6vzgqIxgdYHQNVqznwu68G9ETiTZ8ncABTLYAf 05UzKB8vjOR7vgYdENwkW0OPgN/uGaDYJfsohMAw6z6LaViI97FaUfSTlPKwA9aNzdi4 arRDhCSVxHUe9K0yQRfKhQ1RJz7AihPwadakbPhZm717t+QyAdpK5zcmEe3WLVwf220x O8Fg== X-Gm-Message-State: AFqh2krFWqsxKArrp03XfmAUjGyqcySitqkQMlPU/h0uqxyHKKu4a7hg Ryyyd6VmGYQwR8ogr0g+XsxU0bTKRMhbOtzvx30= X-Received: by 2002:a17:90a:19d7:b0:212:b43b:ffe5 with SMTP id 23-20020a17090a19d700b00212b43bffe5mr3786650pjj.32.1672913296192; Thu, 05 Jan 2023 02:08:16 -0800 (PST) MIME-Version: 1.0 References: <20221212153205.3360-1-jiangshanlai@gmail.com> <20221212153205.3360-2-jiangshanlai@gmail.com> In-Reply-To: From: Lai Jiangshan Date: Thu, 5 Jan 2023 18:08:04 +0800 Message-ID: Subject: Re: [PATCH 1/2] kvm: x86/mmu: Reduce the update to the spte in FNAME(sync_page) To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Lai Jiangshan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 14, 2022 at 2:12 AM Sean Christopherson wrote: > > On Mon, Dec 12, 2022, Lai Jiangshan wrote: > > From: Lai Jiangshan > > > > Sometimes when the guest updates its pagetable, it adds only new gptes > > to it without changing any existed one, so there is no point to update > > the sptes for these existed gptes. > > > > Also when the sptes for these unchanged gptes are updated, the AD > > bits are also removed since make_spte() is called with prefetch=true > > which might result unneeded TLB flushing. > > If either of the proposed changes is kept, please move this to a separate patch. > Skipping updates for PTEs with the same protections is separate logical change > from skipping updates when making the SPTE writable. > Did as you suggested: https://lore.kernel.org/lkml/20230105095848.6061-5-jiangshanlai@gmail.com/