From nobody Fri Dec 10 19:15:54 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 631A618DB16A; Fri, 10 Dec 2021 19:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J9gbv12dfz4VZY; Fri, 10 Dec 2021 19:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 037E71FD26; Fri, 10 Dec 2021 19:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BAJFsaq003972; Fri, 10 Dec 2021 19:15:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BAJFsda003971; Fri, 10 Dec 2021 19:15:54 GMT (envelope-from git) Date: Fri, 10 Dec 2021 19:15:54 GMT Message-Id: <202112101915.1BAJFsda003971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 08055452cbf2 - main - libkvm: fix kvm_walk_pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08055452cbf24a3cea48cb4f665bab78d89b7a39 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639163755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CrITl5a78WpnHHXvBUEipctYUUNoWxjlrYcB30fAvxo=; b=xIA8iZ2fO9FwZGTfPPKODa/Cv+LJ2aiYf0Yamyg3vxiR3Ui5ENOusR2qIYw6qtrN+JbD/B 6ZHyazK4AZurZHFPAyGvrOGCFLQOF1/Le7Ftw73Rgh9tosjDIN+Yq19o3xmXYBYiGNRTJl SccJrRQ/U3FPWWRyj0Ua5wGbORxD7bAtARV8PrOmwLoNAXAVgdMo+VpknzEKD2TnxGgP6H R9ZBrFLWBItsi3KpQh7vipaMp1wXFMSy1U6R22749UKZymt7fqXciGGq+fUljIW1vk+hpF 6X3L7O8+QjLxdP39VrDgVVc9A8uxgcOnAbn+hgtgTVzgjA8agOtWjZELCVGL0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639163755; a=rsa-sha256; cv=none; b=MIJeWCraZyfQR3LL2zntCAoeu0n6n+ZZnL/kEYY5EgzFuygnU9UeuojwP6KEZFk85x4lo1 5sn4pYkvxS5P3tXbrOHP99F6JlUO+cwQKkJE93ZFX8kQwRaW/slN3KT5QZ27355P9w+y08 R415dzQlQJo8XstAwnew4q0zw0CulbZURT89SnbcqrAzOc+tm1rJBVT3b/os9OecTvsaKo Dl+MtQ1wGJYq9KQguT9hBZosVKkzzcgov5beTVpP9i90DwjeedB7XIL16S7gcR781yBkbF qC/728whyuKYOJtAmbA9Mu+BFvwe10LEexGxO2nKO1v/R2IVjZKdN6S9iex9hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=08055452cbf24a3cea48cb4f665bab78d89b7a39 commit 08055452cbf24a3cea48cb4f665bab78d89b7a39 Author: Bora Özarslan AuthorDate: 2021-11-25 19:09:26 +0000 Commit: Ed Maste CommitDate: 2021-12-10 19:15:15 +0000 libkvm: fix kvm_walk_pages Correct bitmap operations in _kvm_bitmap_next. Reviewed by: jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19183 --- lib/libkvm/kvm_private.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libkvm/kvm_private.c b/lib/libkvm/kvm_private.c index d853d1643101..a45f66caf2fe 100644 --- a/lib/libkvm/kvm_private.c +++ b/lib/libkvm/kvm_private.c @@ -792,8 +792,8 @@ _kvm_bitmap_next(struct kvm_bitmap *bm, u_long *idx) /* Find the next valid idx. */ for (; *idx < first_invalid; (*idx)++) { - unsigned int mask = *idx % CHAR_BIT; - if ((bm->map[*idx * CHAR_BIT] & mask) == 0) + unsigned int mask = 1U << (*idx % CHAR_BIT); + if ((bm->map[*idx / CHAR_BIT] & mask) != 0) break; }