From: sashiko-bot@kernel.org
To: "Ackerley Tng via B4 Relay" <devnull+ackerleytng.google.com@kernel.org>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v6 42/43] KVM: selftests: Add script to exercise private_mem_conversions_test
Date: Wed, 27 May 2026 01:21:20 +0000 [thread overview]
Message-ID: <20260527012121.10AD61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260507-gmem-inplace-conversion-v6-42-91ab5a8b19a4@google.com>
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] Installation Path Resolution Failure in `private_mem_conversions_test.sh`
- [High] Silent failure and brittle logic due to unhandled helper utility exit status
- [Medium] Bash syntax error when checking default hugepage size if hugetlbfs is disabled
- [Medium] Redundant execution of `private_mem_conversions_test` binary
--
commit b88f984e8ecc669593e0deefcd4e6e9441fbfa8c
Author: Ackerley Tng <ackerleytng@google.com>
Subject: KVM: selftests: Add script to exercise private_mem_conversions_test
This commit adds a wrapper script to simplify running the
private_mem_conversions_test with various configurations. It automatically
detects hugepage availability to build a list of source types, running tests
across single and multiple memslots.
> diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
> index 6232881be500a..e5769268936a7 100644
> --- a/tools/testing/selftests/kvm/Makefile.kvm
> +++ b/tools/testing/selftests/kvm/Makefile.kvm
> @@ -54,6 +54,7 @@ LIBKVM_loongarch += lib/loongarch/exception.S
>
> # Non-compiled test targets
> TEST_PROGS_x86 += x86/nx_huge_pages_test.sh
> +TEST_PROGS_x86 += x86/private_mem_conversions_test.sh
[Severity: Medium]
Since the script is added to TEST_PROGS_x86 here, the kselftest harness will
execute it. Will the harness also run the underlying
private_mem_conversions_test binary directly if it remains in
TEST_GEN_PROGS_x86?
Should the C test be moved to TEST_GEN_PROGS_EXTENDED_x86 to prevent it from
being executed twice?
> diff --git a/tools/testing/selftests/kvm/x86/private_mem_conversions_test.sh b/tools/testing/selftests/kvm/x86/private_mem_conversions_test.sh
> new file mode 100755
> index 0000000000000..7179a4fcdd498
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/x86/private_mem_conversions_test.sh
> @@ -0,0 +1,128 @@
[ ... ]
> +script_dir=$(dirname "$(realpath "$0")")
> +test_executable="${script_dir}/private_mem_conversions_test"
> +kvm_has_gmem_attributes_tool="${script_dir}/../kvm_has_gmem_attributes"
[Severity: High]
Will this path resolution work correctly when tests are executed from an
installed location (e.g., after make install)?
When installed, TEST_PROGS and TEST_GEN_PROGS_EXTENDED typically end up in
the same flat directory. Does looking for the helper tool in script_dir/../
cause the script to fail immediately with a "utility not found" error in
that environment?
[ ... ]
> +kvm_has_gmem_attributes=$("$kvm_has_gmem_attributes_tool" | tail -n1)
> +
> +if [ "$kvm_has_gmem_attributes" -eq 1 ]; then
[Severity: High]
Does this pipeline hide the exit status of the helper tool since set -o
pipefail is not used?
If /dev/kvm is missing, the helper tool might output a SKIP message instead
of a number. Will evaluating the output against 1 trigger a bash syntax
error (integer expression expected), causing the script to incorrectly fall
into the else block?
If it falls into the else block, wouldn't it attempt to run all the
hugepage tests, which will then individually skip and return KSFT_SKIP (4)?
Will the wrapper script misinterpret this return code as a hard failure?
[ ... ]
> + default_hugepage_size_kb=$(get_default_hugepage_size_in_kb)
> + hugepage_default_enabled=0
> + if [ "$default_hugepage_size_kb" -eq 2048 ]; then
[Severity: Medium]
What happens here if CONFIG_HUGETLB_PAGE is disabled in the kernel?
In that case, /proc/meminfo won't contain Hugepagesize:, making the result
from get_default_hugepage_size_in_kb() an empty string. Will evaluating an
empty string against 2048 trigger a bash syntax error and pollute the test
output?
Should the variable be validated as a non-empty integer or defaulted to 0
before the numeric comparison?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260507-gmem-inplace-conversion-v6-0-91ab5a8b19a4@google.com?part=42
next prev parent reply other threads:[~2026-05-27 1:21 UTC|newest]
Thread overview: 144+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 20:22 [PATCH v6 00/43] guest_memfd: In-place conversion support Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 01/43] KVM: guest_memfd: Introduce per-gmem attributes, use to guard user mappings Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-08 23:36 ` Ackerley Tng
2026-05-22 21:45 ` Ackerley Tng
2026-05-07 20:22 ` [PATCH v6 02/43] KVM: Rename KVM_GENERIC_MEMORY_ATTRIBUTES to KVM_VM_MEMORY_ATTRIBUTES Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 12:08 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 03/43] KVM: Enumerate support for PRIVATE memory iff kvm_arch_has_private_mem is defined Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 12:08 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 04/43] KVM: Stub in ability to disable per-VM memory attribute tracking Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 12:08 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 05/43] KVM: guest_memfd: Wire up kvm_get_memory_attributes() to per-gmem attributes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 12:08 ` Fuad Tabba
2026-05-20 18:59 ` Sean Christopherson
2026-05-20 21:44 ` Ackerley Tng
2026-05-21 7:19 ` Fuad Tabba
2026-05-21 13:31 ` Sean Christopherson
2026-05-21 13:48 ` Fuad Tabba
2026-05-21 14:29 ` Ackerley Tng
2026-05-27 15:35 ` Ackerley Tng
2026-05-07 20:22 ` [PATCH v6 06/43] KVM: x86/mmu: Bug the VM if gmem attributes are queried to determine max mapping level Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 13:33 ` Fuad Tabba
2026-05-20 14:21 ` Sean Christopherson
2026-05-20 20:25 ` Ackerley Tng
2026-05-20 20:39 ` Sean Christopherson
2026-05-27 3:29 ` sashiko-bot
2026-05-07 20:22 ` [PATCH v6 07/43] KVM: guest_memfd: Update kvm_gmem_populate() to use gmem attributes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 13:47 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 08/43] KVM: guest_memfd: Only prepare folios for private pages Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 13:51 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 09/43] KVM: Move kvm_supported_mem_attributes() to kvm_host.h Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 13:53 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 10/43] KVM: guest_memfd: Add base support for KVM_SET_MEMORY_ATTRIBUTES2 Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 14:00 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 11/43] KVM: guest_memfd: Ensure pages are not in use before conversion Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 14:28 ` Fuad Tabba
2026-05-21 7:09 ` Fuad Tabba
2026-05-21 14:36 ` Ackerley Tng
2026-05-07 20:22 ` [PATCH v6 12/43] KVM: guest_memfd: Call arch invalidate hooks on conversion Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 14:30 ` Fuad Tabba
2026-05-20 20:35 ` Ackerley Tng
2026-05-07 20:22 ` [PATCH v6 13/43] KVM: guest_memfd: Return early if range already has requested attributes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 14:44 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 14/43] KVM: guest_memfd: Advertise KVM_SET_MEMORY_ATTRIBUTES2 ioctl Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 15:22 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 15/43] KVM: guest_memfd: Handle lru_add fbatch refcounts during conversion safety check Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 7:13 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 16/43] KVM: guest_memfd: Use actual size for invalidation in kvm_gmem_release() Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 7:30 ` Fuad Tabba
2026-05-21 12:59 ` Sean Christopherson
2026-05-21 13:29 ` Fuad Tabba
2026-05-21 14:40 ` Ackerley Tng
2026-05-07 20:22 ` [PATCH v6 17/43] KVM: guest_memfd: Determine invalidation filter from memory attributes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 7:56 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 18/43] KVM: Move KVM_VM_MEMORY_ATTRIBUTES config definition to x86 Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 8:07 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 19/43] KVM: Let userspace disable per-VM mem attributes, enable per-gmem attributes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 8:44 ` Fuad Tabba
2026-05-21 14:21 ` Sean Christopherson
2026-05-07 20:22 ` [PATCH v6 20/43] KVM: guest_memfd: Enable INIT_SHARED on guest_memfd for x86 Coco VMs Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-20 22:04 ` Ackerley Tng
2026-05-21 8:54 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 21/43] KVM: SEV: Make 'uaddr' parameter optional for KVM_SEV_SNP_LAUNCH_UPDATE Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 9:55 ` Fuad Tabba
2026-05-21 13:21 ` Sean Christopherson
2026-05-21 21:27 ` Ackerley Tng
2026-05-22 13:08 ` Sean Christopherson
2026-05-07 20:22 ` [PATCH v6 22/43] KVM: TDX: Make source page optional for KVM_TDX_INIT_MEM_REGION Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 23/43] KVM: selftests: Create gmem fd before "regular" fd when adding memslot Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 12:11 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 24/43] KVM: selftests: Rename guest_memfd{,_offset} to gmem_{fd,offset} Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-21 12:13 ` Fuad Tabba
2026-05-07 20:22 ` [PATCH v6 25/43] KVM: selftests: Add support for mmap() on guest_memfd in core library Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-22 23:02 ` Ackerley Tng
2026-05-07 20:22 ` [PATCH v6 26/43] KVM: selftests: Add selftests global for guest memory attributes capability Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 27/43] KVM: selftests: Add helpers for calling ioctls on guest_memfd Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 28/43] KVM: selftests: Test basic single-page conversion flow Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 29/43] KVM: selftests: Test conversion flow when INIT_SHARED Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 30/43] KVM: selftests: Test conversion precision in guest_memfd Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 31/43] KVM: selftests: Test conversion before allocation Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 32/43] KVM: selftests: Convert with allocated folios in different layouts Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 33/43] KVM: selftests: Test that truncation does not change shared/private status Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 34/43] KVM: selftests: Test that shared/private status is consistent across processes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-27 1:29 ` sashiko-bot
2026-05-07 20:22 ` [PATCH v6 35/43] KVM: selftests: Test conversion with elevated page refcount Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 36/43] KVM: selftests: Reset shared memory after hole-punching Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 37/43] KVM: selftests: Provide function to look up guest_memfd details from gpa Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 38/43] KVM: selftests: Provide common function to set memory attributes Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-27 1:45 ` sashiko-bot
2026-05-07 20:22 ` [PATCH v6 39/43] KVM: selftests: Check fd/flags provided to mmap() when setting up memslot Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:22 ` [PATCH v6 40/43] KVM: selftests: Make TEST_EXPECT_SIGBUS thread-safe Ackerley Tng
2026-05-07 20:22 ` Ackerley Tng via B4 Relay
2026-05-07 20:23 ` [PATCH v6 41/43] KVM: selftests: Update private_mem_conversions_test to mmap() guest_memfd Ackerley Tng
2026-05-07 20:23 ` Ackerley Tng via B4 Relay
2026-05-07 20:23 ` [PATCH v6 42/43] KVM: selftests: Add script to exercise private_mem_conversions_test Ackerley Tng
2026-05-07 20:23 ` Ackerley Tng via B4 Relay
2026-05-27 1:21 ` sashiko-bot [this message]
2026-05-07 20:23 ` [PATCH v6 43/43] KVM: selftests: Update private memory exits test to work with per-gmem attributes Ackerley Tng
2026-05-07 20:23 ` Ackerley Tng via B4 Relay
2026-05-07 20:34 ` [POC PATCH 0/5] guest_memfd in-place conversion selftests for SNP Ackerley Tng
2026-05-07 20:34 ` [POC PATCH 1/5] KVM: selftests: Initialize guest_memfd with INIT_SHARED Ackerley Tng
2026-05-07 20:34 ` [POC PATCH 2/5] KVM: selftests: Use guest_memfd memory contents in-place for SNP launch update Ackerley Tng
2026-05-07 20:34 ` [POC PATCH 3/5] KVM: selftests: Make guest_code_xsave more friendly Ackerley Tng
2026-05-07 20:34 ` [POC PATCH 4/5] KVM: selftests: Allow specifying CoCo-privateness while mapping a page Ackerley Tng
2026-05-07 20:34 ` [POC PATCH 5/5] KVM: selftests: Test conversions for SNP Ackerley Tng
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=20260527012121.10AD61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=devnull+ackerleytng.google.com@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.