From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC5BCC433FE for ; Thu, 26 May 2022 20:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348924AbiEZU1L (ORCPT ); Thu, 26 May 2022 16:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235459AbiEZU1I (ORCPT ); Thu, 26 May 2022 16:27:08 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1CAFCE09 for ; Thu, 26 May 2022 13:27:07 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id h13so2601135pfq.5 for ; Thu, 26 May 2022 13:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hK3ULfxu4d3bVNXhOv+N4/y59AUq5R7yu3MMv9k/2+w=; b=rLcLmqKbwp35p4AGCIm1BGwOrP2oLLcybaOH1Zq3/w9p2VR9DsW3uFdyGG2uiAcYyd zDM9obr9y7aPhXr1vH+xbOrE7kCAvOJ/ldMBFZakTuwmBuoGD8JA9+nzZio+cVl7gdmn 9Oz3LeJk35Yj1vPhqtF+OsMqbMP7M8OQGyyyXmqqlAvIugAbjEzGQAUxf1oIHa6bpKTc iNAcMxy1emu9Cy9yd+u4RnfT4kqGEqOQ+78N1EiVXK+5qBTx7JnOuqCY/Bc3VsSrgLp8 /haJm3eCrPxTo9GDFB3a+oDALWpNaj8r/k+jAq8wEkpbFYRGYA+9zFLH5KgXOgLYN25N BuAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hK3ULfxu4d3bVNXhOv+N4/y59AUq5R7yu3MMv9k/2+w=; b=OQTU9SytiAcT850EBlPc7SddtdwbNIR5Mh6wyAN4LujrJ/auTdrAca6eyyZvcfGC1I 8PTRFb83D+dXMx6PF5b2GWgZvpuEYO0MhZeRZtV35A8PROonqo2SVKIqErin6lBM5U+2 93UA/e542FfTnfOCzfaWYcTgAqcRBlcJR0z/w6df+SkQHP3dycZUusz7ljFdfO6qg0ZU zV2IwectE+KRgYLJVSNvdy5YhLykMqxohLa63pEdZRlgM8JF3ubtWmxyQLhXVZ+pEaod yskqhnNjnCuXe0lmB25ahNk4hBRF/8uOhAqlf3nVYpwL/iGFManSG51+UJpE6sSp8Rtx UTpw== X-Gm-Message-State: AOAM532AyHGnDZtZ++Dh6DPsLzUXnzvjNs3/7mb6OlG3G8mNR8OnPzNx KTSHpUBipLbFnIMFnYIYlPXWCiy6JIJzzQ== X-Google-Smtp-Source: ABdhPJyQm2DYkfwZWeQ8c2SXCttADzogmheycQw8zr+/gyBz2OPcFNDoNYn3v2ZRTwFxmpbS6JMcWA== X-Received: by 2002:a63:8aca:0:b0:3f9:f9ed:7426 with SMTP id y193-20020a638aca000000b003f9f9ed7426mr23416520pgd.176.1653596827205; Thu, 26 May 2022 13:27:07 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id l24-20020a17090aaa9800b001e0c1044ceasm55740pjq.43.2022.05.26.13.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 13:27:06 -0700 (PDT) Date: Thu, 26 May 2022 20:27:02 +0000 From: David Matlack To: Lai Jiangshan Cc: LKML , "open list:KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)" , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Maxim Levitsky , Lai Jiangshan Subject: Re: [PATCH V3 00/12] KVM: X86/MMU: Use one-off local shadow page for special roots Message-ID: References: <20220521131700.3661-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2022 at 04:49:09PM +0800, Lai Jiangshan wrote: > 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. Yeah I agree with splitting this fix out to a separate patchset, and ordered after this cleanup so it can be done in one patch. When you get around to it, can you also implement a kvm-unit-test to demonstrate the bug? It would be good to have a regression test. > > Thanks > Lai