Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2404064ioo; Sat, 28 May 2022 12:33:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYuvnCT9CGWeoQwINXwgVC3tnoOt/htdb1deXX1W5s21cJKRzFCBs5c7wQeVCPTknGgxEm X-Received: by 2002:a05:6a00:1a94:b0:518:b331:fbcf with SMTP id e20-20020a056a001a9400b00518b331fbcfmr28350508pfv.85.1653766383672; Sat, 28 May 2022 12:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653766383; cv=none; d=google.com; s=arc-20160816; b=Ig3siSsgXHZQFlStYPab7GDkGxN3AEr0Ct8ijfNioYiXwUNKCJcYnS/JADoaZ4039s ViL/6/7tunbgMG4YJOT8PLuZS9kWH/3uOEF+JFR5FZdnAmiWtmeyOGdON0xf93oJkIrx ezB9sZAuthSwejpCLk73ae7SKDBZaxwy9LKTmkf3aIzICdAmCklEIh9HeG5hZtuUkYIi gVDRSR1ZTeHsf1BW8WUNewb7CQa5qFNXuqnDSkzOyIoVnaWJX/VXv+2dSPeYu0gIz5SM F+7HuHqGpzUhMPsrH6+J0UgleR1DSu7eP7Oy773FxgEyrFf22DoEgGneKEDnlBnUGZPB t3Tw== 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=lR+TDr5LsguOn0VlHOYnRCFxRx4+aXjTPws9yY6c9Ps=; b=LhW1/al+v/Zv2/kiwHpE9csBnXLVnxIquov6LNR/V93ednkkJQjvaCjqJXeDfFPyRJ UA5m54KjHrqiR0+kkdLklGvmHAjj4AWZQWExLq1aXCdcwHHweJVw62aid2rvwhcY1OF4 JpnlP+aK917D+Jibs5B1fsQdiRLKvARRJAI4FCmyTU7gnVdjwteF9MEEZA4pU/xMwOZN q2RFCkP3YAJ3u6dwDqfIvp6+gSU/kP72GCq8vYhyahW8vllStsBhYtI1mRn/UsJtYbPj soqesGV0+rA4R+auUEZg6jDT7hN+5NLsIUnylVtq55NxMaq3a6D+SWqZ+UImuaiqn8BN 3t7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dePYxaYA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f4-20020a63de04000000b003c67a4e3e22si10218872pgg.138.2022.05.28.12.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:33:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dePYxaYA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 34C0B5933D; Sat, 28 May 2022 12:00:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346767AbiEZItd (ORCPT + 99 others); Thu, 26 May 2022 04:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346758AbiEZItW (ORCPT ); Thu, 26 May 2022 04:49:22 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C761A888A; Thu, 26 May 2022 01:49:21 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-300beab2b76so8068027b3.13; Thu, 26 May 2022 01:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lR+TDr5LsguOn0VlHOYnRCFxRx4+aXjTPws9yY6c9Ps=; b=dePYxaYADwy99/kEkfatg9gM+WrqLQn8Y+9iUnBjSFPp+2Tie1Y91tr9I4Hhr1T//N O8wmRHO23cRkZySp3l66x3VAYRl28qdPbYKZqVuGKqGHnbkcVB0EhFssTUB2+1j1f2xF rhF09KcK/nbrUAMUCGK4BiKhZtvgCR7Z+cpHcE1yKouDwNHZa0DXI+PZvFXk0QSNZvkx YvsKA0ALR5qS1zwW3Vw34gJ3o/InKGBkRQ7VvrST4pnXhgQteFJljhqe1jCJLpUuKI+0 JLQ1SfuGwp2p7vREmVgwFXiWZxxzpnrbXpJ1cquOmhFhuuZyk7IeY/8XFRKV83JgDr90 2cag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lR+TDr5LsguOn0VlHOYnRCFxRx4+aXjTPws9yY6c9Ps=; b=n52BjwyXH8iYW+XtFKr54XjZClQ99zjNkqTXR//4ttezigSwrRo3iDhggtSkfYY7wq essqhlrIA7a7vW67rudT5MjK0GoJsjkGivPiceGj3G6EjyXKc5nTi0+muYr2tGR2VzE+ DrBxhq70Mbtje5a0tYtNKUnC4clD1d46yO6eAeFB9Ki+wkYygN4FRlQedGleq5ocdX8Q ff+7a+alt08dlU0C77NUpMib9mX5vZwyne/BeiZjlyjb2fNFU9byw9IQPY9RgOpH3Dez eBwxOKWUsMgO6iWGSJ1gdt6UE0bEUlXiuHAfNaTIEcAWOCU1PW8E9qtQT6vhuV2D086B pj1Q== X-Gm-Message-State: AOAM532DaSh074UHMkl1ceIHSSkD//r4P00u7VfkyFRqnZD+YrmjS/SM DXCw7hUkPx7nbOCJKer3EVbepuzVE6x5gkAZFP3VNSj1ZiE= X-Received: by 2002:a81:b80d:0:b0:2ff:db8b:333a with SMTP id v13-20020a81b80d000000b002ffdb8b333amr20379755ywe.17.1653554960598; Thu, 26 May 2022 01:49:20 -0700 (PDT) MIME-Version: 1.0 References: <20220521131700.3661-1-jiangshanlai@gmail.com> In-Reply-To: <20220521131700.3661-1-jiangshanlai@gmail.com> From: Lai Jiangshan Date: Thu, 26 May 2022 16:49:09 +0800 Message-ID: Subject: Re: [PATCH V3 00/12] KVM: X86/MMU: Use one-off local shadow page for special roots To: LKML , "open list:KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)" , Paolo Bonzini , Sean Christopherson Cc: Vitaly Kuznetsov , Maxim Levitsky , David Matlack , Lai Jiangshan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Sat, May 21, 2022 at 9:16 PM Lai Jiangshan wrote: > > From: Lai Jiangshan > > Current code uses mmu->pae_root, mmu->pml4_root, and mmu->pml5_root to > setup special roots. The initialization code is complex and the roots > are not associated with struct kvm_mmu_page which causes the code more > complex. > > So add new local shadow pages to simplify it. > > The local shadow pages are associated with struct kvm_mmu_page and > VCPU-local. > > The local shadow pages are created and freed when the roots are > changed (or one-off) which can be optimized but not in the patchset > since the re-creating is light way (in normal case only the struct > kvm_mmu_page needs to be re-allocated and sp->spt doens't, because > it is likely to be mmu->pae_root) > > The patchset also fixes a possible bug described in: > https://lore.kernel.org/lkml/20220415103414.86555-1-jiangshanlai@gmail.com/ > as patch1. > Ping and please ignore patch1 and patch9. It would not cause any conflict without patch1 and patch9 if both are ignored together. The fix is wrong (see new discussion in the above link). So the possible correct fix will not have any conflict with this patchset of one-off local shadow page. I don't want to add extra stuff in this patchset anymore. Thanks Lai