From: Sean Christopherson <seanjc@google.com>
To: Ackerley Tng <ackerleytng@google.com>
Cc: ZongYao.Chen@linux.alibaba.com,
Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Chao Peng <chao.p.peng@linux.intel.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Tianjia Zhang <tianjia.zhang@linux.alibaba.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: selftests: Test guest_memfd binding overlap without GPA overlap
Date: Tue, 19 May 2026 12:54:23 -0700 [thread overview]
Message-ID: <agy_7zPjksEk26qX@google.com> (raw)
In-Reply-To: <CAEvNRgE4o6C8P2jW_MGn=1BHxgmp183UTk_h5YkM+U_MCTMdzA@mail.gmail.com>
On Tue, May 19, 2026, Ackerley Tng wrote:
> Sean Christopherson <seanjc@google.com> writes:
> > @@ -542,6 +542,26 @@ static void test_add_overlapping_private_memory_regions(void)
> > TEST_ASSERT(r == -1 && errno == EEXIST, "%s",
> > "Overlapping guest_memfd() bindings should fail with EEXIST");
> >
> > + /*
> > + * Repeat the overlap tests, but so that there is overlap in the
> > + * guest_memfd bindings (i.e. in guest_memfd file offsets), but _not_
> > + * in the GPA space. Regardless of where there's overlap, KVM should
> > + * return -EEXIST.
> > + */
> > + r = __vm_set_user_memory_region2(vm, MEM_REGION_SLOT, KVM_MEM_GUEST_MEMFD,
> > + MEM_REGION_GPA,
> > + MEM_REGION_SIZE * 2,
> > + 0, memfd, MEM_REGION_SIZE);
> > + TEST_ASSERT(r == -1 && errno == EEXIST, "%s",
> > + "Overlapping guest_memfd() bindings should fail with EEXIST");
> > +
> > + /* And now the back half of the other slot's guest_memfd binding. */
> > + r = __vm_set_user_memory_region2(vm, MEM_REGION_SLOT, KVM_MEM_GUEST_MEMFD,
> > + MEM_REGION_GPA,
> > + MEM_REGION_SIZE * 2,
> > + 0, memfd, MEM_REGION_SIZE * 3);
> > + TEST_ASSERT(r == -1 && errno == EEXIST, "%s",
> > + "Overlapping guest_memfd() bindings should fail with EEXIST");
>
> I just noticed this is kind of odd, what is the purpose of "%s" and then
> filling the string in with a hardcoded string?
Purely oversight. I didn't even see it until you said something :-)
prev parent reply other threads:[~2026-05-19 19:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 7:09 [PATCH 0/2] KVM: Fix guest_memfd binding overlap errno and selftest ZongYao.Chen
2026-05-18 7:09 ` [PATCH 1/2] KVM: guest_memfd: Return -EEXIST for overlapping bindings ZongYao.Chen
2026-05-18 18:32 ` Sean Christopherson
2026-05-18 20:11 ` Ackerley Tng
2026-05-18 7:09 ` [PATCH 2/2] KVM: selftests: Test guest_memfd binding overlap without GPA overlap ZongYao.Chen
2026-05-18 20:05 ` Ackerley Tng
2026-05-18 20:39 ` Sean Christopherson
2026-05-19 18:35 ` Ackerley Tng
2026-05-19 19:54 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agy_7zPjksEk26qX@google.com \
--to=seanjc@google.com \
--cc=ZongYao.Chen@linux.alibaba.com \
--cc=ackerleytng@google.com \
--cc=chao.p.peng@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shuah@kernel.org \
--cc=tianjia.zhang@linux.alibaba.com \
--cc=xiaoyao.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.