Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp382129imn; Wed, 3 Aug 2022 07:53:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5tYiT5KR4qD7jXusoUM2ac/qI21ehhSdGFSOCXu2ysKuQy31YYQSQxIrQGXe9aaLth44zj X-Received: by 2002:a17:90a:c683:b0:1f4:8565:772f with SMTP id n3-20020a17090ac68300b001f48565772fmr5338818pjt.0.1659538419971; Wed, 03 Aug 2022 07:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659538419; cv=none; d=google.com; s=arc-20160816; b=W8LyS51UanaSOBy3+PQvC+7MI4GqzVrVU8cMwFaSKEj9/ik93+rmj+AqIdCNtf0neK 3KJDqbVgIfzZP+LDr+l21UDbqC8dG0hDU6alVcaUElorWkHCNxC7vtXHYdETuBX1S0ys nbYhma5LcM/rArrYG07gjO768QfOuzcsYkJYsOZFkFMrHhzUQLZcWMJ/eM9znjLj+QtA EHdI78u3wKEMjHztHjQ+TFhspRNhRc2+PTKustHCxy/59x/vncHbpUDsz5QzZ4M2wzv2 RJBlaETAT3O3NPdnnM8ySMllSVVqLQxSE/kBLAAWIoheluUYy0mpAylllyMLR79CrXcR G0Ig== 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:dkim-signature:date; bh=srnNRiym+Gwv1SNk6jv/2f+umKJnkZFoWq/vPcHryts=; b=pbqrFjrk7APWLjQc24pY2EirajXAfRqxp7zj69/3qG2zDg/G7FM5AG69oOVMI8aM9W M+J9mOBChif2qpfLofYiOqCdW9FputMnAd+Zyj2OntDK/Jo1EPflI50GgHXqtNqt/lC8 bWiXO07But+X5i22OaFNJNix0J/ksVEfYOGVaPBGiAE95SFjRSO5KfHom48o37Si3uOy WfW3vPnaFFYW1+scbowmv0CU2xNoJB9X0XXtJXJkLOVEj5IJ5mBmDpRj0KaP+vXTHyQz O+WjOlA/Ts/tl8Uqs1lEq+HVTaJeZQBjQsQ78dhYy7GbCligu+ic7aQF/6+00Y+iHWWa 3fvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bvuEZ1H6; 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=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a170902788200b0016dce92b3b3si2274626pll.84.2022.08.03.07.53.24; Wed, 03 Aug 2022 07:53:39 -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=@linux.dev header.s=key1 header.b=bvuEZ1H6; 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=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237665AbiHCO3q (ORCPT + 99 others); Wed, 3 Aug 2022 10:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbiHCO3o (ORCPT ); Wed, 3 Aug 2022 10:29:44 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9657AF595; Wed, 3 Aug 2022 07:29:43 -0700 (PDT) Date: Wed, 3 Aug 2022 16:29:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1659536981; 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=srnNRiym+Gwv1SNk6jv/2f+umKJnkZFoWq/vPcHryts=; b=bvuEZ1H6ZOfmcpDSy05vq+508ycnN8MhKvcgE6RFyi39+Mx4avt/tLvRUEkdcNGDoGAsBT fFOx3xc8gPBH9gVi468nKC0Ix7314HT4o3DD/sFEyS6kL42xY0LqyS3Rh0kO6jvHzOYl6e Qus6owgdFts9+sh5kc0v7YR7NVR/gHc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Andrew Jones To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 28/40] KVM: selftests: Fill in vm->vpages_mapped bitmap in virt_map() too Message-ID: <20220803142940.65gbhx7ae7mcmfk4@kamzik> References: <20220803134110.397885-1-vkuznets@redhat.com> <20220803134635.399448-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220803134635.399448-1-vkuznets@redhat.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,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, Aug 03, 2022 at 03:46:35PM +0200, Vitaly Kuznetsov wrote: > Similar to vm_vaddr_alloc(), virt_map() needs to reflect the mapping > in vm->vpages_mapped. > > While on it, remove unneeded code wraping in vm_vaddr_alloc(). > > Signed-off-by: Vitaly Kuznetsov > --- > tools/testing/selftests/kvm/lib/kvm_util.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c > index 9889fe0d8919..ad9e15d4c6a9 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -1214,8 +1214,7 @@ vm_vaddr_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min) > > virt_pg_map(vm, vaddr, paddr); > > - sparsebit_set(vm->vpages_mapped, > - vaddr >> vm->page_shift); > + sparsebit_set(vm->vpages_mapped, vaddr >> vm->page_shift); > } > > return vaddr_start; > @@ -1288,6 +1287,8 @@ void virt_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr, > virt_pg_map(vm, vaddr, paddr); > vaddr += page_size; > paddr += page_size; > + > + sparsebit_set(vm->vpages_mapped, vaddr >> vm->page_shift); > } > } > > -- > 2.35.3 > Reviewed-by: Andrew Jones