Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1240729ioo; Fri, 27 May 2022 04:49:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa9NdyDXoSv+CEoXXY5HeG8RV2WHZB+CrW+yimKXXPFLoPStHlhQo1qbl9gJKbhes7XL9p X-Received: by 2002:a63:5d43:0:b0:3f5:f0ab:8736 with SMTP id o3-20020a635d43000000b003f5f0ab8736mr36630303pgm.598.1653652183623; Fri, 27 May 2022 04:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653652183; cv=none; d=google.com; s=arc-20160816; b=l5AvjpAdwooK/8CXQ/r5UyiS2T8OSB8otPeJzJPrY70Vs2faWGzpGWuRSqLXgKEcMd yTHRMMcx3LkBb+y3xQtFz7OkjejGzJK0wG5xCk7++W/1MrrHJo+eE7baarcllz6y464b tol6/XMkUikqkRmm+Vs3wR6cNt70L333npPfjy4000wXuPVqRw+2szhH9BAnQf++jB+s x6frQ1fFYZxe57u6ROg1pyU0smEgA8t1AyGdxkU6K39JfZBfQs6lvxxkjJO/d3IbYMNx jTtmHUBseZZuE7AWHGpwyiJYcvn5bOp/D1SdDtRuaZ+yRjL93Qr5HdgmFhsF6NkI8o/J ch2g== 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=+NW67VtdRcZQ9Q2m5VakCrqBBwHKOENKxBYUs8sQ/yQ=; b=URJDH00D6py9Xd7vGxRUOscigtyTyeeHAbaXcrrxV/fXA/sQbYQ8vwa8bppFK3Jv9e EC8psoNz2hFiBV4bjN+9NyYdRmH8drt290mSQfTf4RLmU0s8Go38oLt2usgV8UcZUVUy wZo8ghI4LZ5fiLDyqMkQmtehI0mAOaNLw9rb6P2ZCuOtYgI7QOkmkcnIhXdx73w0/8Z/ mwlfLnW4x+d4+LrMYC4ajVE/l9XPw4shgXf2qW+Hf/YuLijmsr54/BcxxLd+M5SVF0Ae 5cHeFFt1nMvOVJBZXShU41ifXctZMGHNJypr58SpR3APQovaFaa80R01A1FR8k1ec0yL K3aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Yrv1E+jB; 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 u16-20020a170902e5d000b0015d0aa41a88si5589610plf.442.2022.05.27.04.49.28; Fri, 27 May 2022 04:49:43 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Yrv1E+jB; 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 S241985AbiEZIxN (ORCPT + 99 others); Thu, 26 May 2022 04:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236407AbiEZIxM (ORCPT ); Thu, 26 May 2022 04:53:12 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99230C3D28; Thu, 26 May 2022 01:53:11 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id y141so1770767ybe.13; Thu, 26 May 2022 01:53:11 -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=+NW67VtdRcZQ9Q2m5VakCrqBBwHKOENKxBYUs8sQ/yQ=; b=Yrv1E+jB0uDVSsEI4SYF2D5OnGbc7IeA3DTCV5ZBpbhfdY9NLr8uQMr8raFjP6EAZ+ 0i9SBhH2Un+uWOgoooUOHmp9P4wq0LtiE4yjA5KJujQayYaaNc+qeq+5d0TiJXwPYUfR wvjQkt0hbO68HJBKGD+8OctEtZvgezcqam0uHOFrEhIZa+JJUas7pDVE3Kb/IZeAoh8M AL1WbCTjXcLS8FXRysvNNp3gTOzuoN73Fi2rmzaWFEcAbN4ckzn6cZ2BJv9/nAbujvJ2 oJzCoYGNlf2r82VZT9HGuYsQYe5GiHGnf6zcgEDfp2tM8/U/O7GDTADlQ23sIRMAQ2E7 y9Hw== 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=+NW67VtdRcZQ9Q2m5VakCrqBBwHKOENKxBYUs8sQ/yQ=; b=Sj5y+Ckcu+QyCYK5IUn6CE49NSDyVdy3P02BHvsZ23Ju5nWlxEheLAWbD7tXO7d7Qf lNqa9RGLzyxzrPZ+MgMupx7y3j4OPZIX7EgSTyU0Ek6kmM0+1cgfd/L1cvrtuEduDb9N 6a2lfAFfsSZuM/eKXApI5m7o+S0U26XYBPZr1+PNO7HoyRBqoOyzz+LJBDnS+ZGVTarT 0RWli5yBrqM6zHgjJzINxvA5pep6dw8aC+0XEPmiwuWUdXPg4MTZ3/HTUwXws53IQx2Z iQ02gWqGiXi3lXYgQ4omctO1/DszuLJH7nPVh62Q6puV+rKIZYpxQmeHJ4UC7NfDtKU1 v1KQ== X-Gm-Message-State: AOAM533HO7tmGIJQm7IbLUYapoW6g/thX8IdZ3ci3bXg4S3ni6iZXdxB SkxE3KMXQrkLyOYSnnNCbtkKk4iZtcAMDKg7mns= X-Received: by 2002:a25:ba10:0:b0:656:e295:9aca with SMTP id t16-20020a25ba10000000b00656e2959acamr2187310ybg.458.1653555190813; Thu, 26 May 2022 01:53:10 -0700 (PDT) MIME-Version: 1.0 References: <20220503150735.32723-1-jiangshanlai@gmail.com> <20220503150735.32723-7-jiangshanlai@gmail.com> In-Reply-To: From: Lai Jiangshan Date: Thu, 26 May 2022 16:52:59 +0800 Message-ID: Subject: Re: [PATCH V2 6/7] KVM: X86/MMU: Allocate mmu->pae_root for PAE paging on-demand To: David Matlack Cc: LKML , "open list:KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)" , Paolo Bonzini , Sean Christopherson , Lai Jiangshan , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , "H. Peter Anvin" 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,T_SCC_BODY_TEXT_LINE 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 Hello Thank you for the review. On Wed, May 18, 2022 at 12:57 AM David Matlack wrote: > > > > -static int __kvm_mmu_create(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu) > > +static void __kvm_mmu_create(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu) > > vcpu is now unused. Removed in V3. > > > { > > - struct page *page; > > int i; > > > > mmu->root.hpa = INVALID_PAGE; > > mmu->root.pgd = 0; > > for (i = 0; i < KVM_MMU_NUM_PREV_ROOTS; i++) > > mmu->prev_roots[i] = KVM_MMU_ROOT_INFO_INVALID; > > optional: Consider open-coding this directly in kvm_mmu_create() and > drop __kvm_mmu_create(). __kvm_mmu_create() is kept, and I don't want to duplicate this code. > > } > > > > int kvm_mmu_create(struct kvm_vcpu *vcpu) > > kvm_mmu_create() could return void now too. Did in v3. Thanks Lai