From: sashiko-bot@kernel.org
To: "Lisa Wang" <wyihan@google.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH RFC 5/9] KVM: selftests: TDX: Add TDX MSR writes test
Date: Sat, 05 Dec 2026 00:52:00 +0000 [thread overview]
Message-ID: <sashiko-outbox-250856@kernel.org> (raw)
In-Reply-To: <20261205-tdx-selftests-ii-v1-5-dd9f6b6fe20c@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: selftests: TDX: open-coded ioctl(vm->fd) instead of
vm_ioctl()
--
commit babee75eda577fd6f7515ca6cc87a220d59dce44
Author: Sagi Shahar <sagis@google.com>
KVM: selftests: TDX: Add TDX MSR writes test
This commit adds a TDX selftest and TDVMCALL_WRMSR helper to verify
allowed and denied MSR writes configured via KVM_X86_SET_MSR_FILTER.
> diff --git a/tools/testing/selftests/kvm/x86/tdx_vm_test.c b/tools/testing/selftests/kvm/x86/tdx_vm_test.c
> index 02b317371f61e..5e043f1fd62c4 100644
> --- a/tools/testing/selftests/kvm/x86/tdx_vm_test.c
> +++ b/tools/testing/selftests/kvm/x86/tdx_vm_test.c
> @@ -93,6 +93,65 @@ TDX_TEST(verify_td_io_read, guest_io_read)
[ ... ]
> +static void apply_tdx_msr_test_filter(struct kvm_vm *vm)
> +{
> + int ret;
> +
> + ret = kvm_check_cap(KVM_CAP_X86_MSR_FILTER);
> + TEST_ASSERT(ret, "KVM_CAP_X86_MSR_FILTER is unavailable");
> + ret = ioctl(vm->fd, KVM_X86_SET_MSR_FILTER, &tdx_msr_test_filter);
> + TEST_ASSERT(ret == 0, "KVM_X86_SET_MSR_FILTER failed");
> +}
[Severity: Low]
Could this use vm_ioctl(vm, KVM_X86_SET_MSR_FILTER, &tdx_msr_test_filter)
instead of calling ioctl() on vm->fd directly?
vm_ioctl() provides compile-time ioctl argument size checking, dead-VM
detection on EIO, and formatted errno output on failure, matching other
x86 KVM selftests such as userspace_msr_exit_test.c.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205-tdx-selftests-ii-v1-0-dd9f6b6fe20c@google.com?part=5
next prev parent reply other threads:[~2026-12-05 0:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 0:36 [PATCH RFC 0/9] TDX KVM selftests phase II Lisa Wang
2026-12-05 0:36 ` [PATCH RFC 1/9] KVM: selftests: TDX: Add TDX_TEST() macro to tdx_vm_test Lisa Wang
2026-12-05 0:36 ` [PATCH RFC 2/9] KVM: selftests: TDX: Add TDX IO writes test Lisa Wang
2026-12-05 0:48 ` sashiko-bot
2026-12-05 0:36 ` [PATCH RFC 3/9] KVM: selftests: TDX: Support single output in __tdvmcall() Lisa Wang
2026-12-05 0:36 ` [PATCH RFC 4/9] KVM: selftests: TDX: Add TDX IO reads test Lisa Wang
2026-12-05 0:47 ` sashiko-bot
2026-12-05 0:36 ` [PATCH RFC 5/9] KVM: selftests: TDX: Add TDX MSR writes test Lisa Wang
2026-12-05 0:52 ` sashiko-bot [this message]
2026-12-05 0:36 ` [PATCH RFC 6/9] KVM: selftests: TDX: Add TDX MSR reads test Lisa Wang
2026-12-05 0:36 ` [PATCH RFC 7/9] KVM: selftests: TDX: Add TDX MMIO writes test Lisa Wang
2026-12-05 0:36 ` [PATCH RFC 8/9] KVM: selftests: TDX: Add TDX MMIO reads test Lisa Wang
2026-12-05 0:36 ` [PATCH RFC 9/9] KVM: selftests: TDX: Add TDX CPUID leaf 0x1 test Lisa Wang
2026-12-05 0:57 ` sashiko-bot
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=sashiko-outbox-250856@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wyihan@google.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.