Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3906756pxj; Tue, 8 Jun 2021 01:23:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwrPa/a8tYhgxh4LTuTjTtxxEIrPp1U9zzIBLIs971mBm2cN+xi9SnpBSgtdURGdtnYuJe X-Received: by 2002:aa7:c9ce:: with SMTP id i14mr24233813edt.148.1623140585066; Tue, 08 Jun 2021 01:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623140585; cv=none; d=google.com; s=arc-20160816; b=zbnPMyYViaF63DICUkDO4Ec9iqXwDQyYG7ZQaSTAHY8pRgcVy92kW3JQebzUfNy4wX LQsUpTrFsbYT9Y9hyTSVX4M6oX6glNliGBpamoXfCtyPetcdrcL6vE7OnFGFT58FBnWT L9gMJH6tmKPbW3HWMf61tGgg562pOJQT+HqsketDQfy7MAZctCOVuRRBDoK0kmLmKc1h LJOuLsFjjtQmlrQHT9NxZLea8ktpzCG8mP5a0ZLWG4D94esvQoQbk/cGoEuzwe/6Tik+ b3Rba5IxLFW+RqK55KhmMiyzCMuMZApZC9xq2XLg1IkUV5r/h9+qKnTn+RrDcfxIGFfA zL4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dMCysKzuhfWQj6CjYw5Jk5VY+X58qQ9BlT7Wd58h01I=; b=ffcEAXZJbBELi/Iid5oX4xPY1M+T6JSW3cPrURTaFVDsrkotlGb45hJMl9eVCTPIqN Bjw/vYTvMkEj2Su/ivUTeB7l8hcFUrynguC9tku/30ToLhcuhmXTdgZYqztCoofXfaDU NhH+lSvsb4FW4yEvSGK4kkBX6UjPDqG/9qGqWnDjNNO99ihvmgemwfJlXgHN0BfG9zcn rCWEnhMoOWtfE2dYEkzjTFWu9xIb5x0qBF5xDB1w1RZnmwRuwuidKFNIuj2SesHoN856 +FL75COrtAho5d/bEV1RXDvvmm3+F8Rwivx3AjVubUFaWnZ2aXSChIdAzWPzvgHDoOcR Csig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iwZ+bpC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id af16si15283886ejc.433.2021.06.08.01.22.41; Tue, 08 Jun 2021 01:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iwZ+bpC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbhFHIXk (ORCPT + 99 others); Tue, 8 Jun 2021 04:23:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51499 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhFHIXk (ORCPT ); Tue, 8 Jun 2021 04:23:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623140507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dMCysKzuhfWQj6CjYw5Jk5VY+X58qQ9BlT7Wd58h01I=; b=iwZ+bpC4zoGVXPlUT2oDxfYnOWAKaPvQM5FmHmz62Nwc34ESwBi+CpOvnvEbAtn0jZOzfw 3WoK9fItQmsaHkJI+hJRUNBZ3OFCxqNSQjAa8m1HzchZBEYRXImRyek5qRtUHK48iH528W 4IkUUy/CyvdMcmXxGwxqNAhHfSSDW0o= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-c76lCHEpOsK3ZpGzFFC0JA-1; Tue, 08 Jun 2021 04:21:46 -0400 X-MC-Unique: c76lCHEpOsK3ZpGzFFC0JA-1 Received: by mail-wm1-f72.google.com with SMTP id o82-20020a1ca5550000b029019ae053d508so429312wme.6 for ; Tue, 08 Jun 2021 01:21:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dMCysKzuhfWQj6CjYw5Jk5VY+X58qQ9BlT7Wd58h01I=; b=WzTgL8iSpbMJFDqEA0NFbmJdcmhmUhEXowDSVIEX/ntzdmQzTAow8lxlIyjoLNdGYn +PLFrzbQWUjYVl8Bkm0xgErKfDCILRni2yXJyOpmGtii3GTTeIAcnRWMwg9I3qD34YWm ULwSGxdHbvJUjPoDCzyPSewQCf/eLHSuUiPd8vWPZ/gmPpnzzaHiRgqi4VjWi+3lcRxb 314cMoW38W4hiuaDkAGM/nVbvNc8ziGoBLpafzG0O57oDDWGZlOzZMtbH5ymucYUM1PN rczL+M1ROTsNbQYyvXMA8BKOu8X02d+q+aA9sci2ZfaF0lKTUHOTwA7HDqBLLUefFquU MhWg== X-Gm-Message-State: AOAM53351n1aN0xSw5JCnw2j0pdOzDZoBUkm8ItbnUDc/BkA9EtD8Lbj dFyBSPiA8Tu8lBdRt2yuA2oEkI+dOONVAKMuk9gXrZXN/QgmN1xQp3JSw5tOECTCYAnxUHq3O6Z 4VAg+njJSZda/iTJiohXFeF1i X-Received: by 2002:a05:6000:1a8f:: with SMTP id f15mr12814164wry.260.1623140505298; Tue, 08 Jun 2021 01:21:45 -0700 (PDT) X-Received: by 2002:a05:6000:1a8f:: with SMTP id f15mr12814155wry.260.1623140505175; Tue, 08 Jun 2021 01:21:45 -0700 (PDT) Received: from gator (93-137-73-41.adsl.net.t-com.hr. [93.137.73.41]) by smtp.gmail.com with ESMTPSA id b135sm2121778wmb.5.2021.06.08.01.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 01:21:44 -0700 (PDT) Date: Tue, 8 Jun 2021 10:21:42 +0200 From: Andrew Jones To: Zhenzhong Duan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, maciej.szmigiero@oracle.com, pbonzini@redhat.com, shuah@kernel.org Subject: Re: [PATCH 1/3] Revert "selftests: kvm: make allocation of extra memory take effect" Message-ID: <20210608082142.umk5jauizkxxs4yb@gator> References: <20210608233816.423958-1-zhenzhong.duan@intel.com> <20210608233816.423958-2-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210608233816.423958-2-zhenzhong.duan@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 07:38:14AM +0800, Zhenzhong Duan wrote: > This reverts commit 39fe2fc96694164723846fccf6caa42c3aee6ec4. > > Parameter extra_mem_pages in vm_create_default() is used to calculate > the page table size for all the memory chunks. > Real memory allocation for non-slot0 memory happens by extra call of > vm_userspace_mem_region_add() outside of vm_create_default(). > > The reverted commit changed above meaning of extra_mem_pages as extra > slot0 memory size. This way made the page table size calculations > open coded in separate test. > > Link: https://lkml.org/lkml/2021/6/3/551 > Signed-off-by: Zhenzhong Duan > --- > tools/testing/selftests/kvm/lib/kvm_util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c > index 28e528c19d28..63418df921f0 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -320,7 +320,7 @@ struct kvm_vm *vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus, > */ > uint64_t vcpu_pages = (DEFAULT_STACK_PGS + num_percpu_pages) * nr_vcpus; > uint64_t extra_pg_pages = (extra_mem_pages + vcpu_pages) / PTES_PER_MIN_PAGE * 2; > - uint64_t pages = DEFAULT_GUEST_PHY_PAGES + extra_mem_pages + vcpu_pages + extra_pg_pages; > + uint64_t pages = DEFAULT_GUEST_PHY_PAGES + vcpu_pages + extra_pg_pages; > struct kvm_vm *vm; > int i; > > -- > 2.25.1 > Reviewed-by: Andrew Jones