Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp225614iof; Mon, 6 Jun 2022 02:03:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi4bmMDNSYaPi9zLbEhkC0Mmf+kBAh+SjObSa9rjE1QKO77BMplcHVomphZ6raEs/oHO8v X-Received: by 2002:a17:90a:5409:b0:1e8:664e:41dd with SMTP id z9-20020a17090a540900b001e8664e41ddmr9590170pjh.173.1654506217296; Mon, 06 Jun 2022 02:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654506217; cv=none; d=google.com; s=arc-20160816; b=SOtkCi6pvuGX4oQgm3omkEoYhm4DqXF6gyqk9QG1FhPvqvhRAYcyyDUE4oFm5Nmi8e vqpjIEehUTMDQhC2JogUH3gCg2d/UyWu7Ani8CKEZzfKLjiKhVYZUoCr0YUTSPUtlr7W +BNj0Plz8zofB5/YB+he+gE2MMXff5DjEKQD4W36S+wRLRWJ1pww+ISid36Ta7cur6V1 c2UQvVduDDu4dI5v2N5j3GtpfkDAEOlSxia+gv7Z15CZYwZ+6ju7hbl6sEbjJXCyySqX A7k7rCDQpldY0gacQOgszNooG8NohdnBzaMrkv+7yN4+SGKyN/QXHe/W7djKTT+aR//H kbgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ry63xFrwO6O2lt3NumR064ix6uPD5MMi+epdiiFne5w=; b=nqi56d51aeq6A/zBVe37xaRMWkxhn86PVgmsWf7Xz1q8lPQ7Ny2PkAm1Yhkvzy1+RS D2W/1K5siaxIEy29iLSnxagzxpBZc1JpdcwM5wo60OYCvotRV62zcgoZnwdZeFzaJ0WN 4IvRHos8XE1mEu/PifXTOzyW8ZLClJ3296Ud7yIswdtiCaU8zBrDVZBWSJVtaecl57nq FprhMg9iI1PY0a0cDUH0nWPwX3BdN8e+EZrjjLtB83kA1tsbr8Zh/wmbLrWArtkHk5a6 5xBZQpUUViMgCRsOvTpzAJdHbIG0vzuiaef3IBPzyYe9fZnKARBEEcliOwFDqcn92AqJ DGHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hlYlaanF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u13-20020a170903124d00b00158d6f07b2esi20472500plh.85.2022.06.06.02.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 02:03:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hlYlaanF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A3151C2EF3; Mon, 6 Jun 2022 01:41:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232386AbiFFIkb (ORCPT + 99 others); Mon, 6 Jun 2022 04:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbiFFIiN (ORCPT ); Mon, 6 Jun 2022 04:38:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BDA031912 for ; Mon, 6 Jun 2022 01:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654504690; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ry63xFrwO6O2lt3NumR064ix6uPD5MMi+epdiiFne5w=; b=hlYlaanFJufAaDgtKAjLyZbFkJmiNbwjt8XIIeFYkDg7Omas5chwnz94e/qKfuf77KB45G mH0y+gs/gangyhT4cig/g5BuuMFsqfqkwEhO7gUsgXpfwVpL8a2BemgLx9Et5rFBwMf3Sv 8xbMJzb5xfbxQT+lmeFqNa4xVC1yXfY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-7vHWazwaOv2hLGR58zf-yQ-1; Mon, 06 Jun 2022 04:38:05 -0400 X-MC-Unique: 7vHWazwaOv2hLGR58zf-yQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FA8F80A0AD; Mon, 6 Jun 2022 08:38:04 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.193.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 722701121314; Mon, 6 Jun 2022 08:38:02 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: 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: [PATCH v6 28/38] KVM: selftests: Fill in vm->vpages_mapped bitmap in virt_map() too Date: Mon, 6 Jun 2022 10:36:45 +0200 Message-Id: <20220606083655.2014609-29-vkuznets@redhat.com> In-Reply-To: <20220606083655.2014609-1-vkuznets@redhat.com> References: <20220606083655.2014609-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Similar to vm_vaddr_alloc(), virt_map() needs to reflect the mapping in vm->vpages_mapped. Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/lib/kvm_util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index 1665a220abcb..936be9c9f870 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -1445,6 +1445,9 @@ 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