From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4166730BF4F for ; Fri, 12 Jun 2026 00:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781225282; cv=none; b=q0Z1AZDZWmb5MaTAkuSQSzU5HjwQKkypU4hwX241fVjS4MSYiQc9pn1l2AeyllGl9jLDHJlC18v+SQ2N01iLakdxHxXTmB3TY0y9Wsbb8CwaQiCegBL6I3K7f6Byk04EJ68N/FugRkrVxbUyBg5QUcmbB4FRIXoiCIUnY0IGOJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781225282; c=relaxed/simple; bh=h577BVlhwjyZstuTojkIOjtR+O6WptqK1x/M0F8lpFk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=f+QbnCbZpBCx4rAROxyuBm1L1ZQeKPDvk6P8sD98AolF8d4pRFwnIkQiauVz2aFnBZyTGWk/ro24bSCghIgIcDXY4V01hskz8ieDoghMm7gQKYr3EheZ2CDrfuRZUJ52FjZtzIklQPe2P7Xr3VYME8tt/V6fSgSMjwiczkkGiAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cRwf3vqc; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cRwf3vqc" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-8428384f31fso339724b3a.3 for ; Thu, 11 Jun 2026 17:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781225280; x=1781830080; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=rzhWZbWsHS56Mtm1pqdd6qpzGzN/wkzZl+RW8jbUHfI=; b=cRwf3vqcYN7PikelEBsHFIy0vNY/CXte3HVG+hMSoRB7a4/60JsuiXrnzP/Pnvxz8a I9ZDKe0DWMtT9tPXrxXX+Njql4oinenRMng7maaeC7d4bBbOO2yxO0ktb2kOonlHsjMN y2AfRRXN59wKBEljzjuDjYIPP5/6WSUqQaFG1QALpntg9uV4x2l4o9dwvRSfKzBM3yj+ gY3eKnqWdxioB/4hVB/TZMeAx8SOR1/Csl8Evs9K7VU3CiQZvlwdx4FVfIQXs3WXPWYK r8tEY2yTvA+70prfY/SjFwzSCeJ6iH2U3leFwDNGL4ODdw8weiJRUbO21cVS0nBjroaP l3+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781225281; x=1781830081; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rzhWZbWsHS56Mtm1pqdd6qpzGzN/wkzZl+RW8jbUHfI=; b=R1Zrjdv2f0D9l+FF9IuKTLbY0X4xlVJAiCRDgocY3socNCZruyoYxPv66IP2U8QAmu KQF7lIoOUkgwuYMIgYrgYDZ1lyynJ7FJEngS3/pnDXCtVYYLGCsjOWscoxO626vbLIDq PxhZ0aIx0Gv7wmw5aRrcYFlhAvO6+jLOxASIvpCET80/WtDTlrNhFB0dDk8zF9VJNxJy zv6wbn7W/v5OCgNk4p4yP6qmpPWAGglXAE5j6pdWxg1HisDlhKZI++lkH5HeAE1byfo7 cch13Fw5jehRP/5XlImlUflacSBhx5mculrDgYEczWW9lFteNP5YqLAzjJwkkajYgy2O 2WqA== X-Forwarded-Encrypted: i=1; AFNElJ84IiouzHm+vFLHOIAzSVYkv2Y5FV6DZSib9mQVFS+AxtXa4DSvuTLX10yNHOJbLAWkia6+34ZYPr0jRMM=@vger.kernel.org X-Gm-Message-State: AOJu0YwwqN4/3IpYQ8npjrMI+Ub0WfTpxN+qHCsxgNmgnXcaRdI2ywta 6AzesfUFrcVTYSi+JuWeAK9Hfvj+74MOVlHeuHm5MMl7ie3dTcfXmBotMcN0nUjfrv0LhaA9XYu aAoq0tA== X-Received: from pglx30.prod.google.com ([2002:a63:171e:0:b0:c85:78c2:3f99]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6300:2208:b0:39b:d5f1:4ff with SMTP id adf61e73a8af0-3b783bb62cdmr673696637.20.1781225280400; Thu, 11 Jun 2026 17:48:00 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 11 Jun 2026 17:47:47 -0700 In-Reply-To: <20260612004755.349925-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260612004755.349925-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog Message-ID: <20260612004755.349925-3-seanjc@google.com> Subject: [GIT PULL] KVM: x86: guest_memfd changes for 7.2 From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson Content-Type: text/plain; charset="UTF-8" Fix a few bugs found by AI (mostly by Sashiko pointing out pre-existing bugs). The following changes since commit b7fbe9a1bf9ee6c967ef77d366ca58c35fcf1887: Merge branch 'kvm-apx-prepare' into HEAD (2026-05-13 12:38:31 -0400) are available in the Git repository at: https://github.com/kvm-x86/linux.git tags/kvm-x86-gmem-7.2 for you to fetch changes up to 48dbe473219832788c3940c84faa7f1df4375d5d: KVM: guest_memfd: fix NUMA interleave index double-counting (2026-06-08 09:15:43 -0700) ---------------------------------------------------------------- KVM guest_memfd changes for 7.2 - Return -EEXIST instead of -EINVAL if userspace attempts to bind a gmem range to multiple memslots, and fix the test that was supposed to ensure KVM returns -EEXIST. - Treat memslot binding offsets and sizes as unsigned values to fix a bug where KVM interprets a large "offset + size" as a negative value and allows a nonsensical offset. - Use the inode number instead of the page offset for the NUMA interleaving index to fix a bug where the effective index would jump by two for consecutive pages (the caller also adds in the page offset). ---------------------------------------------------------------- Michael S. Tsirkin (1): KVM: guest_memfd: fix NUMA interleave index double-counting Sean Christopherson (4): KVM: selftests: Remove unnecessary "%s" formatting of a constant string KVM: guest_memfd: Treat memslot binding offset+size as unsigned values KVM: selftests: Expand the guest_memfd test macros to allow passing the VM KVM: selftests: Add guest_memfd regression test signed offset+size bug Zongyao Chen (2): KVM: guest_memfd: Return -EEXIST for overlapping bindings KVM: selftests: Test guest_memfd binding overlap without GPA overlap tools/testing/selftests/kvm/guest_memfd_test.c | 24 +++++++++++++++-- .../testing/selftests/kvm/set_memory_region_test.c | 31 +++++++++++++++++++--- virt/kvm/guest_memfd.c | 16 ++++++----- virt/kvm/kvm_mm.h | 7 +++-- 4 files changed, 63 insertions(+), 15 deletions(-)